From 09ce82c6ada663696e43035d0da1110b9c96194e Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Mon, 18 Sep 2023 19:14:38 +0800 Subject: [PATCH] fix build & code format --- code/src/.editorconfig | 2 +- .../BranchManagement/Dto/BranchDto.cs | 2 +- .../Dto/CreateOrUpdateBranchDto.cs | 2 +- .../BranchManagement/Dto/GetBranchInputDto.cs | 2 +- .../BranchManagement/IBranchAppService.cs | 2 +- .../Permissions/Dto/ApplicationAuthes.cs | 2 +- .../Dto/CreateOrUpdateUserBranchDto.cs | 7 +- .../Dto/GetUserBranchInput.cs | 2 +- .../Dto/UserBranchDto.cs | 4 +- .../IUserBranchAppService.cs | 4 +- .../BaseServiceApplicationContractsModule.cs | 2 +- ...aseServicePermissionDefinitionProvider .cs | 5 +- .../Permissions/BaseServicePermissions.cs | 5 - .../RelationData/Dto/BranchPermissionDto.cs | 2 +- .../RelationData/Dto/BranchRoleDto.cs | 4 +- .../RelationData/IBranchRelationAppService.cs | 4 +- .../Dto/AuditLogActionDto.cs | 2 +- .../AuditLoggingManagement/Dto/AuditLogDto.cs | 2 +- .../Dto/EntityChangeDto.cs | 2 +- .../Dto/EntityPropertyChangeDto.cs | 2 +- .../Dto/GetAuditLogsInput.cs | 3 +- .../GetAverageExecutionDurationPerDayInput.cs | 2 +- ...GetAverageExecutionDurationPerDayOutput.cs | 2 +- .../IAuditLoggingAppService.cs | 4 +- .../Systems/UserManagement/IUserAppService.cs | 6 +- ...BaseServiceApplicationAutoMapperProfile.cs | 8 +- .../BaseServiceApplicationModule.cs | 2 +- .../BranchManagement/BranchAppService.cs | 79 +- .../UserManagement/TokenAppService.cs | 10 +- .../UserManagement/UserAppService.cs | 69 +- .../UserManagement/UserBranchAppService.cs | 66 +- .../BaseService.Domain/BaseData/Branch.cs | 5 +- .../BaseService.Domain/BaseData/UserBranch.cs | 8 +- .../BaseData/UserBranchRole.cs | 11 +- .../BaseService.Domain/BaseServiceConsts.cs | 2 +- .../BaseServiceDomainModule.cs | 2 +- .../BaseServiceModuleExtensionConfigurator.cs | 2 +- .../Localization/BaseServiceResource.cs | 2 +- .../RelationBaseData/BranchRole.cs | 10 +- .../BaseService.Domain/Users/AppUser.cs | 3 +- .../BaseDbContextModelCreatingExtensions.cs | 8 +- .../BaseEfCoreEntityExtensionMappings.cs | 6 - .../BaseServiceDbContext.cs | 7 +- .../BaseServiceEntityFrameworkCoreModule.cs | 2 +- .../Migrations/20230822033456_202308220001.cs | 2 +- .../20230822034321_2023082200001.cs | 2 +- .../BaseData/OrganizationController.cs | 2 +- .../BaseData/UserBranchRoleController.cs | 2 +- .../BaseServiceHttpApiModule.cs | 2 +- .../Controllers/BaseServiceController.cs | 2 +- .../Systems/UserController.cs | 2 +- .../AuthServer/AuthServerDataSeeder.cs | 69 +- .../AuthServer/AuthServerHostModule.cs | 7 +- .../AuthServerDbContext.cs | 2 +- .../AuthServerDbContextFactory.cs | 2 +- .../BaseServiceHostModule.cs | 72 +- .../SettleAccount.HttpApi.Host/Exception.cs | 10 - .../SettleAccount.HttpApi.Host/Program.cs | 91 +- .../SettleAccountHttpApiHostModule.cs | 91 +- .../SettleAccount.HttpApi.Host/Startup.cs | 137 +-- .../ExcelImporterHeadDescAttribute.cs | 4 +- .../Bases/RequestInputBase.cs | 4 +- .../Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs | 25 +- .../Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs | 24 +- .../Entities/BQ/Dtos/BBAC_PD_DTO.cs | 14 +- .../Entities/BQ/Dtos/BBAC_SA_DTO.cs | 457 ++++--- .../Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs | 799 ++++++------- .../Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs | 9 +- .../BQ/Dtos/EdiSeCompareRequestDto.cs | 69 +- .../Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs | 48 +- .../Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs | 20 +- .../Entities/BQ/Dtos/HBPO_PD_DTO.cs | 7 +- .../Entities/BQ/Dtos/HBPO_SA_DTO.cs | 505 ++++---- .../Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs | 797 ++++++------- .../Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs | 2 +- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 24 +- .../Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs | 235 ++-- .../Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs | 33 +- .../Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs | 32 +- .../Entities/BQ/Dtos/PUB_PD_DTO.cs | 8 +- .../Entities/BQ/Dtos/PUB_SA_DTO.cs | 1047 +++++++++-------- .../Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs | 749 ++++++------ .../Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs | 95 +- .../Entities/BQ/Dtos/RequestDto.cs | 2 +- .../Entities/BQ/Dtos/SaSeCompareRequestDto.cs | 91 +- .../BQ/Dtos/TB_RePartsRelationship_DTO.cs | 2 +- .../Entities/BQ/IBBAC_BA_SERVICE.cs | 16 - .../Entities/BQ/IBBAC_CAN_SA_SERVICE.cs | 8 +- .../Entities/BQ/IBBAC_NOT_SA_SERVICE.cs | 4 - .../Entities/BQ/IBBAC_PD_SERVICE.cs | 14 - .../Entities/BQ/IBBAC_SE_EDI_SERVICE.cs | 6 - .../Entities/BQ/IHBPO_BA_SERVICE.cs | 6 - .../Entities/BQ/IHBPO_CAN_SA_SERVICE.cs | 20 +- .../Entities/BQ/IHBPO_NOT_SA_SERVICE.cs | 4 - .../Entities/BQ/IHBPO_PD_SERVICE.cs | 6 - .../Entities/BQ/IHBPO_SE_EDI_SERVICE.cs | 6 - .../Entities/BQ/IINVOICE_SERVICE.cs | 6 - .../Entities/BQ/IPUB_BA_SERVICE.cs | 6 - .../Entities/BQ/IPUB_CAN_SA_SERVICE.cs | 4 - .../Entities/BQ/IPUB_NOT_SA_SERVICE.cs | 4 - .../Entities/BQ/IPUB_PD_SERVICE.cs | 6 - .../Entities/Boms/BomCreateDto.cs | 9 +- .../Entities/Boms/BomCreateOrUpdateDtoBase.cs | 10 +- .../Entities/Boms/BomDto.cs | 119 +- .../Entities/Boms/BomExportDto.cs | 141 +-- .../Entities/Boms/BomRequestDto.cs | 4 +- .../Entities/Boms/BomUpdateDto.cs | 10 +- .../Entities/Boms/BomVersionDtoBase.cs | 24 +- .../Entities/Boms/IBomAppService.cs | 88 +- .../Entities/Boms/ImportBomDto.cs | 22 +- .../CodeSettingTables/CodeSettingDtoBase.cs | 39 +- .../ICodeSettingAppService.cs | 8 +- .../Controls/CentralizedControlDtoBase.cs | 14 +- .../Controls/ICentralizedControlAppService.cs | 14 +- .../Entities/ERPShpping/ERPShppingDto.cs | 24 +- .../Entities/FISes/FISDtoBase.cs | 80 +- .../Entities/FISes/FISVersionDtoBase.cs | 41 +- .../Entities/FISes/FIS_THDtoBase.cs | 25 +- .../Entities/FISes/IFISAppService.cs | 38 +- .../Entities/Factories/FactoryDtoBase.cs | 32 +- .../Entities/Factories/IFactoryAppService.cs | 18 - .../ImportColumnMapDtoBase.cs | 11 +- .../ImportColumnMaps/ImportColumnMapHelper.cs | 7 +- .../Inventories/IInventoryDetailAppService.cs | 32 +- .../Inventories/InventoryDetailCreateDto.cs | 13 +- .../Inventories/InventoryDetailDto.cs | 20 +- .../Inventories/InventoryDetailDtoBase.cs | 18 +- .../Inventories/InventoryDetailExportDto.cs | 39 +- .../Inventories/InventoryDetailImportDto.cs | 22 +- .../Inventories/InventoryDetailRequestDto.cs | 19 +- .../Inventories/InventoryDetailUpdateDto.cs | 18 +- .../InventoryDetailVersionDtoBase.cs | 29 +- .../InvoiceSettledDiffs/InvoiceSettledDiff.cs | 28 +- .../InvoiceSettledDiffVersion.cs | 22 +- .../Entities/Invoices/IInvoiceAppService.cs | 6 +- .../Entities/Invoices/InvoiceDtoBase.cs | 31 +- .../Invoices/InvoiceVersionDtoBase.cs | 22 +- .../IItemInvoicePriceAppService.cs | 86 +- .../ImportItemInvoicePriceDto.cs | 34 +- .../ItemInvoicePriceCreateDto.cs | 9 +- .../ItemInvoicePriceCreateOrUpdateDtoBase.cs | 19 +- .../ItemInvoicePrices/ItemInvoicePriceDto.cs | 21 +- .../ItemInvoicePriceExportDto.cs | 38 +- .../ItemInvoicePriceRequestDto.cs | 12 +- .../ItemInvoicePriceUpdateDto.cs | 10 +- .../ItemInvoicePriceVersionDtoBase.cs | 27 +- .../Entities/Items/IItemAppService.cs | 2 +- .../Entities/Items/ItemCreateDto.cs | 6 +- .../Items/ItemCreateOrUpdateDtoBase.cs | 13 +- .../Entities/Items/ItemDto.cs | 12 +- .../Entities/Items/ItemRequestDto.cs | 8 +- .../Entities/Items/ItemUpdateDto.cs | 10 +- .../IMaterialRelationshipAppService.cs | 2 +- .../MaterialRelationshipDtoBase.cs | 69 +- .../Entities/Materials/IMaterialAppService.cs | 8 +- .../Entities/Materials/MaterialDtoBase.cs | 38 +- .../Prebatches/IPrebatchAppService.cs | 10 - .../Entities/Prebatches/PrebatchDtoBase.cs | 32 +- .../Entities/Prices/PriceListDtoBase.cs | 789 ++++++------- .../Prices/PriceListVersionDtoBase.cs | 45 +- .../ISettleAccountAppService.cs | 35 +- .../SettleAccounts/SettleAccountCreateDto.cs | 9 +- .../SettleAccounts/SettleAccountDto.cs | 43 +- .../SettleAccounts/SettleAccountDtoBase.cs | 14 +- .../SettleAccounts/SettleAccountExportDto.cs | 29 +- .../SettleAccounts/SettleAccountImportDto.cs | 37 +- .../SettleAccounts/SettleAccountRequestDto.cs | 34 +- .../SettleAccounts/SettleAccountUpdateDto.cs | 11 +- .../SettleAccountVersionDtoBase.cs | 22 +- .../ISettlementPakAndSparePartsAppService.cs | 70 +- .../SettlementPakAndSparePartsCreateDto.cs | 13 +- ...ntPakAndSparePartsCreateOrUpdateDtoBase.cs | 11 +- .../SettlementPakAndSparePartsDto.cs | 20 +- .../SettlementPakAndSparePartsExportDto.cs | 32 +- .../SettlementPakAndSparePartsRequestDto.cs | 19 +- .../SettlementPakAndSparePartsUpdateDto.cs | 8 +- ...ettlementPakAndSparePartsVersionDtoBase.cs | 46 +- .../ISettlementPartAppService.cs | 86 +- .../ImportSettlementPartDto.cs | 23 +- .../SettlementPartCreateDto.cs | 13 +- .../SettlementPartCreateOrUpdateDtoBase.cs | 11 +- .../SettlementParts/SettlementPartDto.cs | 14 +- .../SettlementPartExportDto.cs | 32 +- .../SettlementPartRequestDto.cs | 8 +- .../SettlementPartUpdateDto.cs | 10 +- .../SettlementPartVersionDtoBase.cs | 48 +- .../CustomerStorageLocationDtoBase.cs | 31 +- .../ICustomerStorageLocationAppService.cs | 13 - .../ISupplierItemSetUpAppService.cs | 9 - .../SupplierItemSetUpDatoBase.cs | 33 +- .../Entities/TaskJobs/JobDto.cs | 6 +- .../Entities/TaskJobs/JobRequstDto.cs | 41 +- .../Entities/TaskJobs/TaskJobDto.cs | 17 +- .../Entities/TaskJobs/TaskJobExportDto.cs | 19 +- .../Entities/TaskJobs/TaskJobImportDto.cs | 17 +- .../Entities/TaskJobs/TaskJobRequestDto.cs | 16 +- .../Entities/TaskListDto.cs | 38 +- .../IUnHQSettleAppService.cs | 15 +- .../UnHQSettleAccounts/UnHQSettleCreateDto.cs | 6 +- .../UnHQSettleAccounts/UnHQSettleDto.cs | 7 +- .../UnHQSettleAccounts/UnHQSettleDtoBase.cs | 7 +- .../UnHQSettleAccounts/UnHQSettleExportDto.cs | 7 +- .../UnHQSettleAccounts/UnHQSettleImportDto.cs | 7 +- .../UnHQSettleRequestDto.cs | 7 +- .../UnHQSettleVersionDtoBase.cs | 10 +- .../Entities/VWKanBan/IVWKanBanAppService.cs | 31 +- .../Entities/VWKanBan/VWKanBanCreateDto.cs | 9 +- .../Entities/VWKanBan/VWKanBanDto.cs | 31 +- .../Entities/VWKanBan/VWKanBanDtoBase.cs | 14 +- .../Entities/VWKanBan/VWKanBanExportDto.cs | 10 +- .../Entities/VWKanBan/VWKanBanImportDto.cs | 13 +- .../VWKanBan/VWKanBanImport_EmpDto.cs | 8 +- .../Entities/VWKanBan/VWKanBanRequestDto.cs | 11 +- .../VWKanBan/VWKanBanVersionDtoBase.cs | 20 +- .../Entities/VWKanBan/VWKanBantUpdateDto.cs | 11 +- .../Entities/Wms/WmsDetailReportDto.cs | 32 +- .../Entities/Wms/WmsJitOutPutDetialDto.cs | 78 +- .../ExportReports/ErrorExportDto.cs | 14 +- .../BTSeqKBDiffDetailDto.cs | 20 +- .../InvoicePriceListDiffDto.cs | 111 +- .../SecActualDistributionDetailDto.cs | 34 +- .../SecCumulativeSummaryDiffExportDto.cs | 22 +- .../SecSettlementAssemblyPartDto.cs | 31 +- .../SecStandardDistributionDetailDto.cs | 33 +- .../SecSummaryOutPutDto.cs | 35 +- .../ExcelFiles/Dto/BlobDto.cs | 6 +- .../ExcelFiles/Dto/GetBlobRequestDto.cs | 7 +- .../ExcelFiles/Dto/SaveBlobInputDto.cs | 7 +- .../ExcelFiles/IFileAppService.cs | 6 +- .../ImportExcelCommon/ExcelImportDto.cs | 6 +- .../GetExcelImportRequestDto.cs | 7 +- .../IExcelImportAppService.cs | 6 +- .../ISecBTSummaryExportImporter.cs | 4 - .../ISecSummaryExportImporter.cs | 6 - .../IZipBTExportAppService.cs | 4 - .../ImportExcelCommon/IZipExportAppService.cs | 4 - .../SaveExcelImportInputDto.cs | 7 +- ...ttleAccountPermissionDefinitionProvider.cs | 30 +- .../Permissions/SettleAccountPermissions.cs | 64 +- .../BTNotConsignReportCreateDto.cs | 11 +- ...BTNotConsignReportCreateOrUpdateDtoBase.cs | 14 +- .../BTNotConsignReportDetailDto.cs | 11 +- .../BTNotConsignReportDetailExportDto.cs | 14 +- .../BTNotConsignReportDetailRequestDto.cs | 6 +- .../BTNotConsignReportDto.cs | 10 +- .../BTNotConsignReportRequestDto.cs | 5 +- .../BTNotConsignReportStatisticRequestDto.cs | 7 +- .../BTNotConsignReportUpdateDto.cs | 4 +- .../IBTNotConsignReportAppService.cs | 8 +- .../BTSeqKBDiffReportCreateDto.cs | 11 +- .../BTSeqKBDiffReportCreateOrUpdateDtoBase.cs | 18 +- .../BTSeqKBDiffReportDetailDto.cs | 15 +- .../BTSeqKBDiffReportDetailExportDto.cs | 18 +- .../BTSeqKBDiffReportDetailRequestDto.cs | 6 +- .../BTSeqKBDiffReportDto.cs | 10 +- .../BTSeqKBDiffReportRequestDto.cs | 5 +- .../BTSeqKBDiffReportStatisticRequestDto.cs | 9 +- .../BTSeqKBDiffReportUpdateDto.cs | 4 +- .../IBTSeqKBDiffReportAppService.cs | 7 +- .../BTStockUnsettledDiffReportDetailDto.cs | 31 +- ...StockUnsettledDiffReportDetailExportDto.cs | 24 +- ...tockUnsettledDiffReportDetailRequestDto.cs | 10 +- .../BTStockUnsettledDiffReportDto.cs | 10 +- .../BTStockUnsettledDiffReportRequestDto.cs | 5 +- ...kUnsettledDiffReportStatisticRequestDto.cs | 8 +- .../IBTStockUnsettledDiffReportAppService.cs | 9 +- .../EstimatedStockDiffReportCreateDto.cs | 16 +- ...tedStockDiffReportCreateOrUpdateDtoBase.cs | 19 +- .../EstimatedStockDiffReportDetailDto.cs | 20 +- ...EstimatedStockDiffReportDetailExportDto.cs | 21 +- ...stimatedStockDiffReportDetailRequestDto.cs | 6 +- .../EstimatedStockDiffReportDto.cs | 10 +- .../EstimatedStockDiffReportRequestDto.cs | 7 +- ...matedStockDiffReportStatisticRequestDto.cs | 8 +- .../EstimatedStockDiffReportUpdateDto.cs | 4 +- .../IEstimatedStockDiffReportAppService.cs | 10 +- .../HQNotConsignReportCreateDto.cs | 11 +- ...HQNotConsignReportCreateOrUpdateDtoBase.cs | 14 +- .../HQNotConsignReportDetailDto.cs | 11 +- .../HQNotConsignReportDetailExportDto.cs | 14 +- .../HQNotConsignReportDetailRequestDto.cs | 6 +- .../HQNotConsignReportDto.cs | 10 +- .../HQNotConsignReportRequestDto.cs | 5 +- .../HQNotConsignReportStatisticRequestDto.cs | 7 +- .../HQNotConsignReportUpdateDto.cs | 4 +- .../IHQNotConsignReportAppService.cs | 8 +- .../HQSPNotConsignReportCreateDto.cs | 11 +- ...SPNotConsignReportCreateOrUpdateDtoBase.cs | 14 +- .../HQSPNotConsignReportDetailDto.cs | 11 +- .../HQSPNotConsignReportDetailExportDto.cs | 14 +- .../HQSPNotConsignReportDetailRequestDto.cs | 6 +- .../HQSPNotConsignReportDto.cs | 10 +- .../HQSPNotConsignReportRequestDto.cs | 5 +- ...HQSPNotConsignReportStatisticRequestDto.cs | 7 +- .../HQSPNotConsignReportUpdateDto.cs | 4 +- .../IHQSPNotConsignReportAppService.cs | 8 +- .../ReportRequestDto/ReportRequestDto.cs | 41 +- .../Reports/SecMatch/SecMatchBaseDto.cs | 15 +- .../Reports/SecMatch/SecMatchBaseOutPutDto.cs | 8 - .../SecMatch/SecMatchBaseRequestDto.cs | 16 +- .../SecMatch/SecMatchBaseSupplierOutPutDto.cs | 6 - .../SecMatch/SecMatchSummaryOutPutDto.cs | 10 +- ...ondaryActuralAdjustmentReportAppService.cs | 8 +- ...condaryActuralAdjustmentReportCreateDto.cs | 13 +- ...alAdjustmentReportCreateOrUpdateDtoBase.cs | 18 +- ...condaryActuralAdjustmentReportDetailDto.cs | 23 +- ...yActuralAdjustmentReportDetailExportDto.cs | 26 +- ...ActuralAdjustmentReportDetailRequestDto.cs | 6 +- .../SecondaryActuralAdjustmentReportDto.cs | 10 +- ...ondaryActuralAdjustmentReportRequestDto.cs | 5 +- ...condaryActuralAdjustmentReportUpdateDto.cs | 4 +- .../SecondaryActuralBTDto.cs | 4 - .../SecondaryActuralDto.cs | 13 +- .../ISecondaryActuralDiffReportAppService.cs | 8 +- .../SecondaryActuralDiffReportCreateDto.cs | 13 +- ...yActuralDiffReportCreateOrUpdateDtoBase.cs | 18 +- .../SecondaryActuralDiffReportDetailDto.cs | 26 +- ...condaryActuralDiffReportDetailExportDto.cs | 26 +- ...ondaryActuralDiffReportDetailRequestDto.cs | 6 +- .../SecondaryActuralDiffReportDto.cs | 10 +- .../SecondaryActuralDiffReportRequestDto.cs | 5 +- .../SecondaryActuralDiffReportUpdateDto.cs | 4 +- .../DiffUnsetttleReportDto.cs | 33 +- .../ISendUnsettledDiffReportAppService.cs | 10 +- .../SendUnsettledDiffReportCreateDto.cs | 11 +- ...nsettledDiffReportCreateOrUpdateDtoBase.cs | 17 +- .../SendUnsettledDiffReportDetailDto.cs | 38 +- .../SendUnsettledDiffReportDetailExportDto.cs | 22 +- ...SendUnsettledDiffReportDetailRequestDto.cs | 7 +- .../SendUnsettledDiffReportDto.cs | 9 +- .../SendUnsettledDiffReportRequestDto.cs | 6 +- ...dUnsettledDiffReportStatisticRequestDto.cs | 8 +- .../SendUnsettledDiffReportUpdateDto.cs | 4 +- .../Reports/SettleAccountReportDtoBase.cs | 13 +- .../Reports/SettleAccountReportTimeDtoBase.cs | 10 +- .../IStockFisDiffReportAppService.cs | 8 +- .../StockFisDiffReportCreateDto.cs | 13 +- ...StockFisDiffReportCreateOrUpdateDtoBase.cs | 18 +- .../StockFisDiffReportDetailDto.cs | 25 +- .../StockFisDiffReportDetailExportDto.cs | 23 +- .../StockFisDiffReportDetailRequestDto.cs | 8 +- .../StockFisDiffReportDto.cs | 10 +- .../StockFisDiffReportRequestDto.cs | 5 +- .../StockFisDiffReportUpdateDto.cs | 4 +- .../IStockSettledDiffReportAppService.cs | 9 +- .../StockSettledDiffReportCreateDto.cs | 13 +- ...kSettledDiffReportCreateOrUpdateDtoBase.cs | 18 +- .../StockSettledDiffReportDetailDto.cs | 22 +- .../StockSettledDiffReportDetailExportDto.cs | 21 +- .../StockSettledDiffReportDetailRequestDto.cs | 6 +- .../StockSettledDiffReportDto.cs | 10 +- .../StockSettledDiffReportRequestDto.cs | 5 +- .../StockSettledDiffReportUpdateDto.cs | 4 +- .../IStockUnsettledDiffReportAppService.cs | 8 +- .../StockUnsettledDiffReportCreateDto.cs | 13 +- ...nsettledDiffReportCreateOrUpdateDtoBase.cs | 18 +- .../StockUnsettledDiffReportDetailDto.cs | 31 +- ...StockUnsettledDiffReportDetailExportDto.cs | 24 +- ...tockUnsettledDiffReportDetailRequestDto.cs | 10 +- .../StockUnsettledDiffReportDto.cs | 10 +- .../StockUnsettledDiffReportRequestDto.cs | 5 +- ...kUnsettledDiffReportStatisticRequestDto.cs | 8 +- .../StockUnsettledDiffReportUpdateDto.cs | 4 +- ...SettleAccountApplicationContractsModule.cs | 6 +- .../Bases/ADJ_SERVICE.cs | 538 +++++---- .../Bases/BASE_SERVICE.cs | 17 +- .../Bases/BA_SERVICE.cs | 251 ++-- .../Bases/CAN_SA_SERVICE.cs | 96 +- .../Bases/CurdBaseAppService.cs | 36 +- .../Bases/NOT_SA_SERVICE.cs | 49 +- .../Bases/PD_SERVICE.cs | 77 +- .../Constant/ApplicationConsts.cs | 25 +- .../Constant/CommonMethod.cs | 9 +- .../Entities/BQ/BBAC_BA_SERVICE.cs | 318 +++-- .../Entities/BQ/BBAC_CAN_SA_SERVICE.cs | 73 +- .../Entities/BQ/BBAC_NOT_SA_SERVICE.cs | 24 +- .../Entities/BQ/BBAC_PD_SERVICE.cs | 37 +- .../Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs | 107 +- .../Entities/BQ/BBAC_SA_SERVICE.cs | 927 +++++++-------- .../Entities/BQ/BBAC_SE_DETAIL_Service.cs | 18 +- .../Entities/BQ/BBAC_SE_EDI_Service.cs | 105 +- .../Entities/BQ/CompareService.cs | 169 +-- .../Entities/BQ/HBPO_BA_SERVICE.cs | 100 +- .../Entities/BQ/HBPO_CAN_SA_SERVICE.cs | 45 +- .../Entities/BQ/HBPO_NOT_SA_SERVICE.cs | 20 +- .../Entities/BQ/HBPO_PD_SERVICE.cs | 28 +- .../Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs | 107 +- .../Entities/BQ/HBPO_SA_SERVICE.cs | 837 ++++++------- .../Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs | 18 +- .../Entities/BQ/HBPO_SE_EDI_SERVICE.cs | 18 +- .../Entities/BQ/INVOICE_SERVICE.cs | 130 +- .../Entities/BQ/JobHostdService.cs | 475 ++++---- .../Entities/BQ/JobItemAppService.cs | 169 +-- .../Entities/BQ/PUB_BA_SERVICE.cs | 251 ++-- .../Entities/BQ/PUB_CAN_SA_SERVICE.cs | 39 +- .../Entities/BQ/PUB_NOT_SA_SERVICE.cs | 22 +- .../Entities/BQ/PUB_PD_SERVICE.cs | 27 +- .../Entities/BQ/PUB_SA_DETAIL_SERVICE.cs | 151 +-- .../Entities/BQ/PUB_SA_SERVICE.cs | 1034 ++++++++-------- .../Entities/BQ/PUB_SE_DETAIL_SERVICE.cs | 17 +- .../Entities/BQ/PURCHASE_PRICE_SERVICE.cs | 173 ++- .../Entities/BQ/Syncs/BeiSeSyncAppService.cs | 41 +- .../Entities/BQ/Syncs/HandSeSyncAppService.cs | 67 +- .../BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 199 ++-- .../BQ/Syncs/JisBBACSeSyncAppService.cs | 51 +- .../BQ/Syncs/JisBBACSeSyncBaseAppService.cs | 313 ++--- .../BQ/Syncs/JisHBPOSeEdiCompareAppService.cs | 187 +-- .../BQ/Syncs/JisHBPOSeSyncAppService.cs | 49 +- .../BQ/Syncs/JisHBPOSeSyncBaseAppService.cs | 315 ++--- .../Entities/BQ/Syncs/JitSeSyncAppService.cs | 225 ++-- .../BQ/Syncs/MaiDanBBACSeSyncAppService.cs | 51 +- .../BQ/Syncs/MaiDanHBPOSeSyncAppService.cs | 49 +- .../BQ/Syncs/PendingDeductionService.cs | 528 ++++----- .../Entities/BQ/Syncs/SeSyncConfig.cs | 41 +- .../Entities/BQ/Syncs/SeSyncExtendManager.cs | 323 ++--- .../BQ/Syncs/YinDuSeSyncAppService.cs | 41 +- .../BQ/Syncs/ZhiGongBBACSeSyncAppService.cs | 41 +- .../BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs | 41 +- .../BQ/TB_RePartsRelationship_SERVICE.cs | 203 ++-- .../Entities/BQ/VmiAppService.cs | 1039 ++++++++-------- .../Entities/BQ/VmiAsyncBalanceService.cs | 425 +++---- .../Entities/BQ/VmiAsyncMessageService.cs | 65 +- .../Entities/Boms/BomAppService.cs | 31 +- .../CodeSettingAppService.cs | 75 +- .../Controls/CentralizedControlAppService.cs | 766 ++++++------ .../ErpShipping/ErpShippingAppService.cs | 111 +- .../Entities/Errors/ErrorDto.cs | 6 - .../Entities/Factories/FactoryAppService.cs | 146 +-- .../Inventories/InventoryDetailAppService.cs | 118 +- .../Entities/Invoices/InvoiceAppService.cs | 105 +- .../ItemInvoicePriceAppService.cs | 152 +-- .../Entities/Jobs/UpdateLoadFileJob.cs | 24 +- .../MaterialRelationshipAppService.cs | 850 +++++++------ .../MaterialRelationshipTHAppService.cs | 82 +- .../Entities/Materials/MaterialAppService.cs | 53 +- .../Entities/Prebatch/PrebatchAppService.cs | 145 +-- .../Entities/Prices/PriceListAppService.cs | 423 ++++--- .../Entities/Prices/PriceListAppServiceBJ.cs | 354 +++--- .../Entities/SecMatch/SecMatchAppService.cs | 126 +- .../SettlementPartAppService.cs | 114 +- .../Entities/TaskJobs/JobAppService.cs | 124 +- .../UnHQSettleAppService.cs | 84 +- .../Handler/FisRecHandler.cs | 13 +- .../ImportExcelCommon/AppConfigurations.cs | 6 +- .../ImportExcelCommon/ConfigDirHelper.cs | 11 +- .../ImportExcelCommon/EPHelper.cs | 12 +- .../ExcelImportAppService.cs | 11 +- .../ImportExcelCommon/ExportImporter.cs | 92 +- .../ImportExcelCommon/FileAppService.cs | 11 +- .../ImportExcelCommon/FileSystem.cs | 10 +- .../SecBTSummaryFileAppService.cs | 10 +- .../SecSummaryFileAppService.cs | 11 +- .../ZipBTExportAppService.cs | 10 +- .../ImportExcelCommon/ZipExportAppService.cs | 10 +- .../Jobs/TaskJobService.cs | 99 +- .../ReportServices/ReportMakeService.cs | 98 +- .../SettleAccountAppService.cs | 2 +- ...ttleAccountApplicationAutoMapperProfile.cs | 140 --- .../SettleAccountApplicationBase.cs | 31 +- .../SettleAccountApplicationModule.cs | 4 +- .../influxdb/InfluxHelper.cs | 71 +- .../influxdb/InfluxQueryResult.cs | 43 +- .../ExportExtentsion.cs | 8 +- .../ImportProjectAttribute.cs | 12 +- .../Localization/SettleAccountResource.cs | 4 +- .../SettleAccount.Domain.Shared/ModuleName.cs | 19 - .../SettleAccountDomainSharedModule.cs | 4 +- .../SettleAccountErrorCodes.cs | 2 +- .../SettleAccount.Domain.Shared/TaskState.cs | 10 +- .../SettleAccount.Domain.Shared/TaskType.cs | 6 - .../BaseDomainServices/BaseDomainService.cs | 68 +- .../SettleAccount.Domain/Bases/EntityBase.cs | 52 - .../Bases/OrderNumberGenerator.cs | 8 +- .../Bases/SettleAccountDocumentRootBase.cs | 14 +- .../SettleAccountDocumentRootDetailBase.cs | 13 +- .../SettleAccountDocumentTimeRootBase.cs | 15 +- .../Entities/BQ/BBAC_CAN_SA.cs | 304 +++-- .../Entities/BQ/BBAC_NOT_SA_DETAIL.cs | 213 ++-- .../Entities/BQ/BBAC_PD.cs | 72 +- .../Entities/BQ/BBAC_PD_DETAIL.cs | 116 +- .../Entities/BQ/BBAC_SA.cs | 273 +++-- .../Entities/BQ/BBAC_SEC_DETAIL.cs | 307 +++-- .../Entities/BQ/BBAC_SE_DETAIL.cs | 52 +- .../Entities/BQ/BBAC_SE_EDI.cs | 179 ++- .../Entities/BQ/BBAC_SE_REPORT.cs | 94 +- .../Entities/BQ/BBAC_SE_SA_REPORT.cs | 146 +-- .../Entities/BQ/HBPO_ADJ_DETAIL.cs | 245 ++-- .../Entities/BQ/HBPO_CAN_SA.cs | 273 +++-- .../Entities/BQ/HBPO_NOT_SA_DETAIL.cs | 220 ++-- .../Entities/BQ/HBPO_PD.cs | 72 +- .../Entities/BQ/HBPO_PD_DETAIL.cs | 114 +- .../Entities/BQ/HBPO_SA.cs | 298 ++--- .../Entities/BQ/HBPO_SEC_DETAIL.cs | 34 +- .../Entities/BQ/HBPO_SE_DETAIL.cs | 50 +- .../Entities/BQ/HBPO_SE_EDI.cs | 75 +- .../Entities/BQ/HBPO_SE_REPORT.cs | 94 +- .../Entities/BQ/HBPO_SE_SA_REPORT.cs | 198 ++-- .../Entities/BQ/INVOICE_GRP.cs | 175 ++- .../Entities/BQ/INVOICE_MAP_GROUP.cs | 79 +- .../Entities/BQ/INVOICE_NOT_SETTLE.cs | 95 +- .../Entities/BQ/INVOICE_WAIT_DETAIL.cs | 139 ++- .../Entities/BQ/JIT_SE_SA_REPORT.cs | 203 ++-- .../Entities/BQ/M_PD_DETAIL.cs | 100 +- .../Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs | 186 ++- .../Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs | 22 +- .../Entities/BQ/Managers/BBAC_PD_MNG.cs | 85 +- .../Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs | 73 +- .../Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs | 28 +- .../Entities/BQ/Managers/INV_MNG.cs | 499 ++++---- .../Entities/BQ/Managers/INV_MNG_EXT.cs | 225 ++-- .../Managers/MaterialRelationshipManager.cs | 56 +- .../Entities/BQ/Managers/PD_MNG.cs | 59 +- .../Entities/BQ/Managers/PUB_CAN_SA_MNG.cs | 96 +- .../Entities/BQ/Managers/PUB_NOT_SA_MNG.cs | 47 +- .../Entities/BQ/PUB_ADJ_DETAIL.cs | 162 +-- .../Entities/BQ/PUB_CAN_SA.cs | 281 ++--- .../Entities/BQ/PUB_NOT_SA_DETAIL.cs | 167 +-- .../Entities/BQ/PUB_PD.cs | 72 +- .../Entities/BQ/PUB_PD_DETAIL.cs | 160 ++- .../Entities/BQ/PUB_SA.cs | 294 ++--- .../Entities/BQ/PUB_SEC_DETAIL.cs | 73 +- .../Entities/BQ/PUB_SE_DETAIL.cs | 358 +++--- .../Entities/BQ/PURCHASE_PRICE.cs | 47 +- .../Entities/BQ/Syncs/SyncPositionFlag.cs | 37 +- .../Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs | 163 +-- .../Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs | 361 +++--- .../BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs | 137 +-- .../Entities/BQ/TB_RePartsRelationship.cs | 79 +- .../Entities/BQ/TED_SA_INV.cs | 266 ++--- .../Entities/BQ/Temp/TempClass.cs | 441 ++++--- .../Entities/BQ/Vmi/IJobService.cs | 9 +- .../Entities/BQ/Vmi/JobItem.cs | 41 +- .../Entities/BQ/Vmi/JobLog.cs | 21 +- .../Entities/BQ/Vmi/VmiBalance.cs | 31 +- .../Entities/BQ/Vmi/VmiBalanceBase.cs | 105 +- .../Entities/BQ/Vmi/VmiLog.cs | 83 +- .../Entities/BQ/Vmi/VmiMessage.cs | 27 +- .../Entities/BQ/Vmi/VmiReplenished.cs | 51 +- .../Entities/BQ/Vmi/VmiSnapshot.cs | 23 +- .../Entities/BQ/Vmi/VmiType.cs | 97 +- .../SettleAccount.Domain/Entities/Boms/Bom.cs | 27 +- .../Entities/Boms/BomVersion.cs | 25 +- .../Entities/CodeSettingTables/CodeSetting.cs | 12 +- .../Entities/Controls/CentralizedControl.cs | 15 +- .../Entities/Customers/Customer.cs | 33 +- .../Entities/Customers/CustomerBom.cs | 6 +- .../Entities/ERPDto/ErpAssemblyDto.cs | 11 +- .../Entities/ERPDto/PriceQtyDiffDto.cs | 84 +- .../Entities/ERPShipping/ERPShippingDetail.cs | 8 +- .../ERPShipping/ERPShippingVersion.cs | 14 +- .../Entities/ErrorBillNum/ErrorBillNum.cs | 11 +- .../Entities/Eto/AssemblySyncEto.cs | 2 - .../Entities/Eto/AssemblySyncOperationType.cs | 4 - .../Eto/CreateUpdateAssemblyCfgErpDto.cs | 6 +- .../Eto/CreateUpdateAssemblyCfgPartDto.cs | 3 - .../Entities/Eto/FISVersionEto.cs | 18 +- .../Entities/Eto/FIS_TH.cs | 27 +- .../Entities/FISes/FIS.cs | 23 +- .../Entities/FISes/FISExtend.cs | 19 +- .../Entities/FISes/FISVersion.cs | 23 +- .../Entities/FISes/FIS_TH.cs | 43 +- .../Entities/FISes/FisManager.cs | 21 +- .../Entities/FISes/IFisManager.cs | 6 +- .../Entities/Factories/Factory.cs | 15 +- .../Entities/ImportMap/ImportColumnMap.cs | 19 +- .../Entities/Inventories/InventoryDetail.cs | 24 +- .../Inventories/InventoryDetailVersion.cs | 18 +- .../Entities/Invoices/Invoice.cs | 13 +- .../Entities/Invoices/InvoiceVersion.cs | 9 +- .../ItemInvoicePrices/ItemInvoicePrice.cs | 14 +- .../ItemInvoicePriceVersion.cs | 9 +- .../MaterialRelationship.cs | 81 +- .../MaterialRelationshipDetail.cs | 17 +- .../MaterialRelationshipManager.cs | 58 +- .../MaterialRelationshipVersion.cs | 15 +- .../Entities/Materials/Material.cs | 24 +- .../Entities/Prebatches/Prebatch.cs | 16 +- .../Entities/Prices/PriceList.cs | 18 - .../Entities/Prices/PriceListVersion.cs | 11 +- .../Entities/SecMatch/SecMatchBase.cs | 18 +- .../Entities/SecMatch/SecMatchSummary.cs | 6 - .../SettleAccountDomain/ShippingData1.cs | 16 +- .../Entities/SettleAccountEntityBase.cs | 4 - .../Entities/SettleAccounts/SettleAccount.cs | 16 +- .../SettleAccounts/SettleAccountManager.cs | 16 +- .../SettleAccounts/SettleAccountVersion.cs | 21 +- .../SettlementParts/SettlementPart.cs | 19 +- .../SettlementParts/SettlementPartVersion.cs | 13 +- .../Entities/Settlements/Settlement.cs | 19 +- .../CustomerStorageLocation.cs | 35 +- .../SupplierItemSetUps/SupplierItemSetUp.cs | 20 +- .../Entities/Suppliers/Supplier.cs | 23 +- .../Entities/Suppliers/SupplierApply.cs | 36 +- .../Entities/TaskJobs/Job.cs | 19 +- .../Entities/TaskJobs/TEA_TASK_SUB.cs | 40 +- .../Entities/TaskJobs/TaskJob.cs | 44 +- .../Entities/TaskJobs/TaskJobManager.cs | 85 +- .../UnHQSettleAccounts/UnHQSettleAccount.cs | 13 +- .../UnHQSettleAccountVersion.cs | 8 +- .../Entities/UnSettle/UnSettleDetailReport.cs | 28 +- .../Entities/WmsDetailReport.cs | 36 +- .../src/SettleAccount.Domain/EnumBillState.cs | 39 +- .../SettleAccount.Domain/EnumBusinessType.cs | 101 +- .../ISettleAccountBranchEfCoreRepository.cs | 41 +- .../ImportExcelCommon/MyFileContainer.cs | 7 +- .../SecBTSummaryFileConrainer.cs | 5 - .../SecSummaryFileConrainer.cs | 5 - .../BTNotConsignReports/BTNotConsignReport.cs | 26 +- .../BTNotConsignReportDetail.cs | 10 +- .../BTNotConsignSumReport.cs | 9 +- .../BTSeqKBDiffReports/BTSeqKBDiffReport.cs | 23 +- .../BTSeqKBDiffReportDetail.cs | 13 +- .../BTStockUnsettledDiffReport.cs | 28 +- .../BTStockUnsettledDiffReportDetail.cs | 21 +- .../Reports/CommonManagers/CommonManager.cs | 26 +- .../Reports/CommonManagers/ICommonManager.cs | 5 +- .../EstimatedStockDiffReport.cs | 28 +- .../EstimatedStockDiffReportDetail.cs | 30 +- .../EstimatedStockDiffReportManager.cs | 16 +- .../IEstimatedStockDiffReportManager.cs | 7 +- .../HQSPNotConsignReport.cs | 26 +- .../HQSPNotConsignReportDetail.cs | 10 +- .../HQSPNotConsignSumReport.cs | 9 +- .../HqNotConsignReports/HQNotConsignReport.cs | 26 +- .../HQNotConsignReportDetail.cs | 10 +- .../HQNotConsignSumReport.cs | 10 +- .../InvoicePriceListDiff.cs | 52 +- .../InvoicePriceListDiffVersion.cs | 6 - .../InvoiceSettledDiffs/InvoiceSettledDiff.cs | 29 +- .../InvoiceSettledDiffVersion.cs | 13 +- .../Reports/ReportDetailBase.cs | 13 +- .../Reports/SaSeCompareDetailReport.cs | 215 ++-- .../Reports/SaSeCompareDetailReportBeiJian.cs | 23 +- .../SaSeCompareDetailReportMaiDanJianBBAC.cs | 23 +- .../SaSeCompareDetailReportMaiDanJianHBPO.cs | 23 +- .../SaSeCompareDetailReportYinDuJian.cs | 23 +- .../SaSeCompareDetailReportZhiGongJianBBAC.cs | 23 +- .../SaSeCompareDetailReportZhiGongJianHBPO.cs | 23 +- .../Reports/SaSeCompareDiff.cs | 289 ++--- .../Reports/SaSeCompareSumReport.cs | 69 +- .../Reports/SaSeEdiCompareDetailReport.cs | 323 ++--- .../SaSeEdiCompareDetailReportJisBBAC.cs | 13 +- .../SaSeEdiCompareDetailReportJisHBPO.cs | 13 +- .../Reports/SaSeEdiCompareDiff.cs | 301 ++--- .../Reports/SaSeEdiCompareSumReport.cs | 93 +- .../Reports/SeEidCompareReport.cs | 303 ++--- .../Reports/SeEidCompareReportJisBBAC.cs | 15 +- .../Reports/SeEidCompareReportJisHBPO.cs | 15 +- .../SecondaryActuralAdjustmentReport.cs | 32 +- .../SecondaryActuralAdjustmentReportDetail.cs | 32 +- .../ISecondaryActuralDiffReportManager.cs | 10 +- .../SecondaryActuralDiffReport.cs | 32 +- .../SecondaryActuralDiffReportDetail.cs | 37 +- .../SecondaryActuralDiffReportManager.cs | 13 +- .../DiffUnsetttleReport.cs | 8 +- .../SendUnsettledDiffReport.cs | 26 +- .../SendUnsettledDiffReportDetail.cs | 35 +- .../StockSettledDiffReport.cs | 30 +- .../StockSettledDiffReportDetail.cs | 14 +- .../StockSettledDiffReport.cs | 26 +- .../StockSettledDiffReportDetail.cs | 16 +- .../StockUnsettledDiffReport.cs | 26 +- .../StockUnsettledDiffReportDetail.cs | 21 +- .../SettleAccount.Domain/Settings/Helper.cs | 95 +- .../SettleAccountSettingDefinitionProvider.cs | 4 +- .../Settings/SettleAccountSettings.cs | 4 +- .../SettleAccountDbProperties.cs | 4 +- .../SettleAccountDomainModule.cs | 8 +- .../ExChangeCenterDbContext.cs | 32 +- .../ISettleAccountDbContext.cs | 4 +- ...AccountDbContextModelCreatingExtensions.cs | 198 ---- .../SettleAccountEntityFrameworkCoreModule.cs | 15 +- ...AccountModelBuilderConfigurationOptions.cs | 4 +- .../UnInterfaceDapperRepository.cs | 45 +- .../UnInterfaceDbContext.cs | 16 - .../EntityFrameworkCore/WMSBJBMPTDbContext.cs | 57 +- .../Migrations/20230710050546_init.cs | 2 +- .../Migrations/20230710062137_20230710-1.cs | 2 +- .../Migrations/20230711014038_20230711-1.cs | 2 +- .../Migrations/20230711073528_20230711-2.cs | 2 +- .../Migrations/20230712032712_20230712-1.cs | 2 +- .../Migrations/20230713031306_20230713-1.cs | 2 +- .../Migrations/20230714030100_20230714-1.cs | 2 +- .../Migrations/20230714033202_20230714-2.cs | 2 +- .../Migrations/20230714063941_20230714-3.cs | 2 +- .../Migrations/20230718010724_20230718-1.cs | 2 +- .../Migrations/20230718011250_20230718-2.cs | 2 +- .../Migrations/20230719004135_20230719-1.cs | 2 +- .../Migrations/20230719022720_20230719-2.cs | 2 +- .../Migrations/20230719032116_vmi.cs | 2 +- .../Migrations/20230719053130_20230719-3.cs | 2 +- .../Migrations/20230719090654_20230719-4.cs | 2 +- .../Migrations/20230720012742_vmi2.cs | 2 +- .../Migrations/20230721063549_20230721.cs | 2 +- .../Migrations/20230722013448_20230722.cs | 2 +- .../Migrations/20230722015432_202307220002.cs | 2 +- .../Migrations/20230724052214_20230724-1.cs | 2 +- .../Migrations/20230724063308_vmi3.cs | 2 +- .../Migrations/20230726013523_20230726-1.cs | 2 +- .../Migrations/20230726021913_202307260001.cs | 2 +- .../Migrations/20230726064841_20230726-2.cs | 2 +- .../Migrations/20230726064930_20230726-3.cs | 2 +- .../Migrations/20230726065932_vmi4.cs | 2 +- .../Migrations/20230727005325_vmi5.cs | 2 +- .../Migrations/20230727011426_202307270001.cs | 2 +- .../Migrations/20230727024321_20230727-1.cs | 2 +- .../Migrations/20230727085151_202307270004.cs | 2 +- .../Migrations/20230728013132_vmi6.cs | 2 +- .../Migrations/20230731014604_20230731-1.cs | 2 +- .../Migrations/20230731031816_20230731-2.cs | 2 +- .../Migrations/20230801054818_20230801-1.cs | 2 +- .../Migrations/20230803013930_vmi7.cs | 2 +- .../Migrations/20230803033051_20230803-1.cs | 2 +- .../Migrations/20230807024652_vmi8.cs | 2 +- .../Migrations/20230807054442_vmi9.cs | 2 +- .../Migrations/20230807063408_vmi10.cs | 2 +- .../Migrations/20230808023302_202308080001.cs | 4 +- .../Migrations/20230808055821_20230808-1.cs | 2 +- .../Migrations/20230808062331_20230808-2.cs | 2 +- .../Migrations/20230809035500_vmi11.cs | 2 +- .../Migrations/20230809054836_20230809-1.cs | 2 +- .../Migrations/20230809074216_20230809-2.cs | 2 +- .../Migrations/20230810003703_202308100001.cs | 2 +- .../Migrations/20230810012032_20230810-1.cs | 2 +- .../Migrations/20230810025021_20230810-2.cs | 2 +- .../Migrations/20230810081159_20230810-3.cs | 2 +- .../Migrations/20230811013305_202308110001.cs | 2 +- .../Migrations/20230814052555_20230814-1.cs | 2 +- .../Migrations/20230814073646_20230814-2.cs | 2 +- .../Migrations/20230815013824_20230815-1.cs | 2 +- .../Migrations/20230815023057_20230815-2.cs | 2 +- .../Migrations/20230815054853_20230815-3.cs | 2 +- .../Migrations/20230817004419_20230817-1.cs | 2 +- .../Migrations/20230817033153_20230817-2.cs | 2 +- .../Migrations/20230817035945_20230817-3.cs | 2 +- .../Migrations/20230817051027_20230817-4.cs | 2 +- .../Migrations/20230817052812_202308170001.cs | 2 +- .../Migrations/20230818070358_20230818-1.cs | 2 +- .../Migrations/20230818073659_202308180001.cs | 2 +- .../Migrations/20230819034920_202308190002.cs | 2 +- .../Migrations/20230822072327_vmi12.cs | 2 +- .../Migrations/20230823062342_20230823-1.cs | 2 +- .../Migrations/20230825011303_vmi14.cs | 2 +- .../Migrations/20230825061422_vmi15.cs | 2 +- .../Migrations/20230825063729_vmi16.cs | 2 +- .../Migrations/20230825071603_20230825-1.cs | 2 +- .../Migrations/20230826031830_202308260001.cs | 2 +- .../Migrations/20230826032802_vmi17.cs | 2 +- .../Migrations/20230828060854_20230828.cs | 2 +- .../Migrations/20230828074927_vmi18.cs | 2 +- .../Migrations/20230828092102_20230828-1.cs | 2 +- .../Migrations/20230829061958_20230829-1.cs | 2 +- .../Migrations/20230829062103_202308290001.cs | 2 +- .../Migrations/20230831082843_20230831-1.cs | 2 +- .../Migrations/20230906031332_202309060001.cs | 2 +- .../Migrations/20230907075720_20230907-1.cs | 2 +- .../Migrations/20230908031607_20230908-1.cs | 2 +- .../Migrations/20230908053049_20230908-2.cs | 2 +- .../Migrations/20230909013408_202309090001.cs | 2 +- .../Migrations/20230913024309_20230913-1.cs | 2 +- .../Migrations/20230914021528_20230914-1.cs | 2 +- .../Migrations/20230915020001_20230915-1.cs | 2 +- .../Migrations/20230915035754_202309150001.cs | 2 +- .../Migrations/20230918060007_20230918-1.cs | 2 +- ...SettleAccountDiffReportDapperRepository.cs | 24 +- .../SettleAccountBQEfCoreRepository.cs | 46 +- .../SettleAccountBranchEfCoreRepository.cs | 37 +- .../SettleAccountEfCoreQueryableExtensions.cs | 6 +- .../SettleAccountEfCoreRepository.cs | 33 +- .../Code/CodeSettingRepository.cs | 19 +- .../Invoices/InvoiceRepository.cs | 16 +- .../Invoices/InvoiceVersionRepository.cs | 12 +- .../MaterialRelationshipDetailRepository.cs | 39 +- .../MaterialRelationshipVersionRepository.cs | 17 +- .../PendingDeductionDapperRepository.cs | 53 +- .../Report/ErpPartDapperRepository.cs | 24 +- .../Report/ErpSumOutputDapperRepository.cs | 53 +- .../Report/FisUpdateStateDapperRepository.cs | 24 +- .../HQFSettledDetailDapperRepository.cs | 23 +- .../Report/HQFShippingDapperRepository.cs | 8 +- .../HQFactorySettledDetailDapperRepository.cs | 91 +- .../HQHSettledDetailDapperRepository.cs | 112 +- .../Report/HQHShippingDapperRepository.cs | 10 +- .../HQMSettledDetailDapperRepository.cs | 17 +- .../Report/HQMShippingDapperRepository.cs | 8 +- .../InvoicePriceListDiffDapperRepository.cs | 14 +- ...nvoiceSettledDetailDiffDapperRepository.cs | 27 +- .../InvoiceSettledDiffDapperRepository.cs | 20 +- .../Report/InvoiceSettledDiffRepository.cs | 12 +- .../InvoiceSettledDiffVersionRepository.cs | 22 +- .../Report/KanbanUnSettledDapperRepository.cs | 79 +- .../PriceQtyDiffDapperReportRepository.cs | 16 +- .../Report/PubSaSeCompareDapperRepository.cs | 244 ++-- .../SecMatchBaseDapperReportRepository.cs | 41 +- .../SecMatchSummaryDapperReportRepository.cs | 91 +- .../Report/SettleDoorPanelDapperRepository.cs | 14 +- .../SettleFisDiffDetailDapperRepository.cs | 63 +- .../SettleKBWithCodeDapperReportRepository.cs | 64 +- ...SettleSparePart90DapperReportRepository.cs | 23 +- .../SettleSparePartDapperReportRepository.cs | 215 +--- ...leSparePartExtendDapperReportRepository.cs | 40 +- .../Report/SettledMaterialReportRepository.cs | 23 +- ...ettledPartAndErpPartPriceDiffRepository.cs | 6 - .../SharePartUnSettledDapperRepository.cs | 38 +- ...nvoiceSettledDetailDiffDapperRepository.cs | 20 +- .../Report/UnSettleDiffDapperRepository.cs | 59 +- .../Report/UnSettledDapperReportRepository.cs | 18 +- .../Report/UnSettledDetailDapperRepository.cs | 55 +- .../Report/WmsDapperRepository.cs | 16 - .../Report/WmsOutputSumDapperRepository.cs | 111 +- .../fisUnSettledDapperReportRepository.cs | 85 +- .../SettleAccounts/SettleAccountRepository.cs | 21 +- .../SettleAccountVersionRepository.cs | 20 +- .../SettlementPartRepository.cs | 36 +- .../SettlementPartVersionRepository.cs | 21 +- .../Tasks/TaskDapperRepository.cs | 37 +- .../Tasks/TaskJobRepository.cs | 17 +- .../WmsJitOutputDapperRepository.cs | 19 +- .../SettleAccountNormalEfCoreRepository.cs | 16 +- .../Repository/UnInterfaceEfCoreRepository.cs | 52 +- .../WmsOutputInterfaceDapperRepoisitory.cs | 6 - .../SettleAccountDbContextFactory.cs | 19 +- .../SettleAccountHttpApiClientModule.cs | 2 +- .../BlobFileController.cs | 28 +- .../SettleAccountController.cs | 2 +- .../SettleAccountHttpApiModule.cs | 4 +- .../ZipBTExportController.cs | 10 +- .../ZipExportController.cs | 10 +- .../BackgroundJob/ExportJob.cs | 16 +- .../BackgroundJob/ImportJob.cs | 6 - .../BackgroundJob/NotifyJob.cs | 15 +- .../Dispatcher/JobDispatcher.cs | 22 +- .../SettleAccount.Job/Domain/OutputError.cs | 17 +- .../EventArgs/ExportTaskArgs.cs | 14 +- .../EventArgs/ImportTaskArgs.cs | 11 +- .../EventArgs/NotifyTaskArgs.cs | 11 +- .../SettleAccount.Job/EventArgs/TaskArgs.cs | 28 +- .../Interfaces/IExportJob.cs | 9 +- .../Interfaces/IImportJob.cs | 9 +- .../Interfaces/INotifyJob.cs | 11 +- .../Base/SecRelationShipImportService.cs | 606 +++------- .../Services/Fis/FisImportService.cs | 13 - .../Services/InputService.cs | 19 +- .../Services/Invoices/InvoiceImportService.cs | 32 +- .../Services/OutputService.cs | 44 +- .../SettleAccount.Job/Services/PD_SERVICE.cs | 33 +- .../FISUnSettleAccountDiffExportService.cs | 5 +- .../Services/Report/FisOutputService.cs | 10 +- .../Services/Report/FisUpdateExportService.cs | 8 +- .../HQFSettledDetailDiffExportService.cs | 25 +- ...SharePartSettledDetailDiffExportService.cs | 32 +- .../Report/HQFShippingExportService.cs | 5 +- ...FactoryUnSettledDetailDiffExportService.cs | 23 +- .../HQHSettledDetailDiffExportService.cs | 20 +- ...SharePartSettledDetailDiffExportService.cs | 20 +- .../Report/HQHShippingExportService.cs | 5 +- .../HQHUnSettledDetailDiffExportService.cs | 15 +- .../HQMSettledDetailDiffExportService.cs | 17 +- ...SharePartSettledDetailDiffExportService.cs | 15 +- .../Report/HQMShippingExportService.cs | 5 +- .../InvoicePriceListDiffExportService.cs | 5 +- .../InvoiceSettledDetailDiffExportService.cs | 58 +- .../Report/InvoiceSettledDiffExportService.cs | 60 +- .../JisBBACSeEdiCompareExportService.cs | 2 - .../JisHBPOSeEdiCompareExportService.cs | 4 +- .../Services/Report/KanBanUnSettledExport.cs | 21 +- .../Report/PriceQtyDifferenceExportService.cs | 7 +- .../Report/SecMatchBaseExportService.cs | 12 +- .../Report/SettleDoorPanelExportService.cs | 33 +- .../Report/SettleFisDiffExportService.cs | 158 +-- .../Report/SettleKBWithCodeExportService.cs | 24 +- .../SettleKBWithOutCodeExportService.cs | 25 +- .../Report/SettleSparePart90ExportService.cs | 18 +- .../Report/SettleSparePartExportService.cs | 26 +- .../Report/SettleUnSparePartExportService.cs | 19 +- ...ledPartAndErpPartPriceDiffExportService.cs | 15 +- .../Report/SharePartUnSettledExport.cs | 26 +- .../Services/Report/SyncFisService.cs | 58 +- ...UnInvoiceSettledDetailDiffExportService.cs | 122 +- .../Report/UnSettleDiffExportService.cs | 188 ++- .../Services/Report/UnSettledExportService.cs | 29 +- .../Services/Report/UnSettledSumService.cs | 97 +- .../Services/Report/UnsettledDetailReport.cs | 46 +- .../Report/WmsOutputSumExportService.cs | 22 +- .../Services/Report/fisUnsettledDiffReport.cs | 6 +- .../SettleAccountImportService.cs | 43 +- .../UnSettleAccountImportService.cs | 21 +- .../SettleAccountJobAutoMapperProfile.cs | 2 +- .../SettleAccountJobModule.cs | 44 +- .../Snowflakes/AbpSnowflakeGeneratorModule.cs | 5 +- .../AbpSnowflakeIdGeneratorOptions.cs | 5 +- .../Abp/Snowflakes/ISnowflakeIdGenerator.cs | 4 +- .../Abp/Snowflakes/SnowflakeIdGenerator.cs | 12 +- .../IBranchBaseDataAppService.cs | 6 +- .../ApplicationBase/IHasDetailAppService.cs | 4 +- .../IHasDetailEntityAppService.cs | 4 +- .../ApplicationBase/IImportAppService.cs | 4 +- .../ApplicationBase/IInventoryAppService.cs | 9 +- .../INormalBaseDataAppService.cs | 6 +- .../CacheBase/CacheServiceBase.cs | 9 +- .../CacheBase/CacheStrategyConst.cs | 4 +- .../CacheBase/CachingExtensions.cs | 25 +- .../Win.Sfs.Shared/Constant/CommonConsts.cs | 6 +- .../Constant/MultiTenancyConsts.cs | 4 +- .../Shared/Win.Sfs.Shared/CurrentBranch/A.cs | 4 +- .../CurrentBranch/BranchManager.cs | 9 +- .../CurrentBranch/IBranchManager.cs | 6 +- .../DomainBase/AggregateRootBase.cs | 6 +- .../DomainBase/AuditedAggregateRootBase.cs | 7 +- .../DomainBase/BranchAggregateRootBase.cs | 6 +- .../DomainBase/BranchEntityBase.cs | 4 +- .../DomainBase/CreationAggregateRootBase.cs | 4 +- .../DomainBase/CreationAuditedDocumentBase.cs | 4 +- .../CreationAuditedDocumentDetailBase.cs | 5 +- .../DomainBase/CreationAuditedEntityBase.cs | 3 +- .../Win.Sfs.Shared/DomainBase/EntityBase.cs | 4 +- .../FullAuditedAggregateRootBase.cs | 7 +- .../DomainBase/FullAuditedDocumentBase.cs | 8 +- .../FullAuditedDocumentDetailBase.cs | 11 +- .../DomainBase/FullAuditedEntityBase.cs | 5 +- .../DomainBase/IBaseDataDistributedCache.cs | 5 +- .../DomainBase/IDocumentNumber.cs | 4 +- .../Win.Sfs.Shared/DomainBase/IHasDetails.cs | 3 +- .../Shared/Win.Sfs.Shared/DomainBase/IItem.cs | 4 +- .../DomainBase/ISerialNumber.cs | 4 +- .../DomainBase/IUpstreamDocument.cs | 5 +- .../ValueObjectBase/CurrencyPrice.cs | 7 +- .../DomainBase/ValueObjectBase/Employee.cs | 6 +- .../ValueObjectBase/InventoryInfo.cs | 11 +- .../DomainBase/ValueObjectBase/Location.cs | 11 +- .../DomainBase/ValueObjectBase/Lots.cs | 11 +- .../DomainBase/ValueObjectBase/StockMove.cs | 6 - .../DomainBase/ValueObjectBase/TaskQty.cs | 17 +- .../ValueObjectBase/TransferInfo.cs | 7 +- .../DomainBase/ValueObjectBase/UnitQty.cs | 8 +- .../DomainBase/ValueObjectBase/UomBase.cs | 11 +- .../ValueObjectBase/UpstreamDocument.cs | 13 +- .../DtoBase/AuditedEntityDtoBase.cs | 5 +- .../DtoBase/BranchRequestDtoBase.cs | 8 +- .../DtoBase/CreateOrUpdateEntityDtoBase.cs | 5 +- .../Win.Sfs.Shared/DtoBase/EntityDtoBase.cs | 5 +- .../Win.Sfs.Shared/DtoBase/ExportDtoBase.cs | 4 +- .../Win.Sfs.Shared/DtoBase/ImportDtoBase.cs | 4 +- .../DtoBase/InventoryAuditedEntityDtoBase.cs | 16 +- .../Win.Sfs.Shared/DtoBase/ListDtoBase.cs | 4 +- .../Win.Sfs.Shared/DtoBase/RequestDtoBase.cs | 5 +- .../SettleAccount/StatisticRequestDtoBase.cs | 11 +- .../Win.Sfs.Shared/Enums/EnumAreaType.cs | 4 +- .../Enums/EnumArrivalNoticeCreateType.cs | 12 +- .../Win.Sfs.Shared/Enums/EnumConditionType.cs | 14 +- .../Enums/EnumDetailStatusType.cs | 5 +- .../Enums/EnumDocumentStatus.cs | 4 +- .../Win.Sfs.Shared/Enums/EnumDocumentType.cs | 16 +- .../Win.Sfs.Shared/Enums/EnumFileType.cs | 6 - .../Enums/EnumInventoryStatus.cs | 12 +- .../Win.Sfs.Shared/Enums/EnumItemCategory.cs | 4 +- .../Win.Sfs.Shared/Enums/EnumItemStatus.cs | 12 +- .../Enums/EnumJobOptionAction.cs | 4 +- .../Enums/EnumJobOptionSetToDefaultUom.cs | 4 +- .../Win.Sfs.Shared/Enums/EnumJobStatus.cs | 10 +- .../Win.Sfs.Shared/Enums/EnumJobType.cs | 20 +- .../Win.Sfs.Shared/Enums/EnumStrategyType.cs | 4 +- .../Win.Sfs.Shared/Enums/EnumUsableStatus.cs | 7 +- .../SettleAccount/EnumCustomerLocationType.cs | 5 +- .../SettleAccount/EnumMaterialProperty.cs | 6 +- .../Enums/SettleAccount/EnumSettleStatus.cs | 4 +- .../Win.Sfs.Shared/Etos/EntityDemoEto.cs | 8 +- .../AdvanceShippingNoticeCreateListEto.cs | 4 - .../AdvanceShippingNoticeDeleteListEto.cs | 6 +- .../AdvanceShippingNoticeDetailEto.cs | 11 +- .../Etos/Purchase/AdvanceShippingNoticeEto.cs | 16 +- .../Win.Sfs.Shared/Filter/EnumFilterAction.cs | 4 +- .../Win.Sfs.Shared/Filter/EnumFilterLogic.cs | 8 +- .../Win.Sfs.Shared/Filter/FilterCondition.cs | 4 +- .../Win.Sfs.Shared/Filter/FilterExtensions.cs | 10 +- code/src/Shared/Win.Sfs.Shared/IBranch.cs | 4 +- code/src/Shared/Win.Sfs.Shared/IEnabled.cs | 4 +- code/src/Shared/Win.Sfs.Shared/IRemark.cs | 4 +- .../RepositoryBase/DbSetExtensions.cs | 11 +- .../IBaseDataExtentRepository.cs | 4 +- .../RepositoryBase/IBranchEfCoreRepository.cs | 7 +- .../RepositoryBase/INormalEfCoreRepository.cs | 4 +- .../RepositoryBase/IWinEfCoreRepository.cs | 8 +- .../RepositoryBase/QueryableExtension.cs | 19 +- .../RepositoryBase/UpdateIgnoreAttribute.cs | 4 +- .../src/Shared/Win.Sfs.Shared/SharedModule.cs | 4 +- .../Win.Utils/AddBranchIdHeaderAttribute.cs | 8 +- .../Shared/Win.Utils/BranchHeaderConsts.cs | 4 +- .../Shared/Win.Utils/BranchHeaderParameter.cs | 10 +- .../DateTimeConverterUsingDateTimeParse.cs | 4 +- .../Shared/Win.Utils/DatetimeJsonConverter.cs | 4 +- .../NullableDatetimeJsonConverter.cs | 8 +- .../Shared/Win.Utils/SerializeExtensions.cs | 6 +- .../Win.Utils/SwaggerHeaderAttribute.cs | 4 +- .../Shared/Win.Utils/SwaggerHeaderFilter.cs | 4 +- 995 files changed, 19569 insertions(+), 27226 deletions(-) diff --git a/code/src/.editorconfig b/code/src/.editorconfig index fe767f48..5de070fc 100644 --- a/code/src/.editorconfig +++ b/code/src/.editorconfig @@ -42,7 +42,7 @@ csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_anonymous_types = true # Namespace settings -csharp_style_namespace_declarations = file_scoped +csharp_style_namespace_declarations = block_scoped:warning # Brace settings csharp_prefer_braces = true # Prefer curly braces even for one line of code diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/BranchDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/BranchDto.cs index 8db31bbf..ea2a0d50 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/BranchDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/BranchDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using BaseService.RelationBaseData; using Volo.Abp.Application.Dtos; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/CreateOrUpdateBranchDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/CreateOrUpdateBranchDto.cs index 6a30e182..e58c92e0 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/CreateOrUpdateBranchDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/CreateOrUpdateBranchDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using BaseService.RelationBaseData; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/GetBranchInputDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/GetBranchInputDto.cs index 66ed07c9..edbcf3d3 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/GetBranchInputDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/Dto/GetBranchInputDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using Volo.Abp.Application.Dtos; namespace BaseService.BaseData.BranchManagement.Dto diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/IBranchAppService.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/IBranchAppService.cs index 189dfa0b..7c409b5f 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/IBranchAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/BranchManagement/IBranchAppService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using BaseService.BaseData.BranchManagement.Dto; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/Permissions/Dto/ApplicationAuthes.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/Permissions/Dto/ApplicationAuthes.cs index 1a9eb22a..ca296a7f 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/Permissions/Dto/ApplicationAuthes.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/Permissions/Dto/ApplicationAuthes.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace BaseService.BaseData.Permissions.Dto { diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/CreateOrUpdateUserBranchDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/CreateOrUpdateUserBranchDto.cs index c6cde966..ef0426ed 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/CreateOrUpdateUserBranchDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/CreateOrUpdateUserBranchDto.cs @@ -1,17 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using Volo.Abp.Identity; namespace BaseService.BaseData.UserBranchRoleManagement.Dto { - public class CreateOrUpdateUserBranchDto + public class CreateOrUpdateUserBranchDto { /// /// 主键 /// public Guid Id { get; set; } - + /// /// 用户ID /// diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/GetUserBranchInput.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/GetUserBranchInput.cs index 50c22596..c2bb3a01 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/GetUserBranchInput.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/GetUserBranchInput.cs @@ -1,4 +1,4 @@ -using System; +using System; using Volo.Abp.Application.Dtos; namespace BaseService.BaseData.UserBranchRoleManagement.Dto diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/UserBranchDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/UserBranchDto.cs index 63f16fc1..aad49a2c 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/UserBranchDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/Dto/UserBranchDto.cs @@ -1,10 +1,8 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel.DataAnnotations.Schema; using Volo.Abp.Application.Dtos; -using Volo.Abp.Domain.Entities; -using Volo.Abp.MultiTenancy; namespace BaseService.BaseData.UserBranchRoleManagement.Dto { diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/IUserBranchAppService.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/IUserBranchAppService.cs index 6210b37f..fbf18eb9 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/IUserBranchAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseData/UserBranchRoleManagement/IUserBranchAppService.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; using BaseService.BaseData.Permissions.Dto; @@ -30,7 +30,7 @@ namespace BaseService.BaseData.UserBranchRoleManagement Task GetAuthConfigAsync(Guid branchId); - Task> GetUserRolesAsync(Guid userId,Guid branchId); + Task> GetUserRolesAsync(Guid userId, Guid branchId); Task DeleteUnitAsync(Guid userId, Guid branchId); diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseServiceApplicationContractsModule.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseServiceApplicationContractsModule.cs index 5b426d24..98b8c9cb 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseServiceApplicationContractsModule.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/BaseServiceApplicationContractsModule.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Application; +using Volo.Abp.Application; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissionDefinitionProvider .cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissionDefinitionProvider .cs index 6ed3b8c3..af782724 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissionDefinitionProvider .cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissionDefinitionProvider .cs @@ -1,4 +1,4 @@ -using BaseService.Localization; +using BaseService.Localization; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; @@ -14,8 +14,7 @@ namespace BaseService.Permissions var auditLogging = baseService.AddPermission(BaseServicePermissions.AuditLogging.Default, L("AuditLogging")); - - var branch = baseService.AddPermission(BaseServicePermissions.Branch.Default,L("Branch")); + var branch = baseService.AddPermission(BaseServicePermissions.Branch.Default, L("Branch")); branch.AddChild(BaseServicePermissions.Branch.Update, L("Edit")); branch.AddChild(BaseServicePermissions.Branch.Delete, L("Delete")); branch.AddChild(BaseServicePermissions.Branch.Create, L("Create")); diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissions.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissions.cs index f78ccc30..f5dbf0e5 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissions.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Permissions/BaseServicePermissions.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace BaseService.Permissions { public static class BaseServicePermissions @@ -21,7 +17,6 @@ namespace BaseService.Permissions public const string Create = Default + ".Create"; } - public static class UserBranch { public const string Default = BaseService + ".UserBranch"; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchPermissionDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchPermissionDto.cs index edca6b07..892f74bf 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchPermissionDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchPermissionDto.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace BaseService.RelationData.Dto { diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchRoleDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchRoleDto.cs index 3c3fb969..320f84ed 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchRoleDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/Dto/BranchRoleDto.cs @@ -1,7 +1,5 @@ -using System; -using System.ComponentModel.DataAnnotations.Schema; +using System; using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; namespace BaseService.RelationData.Dto { diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/IBranchRelationAppService.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/IBranchRelationAppService.cs index 34e7b01d..517a9e35 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/IBranchRelationAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/RelationData/IBranchRelationAppService.cs @@ -1,11 +1,9 @@ -using System; +using System; using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; using BaseService.BaseData.BranchManagement.Dto; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -using Volo.Abp.Identity; namespace BaseService.RelationData { diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogActionDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogActionDto.cs index 09cf14d9..450dabc7 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogActionDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogActionDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Volo.Abp.Application.Dtos; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogDto.cs index 9d9e8d5d..ca08e9ed 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/AuditLogDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Volo.Abp.Application.Dtos; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityChangeDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityChangeDto.cs index ae666afb..85494d91 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityChangeDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityChangeDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; using Volo.Abp.Application.Dtos; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityPropertyChangeDto.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityPropertyChangeDto.cs index 2964edb4..f4d63571 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityPropertyChangeDto.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/EntityPropertyChangeDto.cs @@ -1,4 +1,4 @@ -using System; +using System; using Volo.Abp.Application.Dtos; namespace BaseService.Systems.AuditLoggingManagement.Dto diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAuditLogsInput.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAuditLogsInput.cs index f7441fc3..6928cbe3 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAuditLogsInput.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAuditLogsInput.cs @@ -1,4 +1,4 @@ -using System.Net; +using System.Net; using Volo.Abp.Application.Dtos; namespace BaseService.Systems.AuditLoggingManagement.Dto @@ -20,7 +20,6 @@ namespace BaseService.Systems.AuditLoggingManagement.Dto public int? MaxExecutionDuration { get; set; } - public int? MinExecutionDuration { get; set; } public bool HasException { get; set; } diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayInput.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayInput.cs index 7834b9f3..ce8f4eb6 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayInput.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayInput.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace BaseService.Systems.AuditLoggingManagement.Dto { diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayOutput.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayOutput.cs index 67657624..f4b3eec3 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayOutput.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/Dto/GetAverageExecutionDurationPerDayOutput.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; namespace BaseService.Systems.AuditLoggingManagement.Dto diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/IAuditLoggingAppService.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/IAuditLoggingAppService.cs index a718bcf9..0a1b8740 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/IAuditLoggingAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/AuditLoggingManagement/IAuditLoggingAppService.cs @@ -1,8 +1,6 @@ -using BaseService.Systems.AuditLoggingManagement.Dto; using System; -using System.Collections.Generic; -using System.Text; using System.Threading.Tasks; +using BaseService.Systems.AuditLoggingManagement.Dto; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; diff --git a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs index 83a58daa..9269c5b9 100644 --- a/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application.Contracts/Systems/UserManagement/IUserAppService.cs @@ -1,7 +1,7 @@ -using BaseService.BaseData.Permissions.Dto; -using BaseService.RelationData.Dto; using System; using System.Threading.Tasks; +using BaseService.BaseData.Permissions.Dto; +using BaseService.RelationData.Dto; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Identity; @@ -68,4 +68,4 @@ namespace BaseService.Systems.UserManagement //Task ResetPasswordCurrentUser(Guid id, IdentityUserCreateDto input); Task ResetPasswordAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs b/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs index 66ba4a2f..79e9da19 100644 --- a/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs +++ b/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationAutoMapperProfile.cs @@ -1,12 +1,8 @@ -using AutoMapper; +using AutoMapper; using BaseService.BaseData; -using BaseService.RelationBaseData; -using BaseService.Systems.AuditLoggingManagement.Dto; -using System; -using System.Collections.Generic; -using System.Text; using BaseService.BaseData.BranchManagement.Dto; using BaseService.BaseData.UserBranchRoleManagement.Dto; +using BaseService.RelationBaseData; using BaseService.RelationData.Dto; namespace BaseService diff --git a/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationModule.cs b/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationModule.cs index 550e9068..23b4b9c4 100644 --- a/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationModule.cs +++ b/code/src/Modules/BaseService/BaseService.Application/BaseServiceApplicationModule.cs @@ -1,4 +1,4 @@ -using Volo.Abp.AutoMapper; +using Volo.Abp.AutoMapper; using Volo.Abp.Identity; using Volo.Abp.Json; using Volo.Abp.Modularity; diff --git a/code/src/Modules/BaseService/BaseService.Application/BranchManagement/BranchAppService.cs b/code/src/Modules/BaseService/BaseService.Application/BranchManagement/BranchAppService.cs index e6f12ec2..2abc95a1 100644 --- a/code/src/Modules/BaseService/BaseService.Application/BranchManagement/BranchAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application/BranchManagement/BranchAppService.cs @@ -4,9 +4,7 @@ using System.Linq; using System.Linq.Dynamic.Core; using System.Threading.Tasks; using BaseService.BaseData.BranchManagement.Dto; -using BaseService.BaseData.UserBranchRoleManagement.Dto; using BaseService.Permissions; -using BaseService.RelationBaseData; using BaseService.RelationData.Dto; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -44,8 +42,11 @@ namespace BaseService.BaseData.BranchManagement [Authorize(BaseServicePermissions.Branch.Create)] public virtual async Task CreateAsync(CreateOrUpdateBranchDto input) { - var exist = await _repository.FirstOrDefaultAsync(_ => _.Name == input.Name); - if (exist != null) throw new BusinessException("名称:" + input.Name + "机构已存在"); + var exist = await _repository.FirstOrDefaultAsync(_ => _.Name == input.Name).ConfigureAwait(false); + if (exist != null) + { + throw new BusinessException("名称:" + input.Name + "机构已存在"); + } var branch = new Branch(GuidGenerator.Create(), CurrentTenant.Id, @@ -57,12 +58,12 @@ namespace BaseService.BaseData.BranchManagement true, input.Enabled ); - var parent = await _repository.FirstOrDefaultAsync(_ => _.Id == input.Pid); + var parent = await _repository.FirstOrDefaultAsync(_ => _.Id == input.Pid).ConfigureAwait(false); ChangeOrganizationModel(branch, parent); - await _repository.InsertAsync(branch); + await _repository.InsertAsync(branch).ConfigureAwait(false); //create cache - await _cache.SetAsync(branch.Id.ToString(), branch, CacheStrategyConst.FIVE_MINUTES); + await _cache.SetAsync(branch.Id.ToString(), branch, CacheStrategyConst.FIVE_MINUTES).ConfigureAwait(false); return ObjectMapper.Map(branch); } @@ -74,10 +75,10 @@ namespace BaseService.BaseData.BranchManagement { foreach (var id in ids) { - var branch = await _repository.GetAsync(id); - await _repository.DeleteAsync(_ => _.CascadeId.Contains(branch.CascadeId)); - await _cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(_ => _.Id == id); + var branch = await _repository.GetAsync(id).ConfigureAwait(false); + await _repository.DeleteAsync(_ => _.CascadeId.Contains(branch.CascadeId)).ConfigureAwait(false); + await _cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(_ => _.Id == id).ConfigureAwait(false); } } [HttpGet] @@ -85,7 +86,7 @@ namespace BaseService.BaseData.BranchManagement [AllowAnonymous] public virtual async Task GetAsync(Guid id) { - var result = await GetFromCacheAsync(id); + var result = await GetFromCacheAsync(id).ConfigureAwait(false); return ObjectMapper.Map(result); } @@ -93,15 +94,15 @@ namespace BaseService.BaseData.BranchManagement { var result = await _cache.GetOrAddAsync( id.ToString(), - async () => await GetFromRepository(id), - CacheStrategyConst.FIVE_MINUTES); + async () => await GetFromRepository(id).ConfigureAwait(false), + CacheStrategyConst.FIVE_MINUTES).ConfigureAwait(false); return result; } private async Task GetFromRepository(Guid id) { - return await _repository.GetAsync(id); + return await _repository.GetAsync(id).ConfigureAwait(false); } [HttpGet] @@ -113,15 +114,15 @@ namespace BaseService.BaseData.BranchManagement .WhereIf(input.CategoryId.HasValue, _ => _.CategoryId == input.CategoryId); if (input.Id.HasValue) { - var org = await _repository.GetAsync(input.Id.Value); + var org = await _repository.GetAsync(input.Id.Value).ConfigureAwait(false); query = query.Where(_ => _.CascadeId.Contains(org.CascadeId)); } var items = await query.OrderBy(input.Sorting ?? "Sort") .Skip(input.SkipCount) .Take(input.MaxResultCount) - .ToListAsync(); - var totalCount = await query.CountAsync(); + .ToListAsync().ConfigureAwait(false); + var totalCount = await query.CountAsync().ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(items); return new PagedResultDto(totalCount, dtos); @@ -145,13 +146,13 @@ namespace BaseService.BaseData.BranchManagement var items = new List(); if (!string.IsNullOrWhiteSpace(filter)) { - items = await _repository.Where(_ => _.Name.Contains(filter)).ToListAsync(); + items = await _repository.Where(_ => _.Name.Contains(filter)).ToListAsync().ConfigureAwait(false); } else { var query = id.HasValue ? _repository.Where(_ => _.Pid == id) : _repository.Where(_ => _.Pid == null); - items = await query.ToListAsync(); + items = await query.ToListAsync().ConfigureAwait(false); } var dtos = ObjectMapper.Map, List>(items); @@ -161,7 +162,7 @@ namespace BaseService.BaseData.BranchManagement [Route("children")] public virtual async Task> GetChildrenAsync() { - var items = await _repository.GetListAsync(); + var items = await _repository.GetListAsync().ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(items); return new ListResultDto(dtos); @@ -171,13 +172,17 @@ namespace BaseService.BaseData.BranchManagement [Authorize(BaseServicePermissions.Branch.Update)] public virtual async Task UpdateAsync(Guid id, CreateOrUpdateBranchDto input) { - if (input.Pid == id) throw new BusinessException("机构上级不能为当前机构!"); - var branch = await _repository.FirstOrDefaultAsync(_ => _.Id == id); + if (input.Pid == id) + { + throw new BusinessException("机构上级不能为当前机构!"); + } + + var branch = await _repository.FirstOrDefaultAsync(_ => _.Id == id).ConfigureAwait(false); if (branch.Pid != input.Pid) { - var parent = await _repository.FirstOrDefaultAsync(_ => _.Id == input.Pid); + var parent = await _repository.FirstOrDefaultAsync(_ => _.Id == input.Pid).ConfigureAwait(false); var orgs = await _repository.Where(_ => _.CascadeId.Contains(branch.CascadeId) && _.Id != branch.Id) - .OrderBy(_ => _.CascadeId).ToListAsync(); + .OrderBy(_ => _.CascadeId).ToListAsync().ConfigureAwait(false); branch.Pid = input.Pid; ChangeOrganizationModel(branch, parent); foreach (var org in orgs) @@ -197,7 +202,7 @@ namespace BaseService.BaseData.BranchManagement branch.Sort = input.Sort; branch.Enabled = input.Enabled; - await _cache.SetAsync(id.ToString(), branch, CacheStrategyConst.FIVE_MINUTES); + await _cache.SetAsync(id.ToString(), branch, CacheStrategyConst.FIVE_MINUTES).ConfigureAwait(false); return ObjectMapper.Map(branch); } @@ -207,7 +212,11 @@ namespace BaseService.BaseData.BranchManagement var cascadeId = org.CascadeId == null ? 1 : int.Parse(org.CascadeId.TrimEnd('.').Split('.').Last()); if (checkLevel) { - if (parent != null && parent.Leaf) parent.Leaf = false; + if (parent != null && parent.Leaf) + { + parent.Leaf = false; + } + var lastLevel = _repository.Where(_ => _.Pid == org.Pid && _.Id != org.Id) .OrderByDescending(_ => _.CascadeId) .FirstOrDefault(); @@ -216,7 +225,11 @@ namespace BaseService.BaseData.BranchManagement if (org.Pid.HasValue) { - if (parent == null) throw new BusinessException("上级机构查询错误!"); + if (parent == null) + { + throw new BusinessException("上级机构查询错误!"); + } + org.CascadeId = parent.CascadeId + cascadeId + "."; org.FullName = parent.FullName + "/" + org.Name; } @@ -228,7 +241,6 @@ namespace BaseService.BaseData.BranchManagement } - /// /// 根据分支ID,查找中间表branch-role /// @@ -239,8 +251,8 @@ namespace BaseService.BaseData.BranchManagement public virtual async Task> GetRolesAsync(Guid branchId) { var dtos = new List(); - var getRoleIds = await GetRolesByBranchIdAsync(branchId); - var roles = await RoleRepository.GetListAsync(); + var getRoleIds = await GetRolesByBranchIdAsync(branchId).ConfigureAwait(false); + var roles = await RoleRepository.GetListAsync().ConfigureAwait(false); if (getRoleIds != null) { foreach (var role in getRoleIds) @@ -253,11 +265,10 @@ namespace BaseService.BaseData.BranchManagement protected virtual async Task> GetRolesByBranchIdAsync(Guid branchId) { - var userBranch = await _repositoryBranchRole.GetAsync(_ => _.BranchId == branchId); + var userBranch = await _repositoryBranchRole.GetAsync(_ => _.BranchId == branchId).ConfigureAwait(false); var roles = userBranch.Roles.ToList(); return roles; } - /// /// 用于角色管理:分支和角色互动 @@ -277,7 +288,7 @@ namespace BaseService.BaseData.BranchManagement } else { - var list = await RoleRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount); + var list = await RoleRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); foreach (var roleid in getRoleIds) { var filterRole = list.FirstOrDefault(_ => _.Id == roleid.RoleId); diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs index 18a3c671..c7b1839a 100644 --- a/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/TokenAppService.cs @@ -1,10 +1,10 @@ -using IdentityModel.Client; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; using System.ComponentModel.DataAnnotations; using System.Net.Http; using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; using Volo.Abp.Application.Services; namespace BaseService.UserManagement @@ -52,4 +52,4 @@ namespace BaseService.UserManagement public string Password { get; set; } } } -} \ No newline at end of file +} diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs index c83fc00b..c7c57bc7 100644 --- a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserAppService.cs @@ -72,9 +72,9 @@ namespace BaseService.Systems.UserManagement [Route("{id}")] public async Task GetAsync(Guid id) { - var user = await UserManager.GetByIdAsync(id); + var user = await UserManager.GetByIdAsync(id).ConfigureAwait(false); var dto = Mapper.Map(user); - dto.RoleNames = (await UserRepository.GetRoleNamesAsync(id)).ToArray(); + dto.RoleNames = (await UserRepository.GetRoleNamesAsync(id).ConfigureAwait(false)).ToArray(); return dto; } @@ -88,7 +88,7 @@ namespace BaseService.Systems.UserManagement public async Task GetCurrentUserAsync() { var id = CurrentUser.GetId(); - var currentUser = await UserManager.GetByIdAsync(id); + var currentUser = await UserManager.GetByIdAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(currentUser); return dto; @@ -107,12 +107,12 @@ namespace BaseService.Systems.UserManagement input.MapExtraPropertiesTo(user); - (await UserManager.CreateAsync(user, input.Password)).CheckErrors(); - await UpdateAsync(user, input); + (await UserManager.CreateAsync(user, input.Password).ConfigureAwait(false)).CheckErrors(); + await UpdateAsync(user, input).ConfigureAwait(false); var dto = ObjectMapper.Map(user); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false); return dto; } @@ -122,25 +122,25 @@ namespace BaseService.Systems.UserManagement [Authorize(IdentityPermissions.Users.Update)] public async Task UpdateAsync(Guid id, IdentityUserUpdateDto input) { - var user = await UserManager.GetByIdAsync(id); + var user = await UserManager.GetByIdAsync(id).ConfigureAwait(false); user.ConcurrencyStamp = input.ConcurrencyStamp; - (await UserManager.SetUserNameAsync(user, input.UserName)).CheckErrors(); + (await UserManager.SetUserNameAsync(user, input.UserName).ConfigureAwait(false)).CheckErrors(); - await UpdateAsync(user, input); + await UpdateAsync(user, input).ConfigureAwait(false); input.MapExtraPropertiesTo(user); - (await UserManager.UpdateAsync(user)).CheckErrors(); + (await UserManager.UpdateAsync(user).ConfigureAwait(false)).CheckErrors(); if (!input.Password.IsNullOrEmpty()) { - (await UserManager.RemovePasswordAsync(user)).CheckErrors(); - (await UserManager.AddPasswordAsync(user, input.Password)).CheckErrors(); + (await UserManager.RemovePasswordAsync(user).ConfigureAwait(false)).CheckErrors(); + (await UserManager.AddPasswordAsync(user, input.Password).ConfigureAwait(false)).CheckErrors(); } var dto = ObjectMapper.Map(user); - await CurrentUnitOfWork.SaveChangesAsync(); + await CurrentUnitOfWork.SaveChangesAsync().ConfigureAwait(false); return dto; } @@ -148,9 +148,9 @@ namespace BaseService.Systems.UserManagement [HttpGet] public async Task> GetAll(GetIdentityUsersInput input) { - var totalCount = await UserRepository.GetCountAsync(input.Filter); + var totalCount = await UserRepository.GetCountAsync(input.Filter).ConfigureAwait(false); var items = await UserRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, - input.Filter); + input.Filter).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(items); @@ -163,24 +163,24 @@ namespace BaseService.Systems.UserManagement { if (!string.Equals(user.Email, input.Email, StringComparison.InvariantCultureIgnoreCase)) { - (await UserManager.SetEmailAsync(user, input.Email)).CheckErrors(); + (await UserManager.SetEmailAsync(user, input.Email).ConfigureAwait(false)).CheckErrors(); } if (!string.Equals(user.PhoneNumber, input.PhoneNumber, StringComparison.InvariantCultureIgnoreCase)) { - (await UserManager.SetPhoneNumberAsync(user, input.PhoneNumber)).CheckErrors(); + (await UserManager.SetPhoneNumberAsync(user, input.PhoneNumber).ConfigureAwait(false)).CheckErrors(); } //说明:从3.1升级到3.3后,去掉了TwoFactorEnabled属性 //(await UserManager.SetTwoFactorEnabledAsync(user, input.TwoFactorEnabled)).CheckErrors(); - (await UserManager.SetLockoutEnabledAsync(user, input.LockoutEnabled)).CheckErrors(); + (await UserManager.SetLockoutEnabledAsync(user, input.LockoutEnabled).ConfigureAwait(false)).CheckErrors(); user.Name = input.Name; user.Surname = input.Surname; if (input.RoleNames != null) { - (await UserManager.SetRolesAsync(user, input.RoleNames)).CheckErrors(); + (await UserManager.SetRolesAsync(user, input.RoleNames).ConfigureAwait(false)).CheckErrors(); } } @@ -195,7 +195,7 @@ namespace BaseService.Systems.UserManagement { var branchList = new List(); //获取用户的所有分支 - var branchRoles = await GetUserBranchRolesAsync(CurrentUsers.GetId()); + var branchRoles = await GetUserBranchRolesAsync(CurrentUsers.GetId()).ConfigureAwait(false); var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId) .Select(y => new { xx = new { BranchId = y.Key }, items = y }); foreach (var group in groupBranchRoles @@ -204,7 +204,7 @@ namespace BaseService.Systems.UserManagement var mybranchrole = new BranchRoleDto { BranchId = @group.xx.BranchId, - BranchName = (await _branchRepository.GetListAsync()) + BranchName = (await _branchRepository.GetListAsync().ConfigureAwait(false)) .FirstOrDefault(_ => _.Id == @group.xx.BranchId)?.Name }; branchList.Add(mybranchrole); @@ -224,7 +224,7 @@ namespace BaseService.Systems.UserManagement { var branchList = new List(); //获取用户的所有分支 - var branchRoles = await GetUserBranchRolesAsync(userId); + var branchRoles = await GetUserBranchRolesAsync(userId).ConfigureAwait(false); var groupBranchRoles = branchRoles.GroupBy(x => x.BranchId) .Select(y => new { xx = new { BranchId = y.Key }, items = y }); foreach (var group in groupBranchRoles) @@ -232,7 +232,7 @@ namespace BaseService.Systems.UserManagement var mybranchrole = new BranchRoleDto { BranchId = @group.xx.BranchId, - BranchName = (await _branchRepository.GetListAsync()) + BranchName = (await _branchRepository.GetListAsync().ConfigureAwait(false)) .FirstOrDefault(_ => _.Id == @group.xx.BranchId) .Name }; @@ -252,12 +252,12 @@ namespace BaseService.Systems.UserManagement { // var userRoleNames = (await AppService.GetRolesAsync(id)).Items.Select(r => r.Name).ToList(); var listPermiss = new List(); - var listRolesName = await UserRepository.GetRoleNamesAsync(userId); + var listRolesName = await UserRepository.GetRoleNamesAsync(userId).ConfigureAwait(false); if (listRolesName != null) { foreach (var rolename in listRolesName) { - var permissionGrantsInRole = await PermissionGrantRepository.GetListAsync(RolePermissionValueProvider.ProviderName, rolename); + var permissionGrantsInRole = await PermissionGrantRepository.GetListAsync(RolePermissionValueProvider.ProviderName, rolename).ConfigureAwait(false); if (permissionGrantsInRole != null) { foreach (var permiss in permissionGrantsInRole) @@ -279,7 +279,7 @@ namespace BaseService.Systems.UserManagement { var branchList = new List(); //获取当前用户的所有角色 - var userRoles = await UserRepository.GetRolesAsync(userId); + var userRoles = await UserRepository.GetRolesAsync(userId).ConfigureAwait(false); if (userRoles == null) { throw new BusinessException("当前登录用户没有任何角色信息,请找管理员进行维护!"); @@ -287,7 +287,7 @@ namespace BaseService.Systems.UserManagement else { //获取所有分支-角色的信息 - var allBranchRoles = await _branchRoleRepository.GetListAsync(); + var allBranchRoles = await _branchRoleRepository.GetListAsync().ConfigureAwait(false); if (allBranchRoles != null) { foreach (var role in userRoles) @@ -296,7 +296,10 @@ namespace BaseService.Systems.UserManagement foreach (var branch in branchRoles) { if (branch == null) + { continue; //该用户没有角色-分支信息 + } + var branchRole = new BranchRole(branch.BranchId, role.Id); branchList.Add(branchRole); } @@ -322,7 +325,7 @@ namespace BaseService.Systems.UserManagement public async Task GetAuthConfigAsync(Guid branchId) { var authConfig = new ApplicationAuthes(); - var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync(); + var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync().ConfigureAwait(false); foreach (var policyName in policyNames) { authConfig.Policies[policyName] = true; @@ -335,9 +338,9 @@ namespace BaseService.Systems.UserManagement var userId = CurrentUsers.GetId(); //获取当前用户的所有权限信息 - var getUserPermissions = await GetUserGrantedPermissionsAsync(userId); + var getUserPermissions = await GetUserGrantedPermissionsAsync(userId).ConfigureAwait(false); //获取当前用户的所有分支 - var gerUserBranches = await GetUserBranchRolesAsync(userId); + var gerUserBranches = await GetUserBranchRolesAsync(userId).ConfigureAwait(false); if (gerUserBranches == null) { throw new BusinessException("当前登录用户没有任何分支信息,请找管理员进行维护!"); @@ -395,13 +398,13 @@ namespace BaseService.Systems.UserManagement [Authorize(IdentityPermissions.Users.Update)] public async Task ResetPasswordAsync(Guid userId) { - var user = await UserManager.FindByIdAsync(userId.ToString()); + var user = await UserManager.FindByIdAsync(userId.ToString()).ConfigureAwait(false); //string token = await UserManager.GeneratePasswordResetTokenAsync(user);//err:No IUserTwoFactorTokenProvider named 'Default' is registered. //await UserManager.ResetPasswordAsync(user, token, "1q2w3E*"); - await UserManager.RemovePasswordAsync(user); + await UserManager.RemovePasswordAsync(user).ConfigureAwait(false); if (user.PasswordHash == null) { - (await UserManager.AddPasswordAsync(user, "123456")).CheckErrors(); + (await UserManager.AddPasswordAsync(user, "123456").ConfigureAwait(false)).CheckErrors(); } var dto = ObjectMapper.Map(user); diff --git a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserBranchAppService.cs b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserBranchAppService.cs index 3d883c0d..de65f012 100644 --- a/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserBranchAppService.cs +++ b/code/src/Modules/BaseService/BaseService.Application/UserManagement/UserBranchAppService.cs @@ -8,7 +8,6 @@ using BaseService.BaseData.Permissions.Dto; using BaseService.BaseData.UserBranchRoleManagement; using BaseService.BaseData.UserBranchRoleManagement.Dto; using BaseService.Permissions; -using BaseService.RelationData.Dto; using BaseService.Systems.UserManagement; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -79,7 +78,7 @@ namespace BaseService.UserManagement //[Authorize(BaseServicePermissions.UserBranch.Create)] public virtual async Task CreateUpdateAsync(CreateOrUpdateUserBranchDto input) { - var userBranch = await _repository.FirstOrDefaultAsync(_ => _.UserId == input.UserId && _.BranchId == input.BranchId); + var userBranch = await _repository.FirstOrDefaultAsync(_ => _.UserId == input.UserId && _.BranchId == input.BranchId).ConfigureAwait(false); if (userBranch == null) { //执行添加操作 @@ -93,7 +92,7 @@ namespace BaseService.UserManagement { createUserBranch.AddRole(role.RoleId); } - await _repository.InsertAsync(createUserBranch); + await _repository.InsertAsync(createUserBranch).ConfigureAwait(false); ObjectMapper.Map(createUserBranch); } else @@ -121,17 +120,16 @@ namespace BaseService.UserManagement } if (input.Roles == null || input.Roles.Count == 0) { - await _repository.UpdateAsync(userBranch); + await _repository.UpdateAsync(userBranch).ConfigureAwait(false); } else { - await _repository.UpdateAsync(userBranch, true); + await _repository.UpdateAsync(userBranch, true).ConfigureAwait(false); } ObjectMapper.Map(userBranch); } } - //public virtual async Task CreateAsync(CreateOrUpdateUserBranchDto input) //{ // var exist = await _repository.FirstOrDefaultAsync(_ => _.UserId == input.UserId && _.BranchId == input.BranchId); @@ -162,7 +160,7 @@ namespace BaseService.UserManagement [Authorize(BaseServicePermissions.UserBranch.Delete)] public virtual async Task DeleteUnitAsync(Guid userId, Guid branchId) { - await _repository.DeleteAsync(p => p.UserId == userId && p.BranchId == branchId); + await _repository.DeleteAsync(p => p.UserId == userId && p.BranchId == branchId).ConfigureAwait(false); } /// @@ -175,10 +173,9 @@ namespace BaseService.UserManagement [Authorize(BaseServicePermissions.UserBranch.Delete)] public virtual async Task DeleteUnitAsync(Guid userId) { - await _repository.DeleteAsync(p => p.UserId == userId); + await _repository.DeleteAsync(p => p.UserId == userId).ConfigureAwait(false); } - /// /// 批量删除 /// @@ -191,7 +188,7 @@ namespace BaseService.UserManagement { foreach (var id in ids) { - await _repository.DeleteAsync(_ => _.Id == id); + await _repository.DeleteAsync(_ => _.Id == id).ConfigureAwait(false); } } @@ -206,7 +203,7 @@ namespace BaseService.UserManagement [Authorize(BaseServicePermissions.UserBranch.Update)] public virtual async Task UpdateAsync(Guid id, CreateOrUpdateUserBranchDto input) { - var userBranch = await _repository.FirstOrDefaultAsync(_ => _.UserId == input.UserId && _.BranchId == input.BranchId); + var userBranch = await _repository.FirstOrDefaultAsync(_ => _.UserId == input.UserId && _.BranchId == input.BranchId).ConfigureAwait(false); userBranch.UserId = input.UserId; userBranch.BranchId = input.BranchId; //修改角色信息 @@ -229,8 +226,6 @@ namespace BaseService.UserManagement return ObjectMapper.Map(userBranch); } - - /// /// 查单条数据 /// @@ -240,7 +235,7 @@ namespace BaseService.UserManagement [Route("{id}")] public virtual async Task GetAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); return ObjectMapper.Map(result); } @@ -258,8 +253,8 @@ namespace BaseService.UserManagement var items = await query .Skip(input.SkipCount) .Take(input.MaxResultCount) - .ToListAsync(); - var totalCount = await query.CountAsync(); + .ToListAsync().ConfigureAwait(false); + var totalCount = await query.CountAsync().ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(items); return new PagedResultDto(totalCount, dtos); @@ -276,16 +271,16 @@ namespace BaseService.UserManagement public virtual async Task> GetUserBranchsAsync(Guid userId) { var dtos = new List(); - await GetBranchList(userId, dtos); + await GetBranchList(userId, dtos).ConfigureAwait(false); return dtos; } - private async Task GetBranchList(Guid userId, List dtos) + private async Task GetBranchList(Guid userId, List dtos) { var userBranches = _repository.Where(_ => _.UserId == userId); foreach (var query in userBranches) { - var branch = await _branchAppService.GetAsync(query.BranchId); + var branch = await _branchAppService.GetAsync(query.BranchId).ConfigureAwait(false); dtos.Add(new UserBranchDto() { BranchId = query.BranchId, @@ -294,7 +289,6 @@ namespace BaseService.UserManagement } } - /// /// 分支列表(当前登录用户) /// @@ -305,7 +299,7 @@ namespace BaseService.UserManagement public virtual async Task> GetCurrentUserBranchesAsync() { var dtos = new List(); - await GetBranchList(CurrentUser.GetId(), dtos); + await GetBranchList(CurrentUser.GetId(), dtos).ConfigureAwait(false); return dtos; } @@ -324,12 +318,11 @@ namespace BaseService.UserManagement { throw new BusinessException("当前登录用户不存在!"); } - var branch = await _branchAppService.GetAsync(userBranche.BranchId); + var branch = await _branchAppService.GetAsync(userBranche.BranchId).ConfigureAwait(false); dto.BranchId = branch.Id; return dto; } - /// /// 获取当前登录用户所在组织的所有权限信息 /// @@ -341,7 +334,7 @@ namespace BaseService.UserManagement public virtual async Task GetAuthConfigAsync(Guid branchId) { var authConfig = new ApplicationAuthes(); - var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync(); + var policyNames = await _abpAuthorizationPolicyProvider.GetPoliciesNamesAsync().ConfigureAwait(false); foreach (var policyName in policyNames) { authConfig.Policies[policyName] = true; @@ -349,13 +342,13 @@ namespace BaseService.UserManagement var userId = CurrentUser.GetId(); //获取当前用户的所有权限信息 - var grantedPermuissions = await GetUserGrantedPermissionsAsync(userId, branchId); + var grantedPermuissions = await GetUserGrantedPermissionsAsync(userId, branchId).ConfigureAwait(false); if (grantedPermuissions == null || grantedPermuissions.Count == 0) { throw new BusinessException("当前登录用户没有任何权限信息,请找管理员进行维护!"); } //获取当前用户所在组织的所有角色名 - var userRoleName = await GetUserRoleNamesAsync(userId, branchId); + var userRoleName = await GetUserRoleNamesAsync(userId, branchId).ConfigureAwait(false); if (userRoleName == null) { throw new BusinessException("当前登录用户没有任何组织信息,请找管理员进行维护!"); @@ -368,7 +361,10 @@ namespace BaseService.UserManagement { //GrantedPolicies的key键不能相同 if (authConfig.GrantedPolicies.ContainsKey(permission.Name)) + { continue; + } + authConfig.GrantedPolicies.Add(permission.Name, true); } } @@ -380,15 +376,15 @@ namespace BaseService.UserManagement /// /// /// - protected virtual async Task> GetUserGrantedPermissionsAsync(Guid userId,Guid branchId) + protected virtual async Task> GetUserGrantedPermissionsAsync(Guid userId, Guid branchId) { var permissionGrants = new List(); - var listRolesName = await GetUserRoleNamesAsync(userId, branchId); + var listRolesName = await GetUserRoleNamesAsync(userId, branchId).ConfigureAwait(false); if (listRolesName != null) { foreach (var rolename in listRolesName) { - var permissionGrantsInRole = await PermissionGrantRepository.GetListAsync(RolePermissionValueProvider.ProviderName, rolename); + var permissionGrantsInRole = await PermissionGrantRepository.GetListAsync(RolePermissionValueProvider.ProviderName, rolename).ConfigureAwait(false); if (permissionGrantsInRole != null) { foreach (var permiss in permissionGrantsInRole) @@ -408,10 +404,10 @@ namespace BaseService.UserManagement /// protected virtual async Task> GetUserRoleNamesAsync(Guid userId, Guid branchId) { - var userBranch = await _repository.GetAsync(_ => _.UserId == userId && _.BranchId == branchId); + var userBranch = await _repository.GetAsync(_ => _.UserId == userId && _.BranchId == branchId).ConfigureAwait(false); var userRoles = userBranch.Roles.ToList(); //var userRoles = await GetUserRolesAsync(userId, branchId); - var roles = await IdentityRoleRepository.GetListAsync(); + var roles = await IdentityRoleRepository.GetListAsync().ConfigureAwait(false); return userRoles.Select(role => roles.FirstOrDefault(p => p.Id == role.RoleId)?.Name) .Where(roleName => !string.IsNullOrWhiteSpace(roleName)).ToList(); } @@ -423,15 +419,15 @@ namespace BaseService.UserManagement /// [HttpGet] [Route("userRoles/{userId}/{branchId}")] - public virtual async Task> GetUserRolesAsync(Guid userId,Guid branchId) + public virtual async Task> GetUserRolesAsync(Guid userId, Guid branchId) { var roleList = new List(); var isInRole = _repository.FirstOrDefault(_ => _.UserId == userId && _.BranchId == branchId); if (isInRole != null) { - var userBranch = await _repository.GetAsync(_ => _.UserId == userId && _.BranchId == branchId); + var userBranch = await _repository.GetAsync(_ => _.UserId == userId && _.BranchId == branchId).ConfigureAwait(false); var roles = userBranch.Roles.ToList(); - foreach(var role in roles) + foreach (var role in roles) { roleList.Add(new UserBranchRole() { RoleId = role.RoleId }); } @@ -500,4 +496,4 @@ namespace BaseService.UserManagement } } -} \ No newline at end of file +} diff --git a/code/src/Modules/BaseService/BaseService.Domain/BaseData/Branch.cs b/code/src/Modules/BaseService/BaseService.Domain/BaseData/Branch.cs index 94de8887..40b83e1a 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/BaseData/Branch.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/BaseData/Branch.cs @@ -1,12 +1,11 @@ -using BaseService.RelationBaseData; -using JetBrains.Annotations; using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; +using BaseService.RelationBaseData; +using JetBrains.Annotations; using Volo.Abp; using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; namespace BaseService.BaseData { diff --git a/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranch.cs b/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranch.cs index db35d3ff..aa73cdd8 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranch.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranch.cs @@ -1,14 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; namespace BaseService.BaseData { @@ -48,7 +43,6 @@ namespace BaseService.BaseData public virtual ICollection Roles { get; set; } - public UserBranch(Guid id, Guid userId, Guid branchId) : base(id) { UserId = userId; diff --git a/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranchRole.cs b/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranchRole.cs index 97720be1..a3d0ab28 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranchRole.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/BaseData/UserBranchRole.cs @@ -1,13 +1,6 @@ -using System; +using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Text; -using Volo.Abp; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Domain.Values; -using Volo.Abp.Identity; -using Volo.Abp.MultiTenancy; namespace BaseService.BaseData { @@ -21,8 +14,6 @@ namespace BaseService.BaseData /// public Guid RoleId { get; set; } - - public UserBranchRole() { diff --git a/code/src/Modules/BaseService/BaseService.Domain/BaseServiceConsts.cs b/code/src/Modules/BaseService/BaseService.Domain/BaseServiceConsts.cs index ed54812d..37b92bc3 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/BaseServiceConsts.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/BaseServiceConsts.cs @@ -1,4 +1,4 @@ -namespace BaseService +namespace BaseService { public static class BaseServiceConsts { diff --git a/code/src/Modules/BaseService/BaseService.Domain/BaseServiceDomainModule.cs b/code/src/Modules/BaseService/BaseService.Domain/BaseServiceDomainModule.cs index 04efcfc6..d308d4ef 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/BaseServiceDomainModule.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/BaseServiceDomainModule.cs @@ -1,4 +1,4 @@ -using BaseService.Localization; +using BaseService.Localization; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.PermissionManagement.Identity; diff --git a/code/src/Modules/BaseService/BaseService.Domain/BaseServiceModuleExtensionConfigurator.cs b/code/src/Modules/BaseService/BaseService.Domain/BaseServiceModuleExtensionConfigurator.cs index 3a0299cf..a25154cf 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/BaseServiceModuleExtensionConfigurator.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/BaseServiceModuleExtensionConfigurator.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Threading; +using Volo.Abp.Threading; namespace BaseService { diff --git a/code/src/Modules/BaseService/BaseService.Domain/Localization/BaseServiceResource.cs b/code/src/Modules/BaseService/BaseService.Domain/Localization/BaseServiceResource.cs index b9dbf58d..f0cd9a29 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/Localization/BaseServiceResource.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/Localization/BaseServiceResource.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Localization; +using Volo.Abp.Localization; namespace BaseService.Localization { diff --git a/code/src/Modules/BaseService/BaseService.Domain/RelationBaseData/BranchRole.cs b/code/src/Modules/BaseService/BaseService.Domain/RelationBaseData/BranchRole.cs index cf674132..3bf2849e 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/RelationBaseData/BranchRole.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/RelationBaseData/BranchRole.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; -using System.Text; +using System; using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; namespace BaseService.RelationBaseData { public class BranchRole : CreationAuditedEntity { - + /// /// Id of the Role. /// @@ -31,7 +27,7 @@ namespace BaseService.RelationBaseData /// /// Initializes a new instance of the BranchRole/> class. /// - + /// Id of the Role. /// Id of the Branch/>. public BranchRole(Guid roleId, Guid branchId) diff --git a/code/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs b/code/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs index 625c0ff1..b02b8613 100644 --- a/code/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs +++ b/code/src/Modules/BaseService/BaseService.Domain/Users/AppUser.cs @@ -1,4 +1,4 @@ -using System; +using System; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Users; @@ -32,7 +32,6 @@ namespace BaseService.Users #endregion - //public Guid BranchId { get; set; } //public bool Enable { get; set; } diff --git a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseDbContextModelCreatingExtensions.cs b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseDbContextModelCreatingExtensions.cs index 8fd4eb56..54e17bd7 100644 --- a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseDbContextModelCreatingExtensions.cs @@ -1,4 +1,4 @@ - + using BaseService.BaseData; using BaseService.RelationBaseData; using Microsoft.EntityFrameworkCore; @@ -26,7 +26,6 @@ namespace BaseService.EntityFrameworkCore b.HasIndex(q => q.Pid); }); - builder.Entity(b => { b.ToTable("base_user_branches"); @@ -34,9 +33,6 @@ namespace BaseService.EntityFrameworkCore b.OwnsMany(p => p.Roles).ToTable("base_user_branch_role"); }); - - - //分支-角色 builder.Entity(b => { @@ -44,7 +40,7 @@ namespace BaseService.EntityFrameworkCore b.ConfigureByConvention(); - b.HasKey(ou => new { ou.BranchId, ou.RoleId }); + b.HasKey(ou => new { ou.BranchId, ou.RoleId }); //b.HasOne().WithMany().HasForeignKey(ou => ou.RoleId).IsRequired(); }); diff --git a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs index 71aa980e..6ac2f3c4 100644 --- a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs +++ b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseEfCoreEntityExtensionMappings.cs @@ -1,15 +1,9 @@ -using Microsoft.EntityFrameworkCore; -using System; -using Volo.Abp.Identity; -using Volo.Abp.ObjectExtending; using Volo.Abp.Threading; namespace BaseService.EntityFrameworkCore { public class BaseEfCoreEntityExtensionMappings { - private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); - public static void Configure() { BaseServiceModuleExtensionConfigurator.Configure(); diff --git a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceDbContext.cs b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceDbContext.cs index 16c4c5a3..1bc587d0 100644 --- a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceDbContext.cs +++ b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceDbContext.cs @@ -1,13 +1,9 @@ - + using BaseService.BaseData; using BaseService.RelationBaseData; -using BaseService.Users; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Modeling; -using Volo.Abp.Identity; -using Volo.Abp.Users.EntityFrameworkCore; namespace BaseService.EntityFrameworkCore { @@ -42,7 +38,6 @@ namespace BaseService.EntityFrameworkCore { base.OnModelCreating(builder); - //builder.Entity(b => //{ // b.ToTable(AbpIdentityDbProperties.DbTablePrefix + "Users"); //Sharing the same table "AbpUsers" with the IdentityUser diff --git a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceEntityFrameworkCoreModule.cs b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceEntityFrameworkCoreModule.cs index 0daa2d62..ffbef881 100644 --- a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceEntityFrameworkCoreModule.cs +++ b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/EntityFrameworkCore/BaseServiceEntityFrameworkCoreModule.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore.SqlServer; using Volo.Abp.Identity.EntityFrameworkCore; diff --git a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822033456_202308220001.cs b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822033456_202308220001.cs index cd5d02e0..e812eef6 100644 --- a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822033456_202308220001.cs +++ b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822033456_202308220001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace BaseService.Migrations diff --git a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822034321_2023082200001.cs b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822034321_2023082200001.cs index d46d45a6..6f6af258 100644 --- a/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822034321_2023082200001.cs +++ b/code/src/Modules/BaseService/BaseService.EntityFrameworkCore/Migrations/20230822034321_2023082200001.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace BaseService.Migrations { diff --git a/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/OrganizationController.cs b/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/OrganizationController.cs index e02abfc9..8b137891 100644 --- a/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/OrganizationController.cs +++ b/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/OrganizationController.cs @@ -1 +1 @@ - + diff --git a/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/UserBranchRoleController.cs b/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/UserBranchRoleController.cs index cf257abf..547b027c 100644 --- a/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/UserBranchRoleController.cs +++ b/code/src/Modules/BaseService/BaseService.HttpApi/BaseData/UserBranchRoleController.cs @@ -1,4 +1,4 @@ -//using BaseService.Controllers; +//using BaseService.Controllers; //using Microsoft.AspNetCore.Mvc; //using System; //using System.Collections.Generic; diff --git a/code/src/Modules/BaseService/BaseService.HttpApi/BaseServiceHttpApiModule.cs b/code/src/Modules/BaseService/BaseService.HttpApi/BaseServiceHttpApiModule.cs index 2975081b..b6e89bb5 100644 --- a/code/src/Modules/BaseService/BaseService.HttpApi/BaseServiceHttpApiModule.cs +++ b/code/src/Modules/BaseService/BaseService.HttpApi/BaseServiceHttpApiModule.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Modularity; diff --git a/code/src/Modules/BaseService/BaseService.HttpApi/Controllers/BaseServiceController.cs b/code/src/Modules/BaseService/BaseService.HttpApi/Controllers/BaseServiceController.cs index 625d8284..75782ef6 100644 --- a/code/src/Modules/BaseService/BaseService.HttpApi/Controllers/BaseServiceController.cs +++ b/code/src/Modules/BaseService/BaseService.HttpApi/Controllers/BaseServiceController.cs @@ -1,4 +1,4 @@ -using BaseService.Localization; +using BaseService.Localization; using Volo.Abp.AspNetCore.Mvc; namespace BaseService.Controllers diff --git a/code/src/Modules/BaseService/BaseService.HttpApi/Systems/UserController.cs b/code/src/Modules/BaseService/BaseService.HttpApi/Systems/UserController.cs index 8f37f7f2..cb51d0b7 100644 --- a/code/src/Modules/BaseService/BaseService.HttpApi/Systems/UserController.cs +++ b/code/src/Modules/BaseService/BaseService.HttpApi/Systems/UserController.cs @@ -1,4 +1,4 @@ -//using BaseService.Controllers; +//using BaseService.Controllers; //using BaseService.Systems.UserManagement; //using Microsoft.AspNetCore.Mvc; //using System; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerDataSeeder.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerDataSeeder.cs index 4007ab31..e06e4e10 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerDataSeeder.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerDataSeeder.cs @@ -1,7 +1,6 @@ -using IdentityServer4.Models; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; using System.Threading.Tasks; +using IdentityServer4.Models; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; @@ -47,22 +46,22 @@ namespace AuthServer.Host [UnitOfWork] public virtual async Task SeedAsync(DataSeedContext context) { - await _identityResourceDataSeeder.CreateStandardResourcesAsync(); - await CreateApiResourcesAsync(); - await CreateApiScopesAsync(); - await CreateClientsAsync(); + await _identityResourceDataSeeder.CreateStandardResourcesAsync().ConfigureAwait(false); + await CreateApiResourcesAsync().ConfigureAwait(false); + await CreateApiScopesAsync().ConfigureAwait(false); + await CreateClientsAsync().ConfigureAwait(false); } private async Task CreateApiScopesAsync() { - await CreateApiScopeAsync("BaseService"); - await CreateApiScopeAsync("InternalGateway"); - await CreateApiScopeAsync("WebAppGateway"); - await CreateApiScopeAsync("TenantService"); - await CreateApiScopeAsync("BusinessService"); - await CreateApiScopeAsync("FileStorageService"); - await CreateApiScopeAsync("IdentityService"); - await CreateApiScopeAsync("SettleAccount"); + await CreateApiScopeAsync("BaseService").ConfigureAwait(false); + await CreateApiScopeAsync("InternalGateway").ConfigureAwait(false); + await CreateApiScopeAsync("WebAppGateway").ConfigureAwait(false); + await CreateApiScopeAsync("TenantService").ConfigureAwait(false); + await CreateApiScopeAsync("BusinessService").ConfigureAwait(false); + await CreateApiScopeAsync("FileStorageService").ConfigureAwait(false); + await CreateApiScopeAsync("IdentityService").ConfigureAwait(false); + await CreateApiScopeAsync("SettleAccount").ConfigureAwait(false); } private async Task CreateApiResourcesAsync() @@ -77,19 +76,19 @@ namespace AuthServer.Host "phone_number_verified", "role" }; - await CreateApiResourceAsync("IdentityService", commonApiUserClaims); - await CreateApiResourceAsync("BaseService", commonApiUserClaims); - await CreateApiResourceAsync("InternalGateway", commonApiUserClaims); - await CreateApiResourceAsync("WebAppGateway", commonApiUserClaims); - await CreateApiResourceAsync("TenantService", commonApiUserClaims); - await CreateApiResourceAsync("BusinessService", commonApiUserClaims); - await CreateApiResourceAsync("FileStorageService", commonApiUserClaims); - await CreateApiResourceAsync("SettleAccount", commonApiUserClaims); + await CreateApiResourceAsync("IdentityService", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("BaseService", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("InternalGateway", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("WebAppGateway", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("TenantService", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("BusinessService", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("FileStorageService", commonApiUserClaims).ConfigureAwait(false); + await CreateApiResourceAsync("SettleAccount", commonApiUserClaims).ConfigureAwait(false); } private async Task CreateApiResourceAsync(string name, IEnumerable claims) { - var apiResource = await _apiResourceRepository.FindByNameAsync(name); + var apiResource = await _apiResourceRepository.FindByNameAsync(name).ConfigureAwait(false); if (apiResource == null) { apiResource = await _apiResourceRepository.InsertAsync( @@ -99,7 +98,7 @@ namespace AuthServer.Host name + " API" ), autoSave: true - ); + ).ConfigureAwait(false); } foreach (var claim in claims) @@ -110,12 +109,12 @@ namespace AuthServer.Host } } - return await _apiResourceRepository.UpdateAsync(apiResource); + return await _apiResourceRepository.UpdateAsync(apiResource).ConfigureAwait(false); } private async Task CreateApiScopeAsync(string name) { - var apiScope = await _apiScopeRepository.GetByNameAsync(name); + var apiScope = await _apiScopeRepository.GetByNameAsync(name).ConfigureAwait(false); if (apiScope == null) { apiScope = await _apiScopeRepository.InsertAsync( @@ -125,7 +124,7 @@ namespace AuthServer.Host name + " API" ), autoSave: true - ); + ).ConfigureAwait(false); } return apiScope; @@ -150,7 +149,7 @@ namespace AuthServer.Host new[] { "IdentityService", "BaseService", "WebAppGateway", "FileStorageService", "TenantService", "BusinessService", "SettleAccount" }, new[] { "password" }, "1q2w3e*".Sha256() - ); + ).ConfigureAwait(false); //BaseDataService await CreateClientAsync( @@ -159,7 +158,7 @@ namespace AuthServer.Host new[] { "client_credentials" }, "1q2w3e*".Sha256(), permissions: new[] { IdentityPermissions.Users.Default } - ); + ).ConfigureAwait(false); //FileStorge await CreateClientAsync( "file-app", @@ -167,7 +166,7 @@ namespace AuthServer.Host new[] { "client_credentials" }, "1q2w3e*".Sha256(), permissions: new[] { IdentityPermissions.Users.Default } - ); + ).ConfigureAwait(false); } private async Task CreateClientAsync( @@ -179,7 +178,7 @@ namespace AuthServer.Host string postLogoutRedirectUri = null, IEnumerable permissions = null) { - var client = await _clientRepository.FindByClientIdAsync(name); + var client = await _clientRepository.FindByClientIdAsync(name).ConfigureAwait(false); if (client == null) { client = await _clientRepository.InsertAsync( @@ -200,7 +199,7 @@ namespace AuthServer.Host RequireConsent = false }, autoSave: true - ); + ).ConfigureAwait(false); } foreach (var scope in scopes) @@ -246,10 +245,10 @@ namespace AuthServer.Host ClientPermissionValueProvider.ProviderName, name, permissions - ); + ).ConfigureAwait(false); } - return await _clientRepository.UpdateAsync(client); + return await _clientRepository.UpdateAsync(client).ConfigureAwait(false); } } } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs index c7f6e4bb..ecd8ebba 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/AuthServerHostModule.cs @@ -1,11 +1,6 @@ using AuthServer.Host.EntityFrameworkCore; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Cors; -using Microsoft.AspNetCore.DataProtection; using Microsoft.Extensions.DependencyInjection; -using StackExchange.Redis; -using System; -using System.Linq; using Volo.Abp; using Volo.Abp.Account; using Volo.Abp.Account.Web; @@ -116,7 +111,7 @@ namespace AuthServer.Host { await scope.ServiceProvider .GetRequiredService() - .SeedAsync(); + .SeedAsync().ConfigureAwait(false); } }); } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContext.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContext.cs index 6f577a0b..9eba6205 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContext.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContext.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContextFactory.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContextFactory.cs index 2a001134..b60e31c9 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContextFactory.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/AuthServer/EntityFrameworkCore/AuthServerDbContextFactory.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs index 478eac50..6cdf124d 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/BaseServiceHostModule.cs @@ -1,17 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Claims; using BaseService.EntityFrameworkCore; -using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Cors; -using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Identity; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.OpenApi.Models; -using StackExchange.Redis; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; using Volo.Abp; using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.Mvc; @@ -112,28 +107,6 @@ namespace BaseService }); } - private static void ConfigureCros(ServiceConfigurationContext context, IConfiguration configuration) - { - context.Services.AddCors(options => - { - options.AddPolicy(DefaultCorsPolicyName, builder => - { - builder - .WithOrigins( - configuration["App:CorsOrigins"] - .Split(",", StringSplitOptions.RemoveEmptyEntries) - .Select(o => o.RemovePostFix("/")) - .ToArray() - ) - .WithAbpExposedHeaders() - .SetIsOriginAllowedToAllowWildcardSubdomains() - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials(); - }); - }); - } - private void ConfigureAuditing() { Configure(options => @@ -160,35 +133,6 @@ namespace BaseService Configure(options => { options.UseSqlServer(); }); } - private static void ConfigureSwagger(ServiceConfigurationContext context) - { - context.Services.AddSwaggerGen(options => - { - options.SwaggerDoc("v1", new OpenApiInfo { Title = "BaseService Service API", Version = "v1" }); - options.DocInclusionPredicate((docName, description) => true); - options.CustomSchemaIds(type => type.FullName); - options.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme - { - Description = "请输入 JWT Token", - Name = "Authorization", - In = ParameterLocation.Header, - Type = SecuritySchemeType.Http, - Scheme = "Bearer" - }); - - options.AddSecurityRequirement(new OpenApiSecurityRequirement() - { - { - new OpenApiSecurityScheme - { - Reference = new OpenApiReference {Type = ReferenceType.SecurityScheme, Id = "Bearer"} - }, - new string[] { } - } - }); - }); - } - private static void ConfigureJwt(ServiceConfigurationContext context, IConfiguration configuration) { //context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) @@ -217,7 +161,7 @@ namespace BaseService .ConventionalControllers .Create(typeof(BaseServiceApplicationModule).Assembly, opts => - { opts.RootPath = "base"; }) + { opts.RootPath = "base"; }) ; }); } @@ -243,9 +187,9 @@ namespace BaseService { "email", AbpClaimTypes.Email }, { "name", AbpClaimTypes.UserName }, }; - var mapClaims = currentPrincipalAccessor.Principal.Claims.Where(p => map.Keys.Contains(p.Type)).ToList(); + var mapClaims = currentPrincipalAccessor.Principal.Claims.Where(p => map.ContainsKey(p.Type)).ToList(); currentPrincipalAccessor.Principal.AddIdentity(new ClaimsIdentity(mapClaims.Select(p => new Claim(map[p.Type], p.Value, p.ValueType, p.Issuer)))); - await next(); + await next().ConfigureAwait(false); }); app.UseAbpRequestLocalization(); @@ -266,7 +210,7 @@ namespace BaseService { await scope.ServiceProvider .GetRequiredService() - .SeedAsync(); + .SeedAsync().ConfigureAwait(false); } }); } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs index dfd38404..be335275 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Exception.cs @@ -1,14 +1,4 @@ -using Microsoft.AspNetCore.Mvc.Filters; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.AspNetCore.Mvc.ExceptionHandling; -using Volo.Abp.Authorization; -using Volo.Abp.Validation; - namespace Win.Sfs.SettleAccount { - - - } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs index 679ab321..8e90d366 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Program.cs @@ -4,56 +4,57 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; using Serilog; -namespace Win.Sfs.SettleAccount; - -public class Program +namespace Win.Sfs.SettleAccount { - public static int Main(string[] args) + public class Program { - var configuration = new ConfigurationBuilder() - .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) - .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true) - .Build(); + public static int Main(string[] args) + { + var configuration = new ConfigurationBuilder() + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) + .AddJsonFile($"appsettings.{Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT")}.json", optional: true, reloadOnChange: true) + .Build(); - Log.Logger = new LoggerConfiguration() - .WriteTo.Async(c => c.Console()) - .WriteTo.Async(c => c.File("Logs/logs.txt" - , rollingInterval: RollingInterval.Day - , rollOnFileSizeLimit: true - , fileSizeLimitBytes: 30 * 1024 * 1024)) - .CreateLogger(); + Log.Logger = new LoggerConfiguration() + .WriteTo.Async(c => c.Console()) + .WriteTo.Async(c => c.File("Logs/logs.txt" + , rollingInterval: RollingInterval.Day + , rollOnFileSizeLimit: true + , fileSizeLimitBytes: 30 * 1024 * 1024)) + .CreateLogger(); - try - { - Log.Information("Starting web host."); - CreateHostBuilder(args).UseSerilog().Build().Run(); - return 0; - } - catch (Exception ex) - { - Log.Fatal(ex, "Host terminated unexpectedly!"); - return 1; - } - finally - { - Log.CloseAndFlush(); + try + { + Log.Information("Starting web host."); + CreateHostBuilder(args).UseSerilog().Build().Run(); + return 0; + } + catch (Exception ex) + { + Log.Fatal(ex, "Host terminated unexpectedly!"); + return 1; + } + finally + { + Log.CloseAndFlush(); + } } - } - internal static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.ConfigureKestrel((context, options) => + internal static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => { - //设置应用服务器Kestrel请求体最大为50MB - options.Limits.MaxRequestBodySize = long.MaxValue; - options.Limits.MaxRequestBufferSize = long.MaxValue; - options.Limits.MaxRequestLineSize = int.MaxValue; - options.Limits.KeepAliveTimeout = TimeSpan.MaxValue; - }); - webBuilder.UseStartup(); - }) - .UseAutofac() - .UseSerilog(); + webBuilder.ConfigureKestrel((context, options) => + { + //设置应用服务器Kestrel请求体最大为50MB + options.Limits.MaxRequestBodySize = long.MaxValue; + options.Limits.MaxRequestBufferSize = long.MaxValue; + options.Limits.MaxRequestLineSize = int.MaxValue; + options.Limits.KeepAliveTimeout = TimeSpan.MaxValue; + }); + webBuilder.UseStartup(); + }) + .UseAutofac() + .UseSerilog(); + } } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs index 3c7a6c92..f0dbc377 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccountHttpApiHostModule.cs @@ -7,13 +7,11 @@ using BaseService; using Hangfire; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; using Microsoft.OpenApi.Models; using Swashbuckle.AspNetCore.SwaggerUI; @@ -37,8 +35,6 @@ using Volo.Abp.MultiTenancy; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.Threading; -using Volo.Abp.VirtualFileSystem; -using Win.Sfs.SettleAccount.ImportExcelCommon; using Win.Sfs.Shared.Constant; using Win.Utils; @@ -197,52 +193,6 @@ namespace Win.Sfs.SettleAccount }); } - /// - /// 大众-存储二配实际输出表 - /// - /// - private void ConfigureBLOBSecSummaryServices(IConfiguration configPath) - { - Configure(options => - { - options.Containers.Configure(configuration => - { - configuration.UseFileSystem(fileSystem => - { - var filestreampath = Environment.CurrentDirectory + @"\wwwroot\secsummary\files"; - if (!Directory.Exists(filestreampath)) - { - Directory.CreateDirectory(filestreampath); - } - fileSystem.BasePath = filestreampath; - }); - }); - }); - } - - /// - /// 奔腾-二配实际输出打印表的保存路径 - /// - /// - private void ConfigureBLOBTSecSummaryServices(IConfiguration configPath) - { - Configure(options => - { - options.Containers.Configure(configuration => - { - configuration.UseFileSystem(fileSystem => - { - var filestreampath = Environment.CurrentDirectory + @"\wwwroot\btsecsummary\files"; - if (!Directory.Exists(filestreampath)) - { - Directory.CreateDirectory(filestreampath); - } - fileSystem.BasePath = filestreampath; - }); - }); - }); - } - private static void ConfigureJson(ServiceConfigurationContext context) { //null: DTO的属性首字母保持大写 @@ -299,21 +249,6 @@ namespace Win.Sfs.SettleAccount }); } - private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) - { - var hostingEnvironment = context.Services.GetHostingEnvironment(); - - if (hostingEnvironment.IsDevelopment()) - { - Configure(options => - { - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}SettleAccount.Domain")); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}SettleAccount.Application.Contracts")); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}SettleAccount.Application")); - }); - } - } - private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) { var isAlwaysAllowAuthorization = configuration.GetValue("AuthServer:AlwaysAllowAuthorization"); @@ -381,7 +316,7 @@ namespace Win.Sfs.SettleAccount { Reference = new OpenApiReference {Type = ReferenceType.SecurityScheme, Id = "Bearer"} }, - new string[] { } + Array.Empty() } }); }); @@ -427,28 +362,6 @@ namespace Win.Sfs.SettleAccount }); } - private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration) - { - context.Services.AddCors(options => - { - options.AddPolicy(DefaultCorsPolicyName, builder => - { - builder - .WithOrigins( - configuration["App:CorsOrigins"] - .Split(",", StringSplitOptions.RemoveEmptyEntries) - .Select(o => o.RemovePostFix("/")) - .ToArray() - ) - .WithAbpExposedHeaders() - .SetIsOriginAllowedToAllowWildcardSubdomains() - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials(); - }); - }); - } - public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); @@ -482,7 +395,7 @@ namespace Win.Sfs.SettleAccount { await scope.ServiceProvider .GetRequiredService() - .SeedAsync(); + .SeedAsync().ConfigureAwait(false); } }); } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs index 1c6494da..7c0464ce 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs @@ -19,85 +19,86 @@ using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.ExcelImporter; -namespace Win.Sfs.SettleAccount; - -public class Startup +namespace Win.Sfs.SettleAccount { - public Startup(IConfiguration configuration) + public class Startup { - Configuration = configuration; - } + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } - public IConfiguration Configuration { get; } + public IConfiguration Configuration { get; } - public void ConfigureServices(IServiceCollection services) - { - services.Configure(options => options.Level = CompressionLevel.Fastest); - services.AddResponseCompression(options => - { - options.EnableForHttps = true; - options.Providers.Add(); - options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" }); - }); - services.AddScheduler(); - services.AddCors(options => + public void ConfigureServices(IServiceCollection services) { - options.AddPolicy("Default", builder => + services.Configure(options => options.Level = CompressionLevel.Fastest); + services.AddResponseCompression(options => { - builder.SetIsOriginAllowed(isOriginAllowed => true) - .AllowAnyMethod() - .AllowAnyHeader() - .AllowCredentials(); + options.EnableForHttps = true; + options.Providers.Add(); + options.MimeTypes = ResponseCompressionDefaults.MimeTypes.Concat(new[] { "image/svg+xml" }); }); - }); - services.AddSingleton(); - services.AddSingleton(); - services.AddSignalR(o => o.EnableDetailedErrors = true); - JobHostdService.AddService(services); - services.AddSingleton(); - services.AddHostedService(o => o.GetRequiredService()); - services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); - services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); - services.AddApplication(); - services.Configure(options => - { - // Set the limit to 256 MB - options.Limits.MaxRequestBodySize = 268435456; - }); - //上传文件大小限制IIS设置 - services.Configure(options => - { - options.MaxRequestBodySize = 268435456; - options.AllowSynchronousIO = true; - }); - } + services.AddScheduler(); + services.AddCors(options => + { + options.AddPolicy("Default", builder => + { + builder.SetIsOriginAllowed(isOriginAllowed => true) + .AllowAnyMethod() + .AllowAnyHeader() + .AllowCredentials(); + }); + }); + services.AddSingleton(); + services.AddSingleton(); + services.AddSignalR(o => o.EnableDetailedErrors = true); + JobHostdService.AddService(services); + services.AddSingleton(); + services.AddHostedService(o => o.GetRequiredService()); + services.AddRouting(options => options.ConstraintMap["slugify"] = typeof(SlugifyParameterTransformer)); + services.AddMvc(options => options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer()))); + services.AddApplication(); + services.Configure(options => + { + // Set the limit to 256 MB + options.Limits.MaxRequestBodySize = 268435456; + }); + //上传文件大小限制IIS设置 + services.Configure(options => + { + options.MaxRequestBodySize = 268435456; + options.AllowSynchronousIO = true; + }); + } - public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) - { - ExportImporter.ServiceProvider = app.ApplicationServices; - app.UseCors("Default"); - app.UseResponseCompression(); - app.UseRouting(); - app.UseEndpoints(endpoints => endpoints.MapHub("/api/hub")); - app.ApplicationServices.UseScheduler(scheduler => + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { - scheduler.Schedule().EveryMinute(); - scheduler.Schedule().EveryMinute(); - }); - var contentTypeProvider = new FileExtensionContentTypeProvider(); - contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); - app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider }); - app.InitializeApplication(); - } + ExportImporter.ServiceProvider = app.ApplicationServices; + app.UseCors("Default"); + app.UseResponseCompression(); + app.UseRouting(); + app.UseEndpoints(endpoints => endpoints.MapHub("/api/hub")); + app.ApplicationServices.UseScheduler(scheduler => + { + scheduler.Schedule().EveryMinute(); + scheduler.Schedule().EveryMinute(); + }); + var contentTypeProvider = new FileExtensionContentTypeProvider(); + contentTypeProvider.Mappings.Add(".mjs", "text/javascript"); + app.UseStaticFiles(new StaticFileOptions { ContentTypeProvider = contentTypeProvider }); + app.InitializeApplication(); + } - public class SlugifyParameterTransformer : IOutboundParameterTransformer - { - public string TransformOutbound(object value) + public class SlugifyParameterTransformer : IOutboundParameterTransformer { - if (value == null) { return null; } - var str = value.ToString(); - if (string.IsNullOrEmpty(str)) { return null; } - return Regex.Replace(str?.ToString(), "([a-z])([A-Z])", "$1-$2").ToLowerInvariant(); + public string TransformOutbound(object value) + { + if (value == null) { return null; } + var str = value.ToString(); + if (string.IsNullOrEmpty(str)) { return null; } + return Regex.Replace(str?.ToString(), "([a-z])([A-Z])", "$1-$2").ToLowerInvariant(); + } } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs index c0f8a911..a892b4cb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Attributes/ExcelImporterHeadDescAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Win.Sfs.SettleAccount.Attributes { @@ -12,7 +12,7 @@ namespace Win.Sfs.SettleAccount.Attributes /// 行数 /// public int Row { get; set; } - + /// /// 列数 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Bases/RequestInputBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Bases/RequestInputBase.cs index 9e1496a0..59629f7f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Bases/RequestInputBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Bases/RequestInputBase.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Bases { - public class RequestInputBase: PagedAndSortedResultRequestDto + public class RequestInputBase : PagedAndSortedResultRequestDto { /// /// 导出文件类型 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs index d4dd2911..a52905aa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_CAN_SA_DTO.cs @@ -1,13 +1,8 @@ -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 Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { @@ -49,13 +44,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "下线日期")] //全部业务都显示 public DateTime SettleDate { get; set; } [ExporterHeader(DisplayName = "发票号")] //全部业务都显示 - public string InvBillNum { get; set; } + public string InvBillNum { get; set; } [ExporterHeader(DisplayName = "客户零件号")] //全部业务都显示 public string LU { get; set; } [ExporterHeader(DisplayName = "厂内零件号")] //全部业务都显示 (查询条件) public string PartCode { get; set; } [ExporterHeader(DisplayName = "零件描述")] //全部业务都显示 - public string MaterialDesc { get; set; } + public string MaterialDesc { get; set; } [ExporterHeader(DisplayName = "生产码")] //全部业务都显示 JIS业务叫生产码,其他业务叫标识号 (查询条件) public string PN { get; set; } [ExporterHeader(DisplayName = "结算数量")] //全部业务都显示 @@ -70,7 +65,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "SA号")] public string ContractDocID { set; get; } - /// /// 版本 /// @@ -82,7 +76,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// /// 结算单号(发票分组号) /// - + public string InvGroupNum { get; set; } /// /// 金额 @@ -92,7 +86,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public class BBAC_CAN_SA_DETAIL_EXP_DTO { - [ExporterHeader(DisplayName = "关联结算单号")] //全部业务都有显示 public string SettleBillNum { get; set; } [ExporterHeader(DisplayName = "发票分组号")] //全部业务都显示 (默认) @@ -183,24 +176,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public class BBAC_CAN_SA_DETAIL_REQ_DTO : RequestInputBase { - //[Display(Name = "发票分组号")] //public string BillNum { get; set; } - - + //[Display(Name = "LU")] //public string LU { get; set; } //[Display(Name = "生产码")] //public string PN { get; set; } - + //[Display(Name = "结算数量")] //public decimal Qty { get; set; } //[Display(Name = "结算分组号")] //public string GroupNum { get; set; } - - } - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs index 2894400f..5845e3a0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_NOT_SA_DTO.cs @@ -1,17 +1,11 @@ -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 Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { - + public class BBAC_NOT_SA_DETAIL_DTO : EntityDto { /// @@ -21,8 +15,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// ///工厂地点 /// - - public string Site { get; set; } + + public string Site { get; set; } /// /// 版本 /// @@ -65,9 +59,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string PartCode { get; set; } - - - } public class BBAC_NOT_SA_DETAIL_EXP_DTO { @@ -110,7 +101,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "物料描述")] public string MaterialDesc { get; set; } - [ExporterHeader(DisplayName = "生产码")] public string PN { get; set; } public string KeyCode { get; set; } @@ -130,7 +120,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos //[Display(Name = "关联结算单号")] //public string SettleBillNum { get; set; } - + ////[Display(Name = "业务类别")] ////public string Category { get; set; } ////[Display(Name = "是否退货")] @@ -159,9 +149,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos //[Display(Name = "结算分组号")] //public string GroupNum { get; set; } - - } - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs index 38f59960..6075dff5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_PD_DTO.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { @@ -39,12 +37,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "地点")] public string Site { get; set; } - - [Display(Name="状态")] + [Display(Name = "状态")] public EnumBillState State { set; get; } - - } public class BBAC_PD_EXP_DTO { @@ -142,8 +137,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 替换生产码 /// public string REPN { get; set; } - - + /// /// 客户零件号 /// @@ -240,9 +234,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string BillNum { get; set; } - } } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs index fd220de2..b1e1669e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SA_DTO.cs @@ -1,239 +1,238 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; using Magicodes.ExporterAndImporter.Core; using Microsoft.AspNetCore.Http; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// BBAC结算单 -/// -public class BBAC_SA_DTO : EntityDto -{ - /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - - /// - /// 结算单据 - /// - [Display(Name = "结算单据")] - public string BillNum { get; set; } - - /// - /// 出库单号 - /// - [Display(Name = "出库单号")] - public string DNBillNum { get; set; } - - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public string State { get; set; } - - /// - /// 明细记录行数 - /// - [Display(Name = "明细记录行数")] - public string RecordCount { get; set; } - - /// - /// 工厂地点 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } - - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumBusinessType BusinessType { get; set; } -} - -/// -/// BBAC结算明细 -/// -public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot -{ - /// - /// 结算单 - /// - public string BillNum { set; get; } - /// - /// 期间 - /// - public int Version { set; get; } - /// - /// 结算分组号 - /// - public string GroupNum { get; set; } - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 客户物料号 - /// - public string LU { get; set; } - /// - /// 数量 - /// - public string Qty { get; set; } - /// - /// 结算日期 - /// - public string SettleDate { set; get; } - /// - /// 单价 - /// - public decimal Price { set; get; } - /// - /// 厂内物料号 - /// - public string PartCode { get; set; } -} - -/// -/// BBAC结算导入请求 -/// -public class BBACSaImportRequestDto -{ - /// - /// 文件 - /// - public IFormFileCollection Files { get; set; } - /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - [Required(ErrorMessage = "{0}必须填写")] - public string Site { get; set; } -} - -/// -/// BBAC结算明细导入 -/// -[Importer(HeaderRowIndex = 3)] -public class BBAC_SA_DETAIL_IMPORT_DTO -{ - /// - /// 结算日期 - /// - [Display(Name = "Posting Date")] - [ImporterHeader(Name = "Posting Date")] - public string SettleDate { set; get; } - /// - /// 结算分组号 - /// - [Display(Name = "Reference")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "Reference")] - public string GroupNum { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "Material")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "Material")] - public string LU { get; set; } - /// - /// 数量 - /// - [Display(Name = "结算数量")] - [ImporterHeader(Name = "GR Quantity")] - public decimal Qty { get; set; } - /// - /// 生产号 - /// - [Display(Name = "External Call Number")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "External Call Number")] - public string PN { get; set; } - /// - /// Movement Type - /// MovementType = 967,代表退货需要标记为负数 - /// MovementType = 966,代表正常发货标记正数 - /// - [Display(Name = "Movement Type")] - [ImporterHeader(Name = "Movement Type")] - public string MovementType { get; set; } - /// - /// Contract Doc ID - /// - [Display(Name = "Contract Doc ID")] - [ImporterHeader(Name = "Contract Doc ID")] - public string ContractDocID { get; set; } -} - -/// -/// 结算明细导出请求 -/// -public class BBAC_SA_DETAIL_EXPORT_REQUEST_DTO -{ - /// - /// 结算单号 - /// - [Display(Name = "结算单号")] - [Required(ErrorMessage = "{0}不能为空")] - public string BillNum { set; get; } -} - -/// -/// 结算明细导出 -/// -public class BBAC_SA_DETAIL_EXPORT_DTO +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 结算单号 - /// - [Display(Name = "结算单号")] - [ExporterHeader(DisplayName = "结算单号")] - public string BillNum { set; get; } - - /// - /// 结算日期 - /// - [Display(Name = "结算日期")] - [ExporterHeader(DisplayName = "结算日期")] - public DateTime SettleDate { set; get; } - - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - [ExporterHeader(DisplayName = "发货单号")] - public string PN { get; set; } - - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "零件号")] - public string LU { get; set; } - - /// - /// 数量 - /// - [Display(Name = "数量")] - [ExporterHeader(DisplayName = "数量")] - public decimal Qty { get; set; } - - /// - /// 结算分组 - /// - [Display(Name = "结算分组")] - [ExporterHeader(DisplayName = "结算分组")] - public string GroupNum { get; set; } + /// BBAC结算单 + /// + public class BBAC_SA_DTO : EntityDto + { + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + + /// + /// 结算单据 + /// + [Display(Name = "结算单据")] + public string BillNum { get; set; } + + /// + /// 出库单号 + /// + [Display(Name = "出库单号")] + public string DNBillNum { get; set; } + + /// + /// 1、新建 2、已有出库3、已有扣减寄售库 + /// + [Display(Name = "状态")] + public string State { get; set; } + + /// + /// 明细记录行数 + /// + [Display(Name = "明细记录行数")] + public string RecordCount { get; set; } + + /// + /// 工厂地点 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } + + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumBusinessType BusinessType { get; set; } + } + + /// + /// BBAC结算明细 + /// + public class BBAC_SA_DETAIL_DTO : AuditedAggregateRoot + { + /// + /// 结算单 + /// + public string BillNum { set; get; } + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 结算分组号 + /// + public string GroupNum { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 客户物料号 + /// + public string LU { get; set; } + /// + /// 数量 + /// + public string Qty { get; set; } + /// + /// 结算日期 + /// + public string SettleDate { set; get; } + /// + /// 单价 + /// + public decimal Price { set; get; } + /// + /// 厂内物料号 + /// + public string PartCode { get; set; } + } + + /// + /// BBAC结算导入请求 + /// + public class BBACSaImportRequestDto + { + /// + /// 文件 + /// + public IFormFileCollection Files { get; set; } + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [Required(ErrorMessage = "{0}必须填写")] + public string Site { get; set; } + } + + /// + /// BBAC结算明细导入 + /// + [Importer(HeaderRowIndex = 3)] + public class BBAC_SA_DETAIL_IMPORT_DTO + { + /// + /// 结算日期 + /// + [Display(Name = "Posting Date")] + [ImporterHeader(Name = "Posting Date")] + public string SettleDate { set; get; } + /// + /// 结算分组号 + /// + [Display(Name = "Reference")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "Reference")] + public string GroupNum { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "Material")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "Material")] + public string LU { get; set; } + /// + /// 数量 + /// + [Display(Name = "结算数量")] + [ImporterHeader(Name = "GR Quantity")] + public decimal Qty { get; set; } + /// + /// 生产号 + /// + [Display(Name = "External Call Number")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "External Call Number")] + public string PN { get; set; } + /// + /// Movement Type + /// MovementType = 967,代表退货需要标记为负数 + /// MovementType = 966,代表正常发货标记正数 + /// + [Display(Name = "Movement Type")] + [ImporterHeader(Name = "Movement Type")] + public string MovementType { get; set; } + /// + /// Contract Doc ID + /// + [Display(Name = "Contract Doc ID")] + [ImporterHeader(Name = "Contract Doc ID")] + public string ContractDocID { get; set; } + } + + /// + /// 结算明细导出请求 + /// + public class BBAC_SA_DETAIL_EXPORT_REQUEST_DTO + { + /// + /// 结算单号 + /// + [Display(Name = "结算单号")] + [Required(ErrorMessage = "{0}不能为空")] + public string BillNum { set; get; } + } + + /// + /// 结算明细导出 + /// + public class BBAC_SA_DETAIL_EXPORT_DTO + { + /// + /// 结算单号 + /// + [Display(Name = "结算单号")] + [ExporterHeader(DisplayName = "结算单号")] + public string BillNum { set; get; } + + /// + /// 结算日期 + /// + [Display(Name = "结算日期")] + [ExporterHeader(DisplayName = "结算日期")] + public DateTime SettleDate { set; get; } + + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + [ExporterHeader(DisplayName = "发货单号")] + public string PN { get; set; } + + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "零件号")] + public string LU { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { get; set; } + + /// + /// 结算分组 + /// + [Display(Name = "结算分组")] + [ExporterHeader(DisplayName = "结算分组")] + public string GroupNum { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs index 89f9ae0d..4f272903 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs @@ -1,436 +1,437 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// BBAC发运 -/// -public class BBAC_SE_DETAIL_DTO : EntityDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 期间 - /// - public int Version { set; get; } - /// - /// 发货时间 - /// - public DateTime ShippingDate { set; get; } - /// - /// 发运单号 - /// - public string WmsBillNum { set; get; } - /// - /// 客户零件号 - /// - public string LU { get; set; } - /// - /// 厂内零件号 - /// - public string FactoryPartCode { get; set; } - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 组合键值(PN+LU) - /// - public string KeyCode { get; set; } - /// - /// 数量 - /// - public decimal Qty { get; set; } - /// - /// UID - /// - [Display(Name = "UID")] - [DisplayName("UID")] - public long UID { get; set; } - /// - /// JIT订单号 - /// - [Display(Name = "JIT订单号")] - [DisplayName("JIT订单号")] - public string JISNum { get; set; } - /// - /// JIT排序生产码 - /// - [Display(Name = "JIT排序生产码")] - public string VinCode { get; set; } - /// - /// JIT排序生产码类型 - /// - [Display(Name = "JIT排序生产码类型")] - public string CodeType { get; set; } - /// - /// 订单零件号 - /// - [Display(Name = "订单零件号")] - public string PartCode { get; set; } - /// - /// 订单零件号 - /// - [Display(Name = "订单零件号")] - public string RealPartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - public string Batch { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - public string CustPartCode { get; set; } - /// - /// 订单序号 - /// - [Display(Name = "订单序号")] - public string Seq { get; set; } - /// - /// 订单时间 - /// - [Display(Name = "订单时间")] - public DateTime AssembleData { get; set; } - /// - /// 发货条码 - /// - [Display(Name = "发货条码")] - public string DeliverCode { get; set; } - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - public string BillNum { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - public DateTime? BillTime { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - public string Oper { get; set; } - /// - /// 客户位置 - /// - [Display(Name = "客户位置")] - public string Position { get; set; } - /// - /// 工厂 - /// - [Display(Name = "工厂")] - public string Factory { get; set; } - /// - /// MES配置码 - /// - [Display(Name = "MES配置码")] - public string MESConfigCode { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - public string ToLoc { get; set; } - /// - /// 单据类型 - /// - public EnumBillType BillType { get; set; } - /// - /// 子单据类型 - /// - [Display(Name = "子单据类型")] - public EnumSubBillType SubBillType { get; set; } - /// - /// 事务类型 - /// - [Display(Name = "事务类型")] - public EnumDelTransType TransType { get; set; } - /// - /// 发运主类型 - /// - [Display(Name = "发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } - /// - /// 发运子类型 - /// - [Display(Name = "发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } - /// - /// 单据性质 - /// - [Display(Name = "单据性质")] - public string BillCharacter { get; set; } - /// - /// 原生产码 - /// - [Display(Name = "原生产码")] - public string OrigiCode { get; set; } - /// - /// 描述 - /// - [Display(Name = "描述")] - public string PartDesc { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - public string Remark { get; set; } - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumProTpe ProType { get; set; } - /// - /// JIS排序单号 - /// - [Display(Name = "JIS排序单号")] - public string OrderNum { get; set; } - /// - /// JIS实际生产码 - /// - [Display(Name = "JIS实际生产码")] - public string RealCode { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - public string FromLoc { get; set; } - /// - /// 参照订单生产码 - /// - [Display(Name = "参照订单生产码")] - public string RefVinCode { get; set; } - /// - /// 发货关联单号 - /// - [Display(Name = "发货关联单号")] - public string RefBillNum { get; set; } - /// - /// Erp目标库位 - /// - [Display(Name = "Erp目标库位")] - public string ErpToLoc { get; set; } - /// - /// 塑件唯一码 - /// - [Display(Name = "塑件唯一码")] - public string UniqueCode { get; set; } - /// - /// PJS顺序号 - /// - [Display(Name = "PJS顺序号")] - public string PjsNum { get; set; } - /// - /// 虚拟小总成 - /// - [Display(Name = "虚拟小总成")] - public string MatchNumber { get; set; } - /// - /// 状态 - /// - [Display(Name = "状态")] - public EnumBillState State { get; set; } - /// - /// 创建时间 - /// - [Display(Name = "创建时间")] - public DateTime CreateTime { get; set; } - /// - /// 是否有EDI数据 - /// - [Display(Name = "是否有EDI数据")] - public bool IsHaveEdiData { get; set; } -} + /// BBAC发运 + /// + public class BBAC_SE_DETAIL_DTO : EntityDto + { + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 发货时间 + /// + public DateTime ShippingDate { set; get; } + /// + /// 发运单号 + /// + public string WmsBillNum { set; get; } + /// + /// 客户零件号 + /// + public string LU { get; set; } + /// + /// 厂内零件号 + /// + public string FactoryPartCode { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 组合键值(PN+LU) + /// + public string KeyCode { get; set; } + /// + /// 数量 + /// + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } + /// + /// JIT订单号 + /// + [Display(Name = "JIT订单号")] + [DisplayName("JIT订单号")] + public string JISNum { get; set; } + /// + /// JIT排序生产码 + /// + [Display(Name = "JIT排序生产码")] + public string VinCode { get; set; } + /// + /// JIT排序生产码类型 + /// + [Display(Name = "JIT排序生产码类型")] + public string CodeType { get; set; } + /// + /// 订单零件号 + /// + [Display(Name = "订单零件号")] + public string PartCode { get; set; } + /// + /// 订单零件号 + /// + [Display(Name = "订单零件号")] + public string RealPartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 订单序号 + /// + [Display(Name = "订单序号")] + public string Seq { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 发货条码 + /// + [Display(Name = "发货条码")] + public string DeliverCode { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime? BillTime { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + public string Oper { get; set; } + /// + /// 客户位置 + /// + [Display(Name = "客户位置")] + public string Position { get; set; } + /// + /// 工厂 + /// + [Display(Name = "工厂")] + public string Factory { get; set; } + /// + /// MES配置码 + /// + [Display(Name = "MES配置码")] + public string MESConfigCode { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + public string ToLoc { get; set; } + /// + /// 单据类型 + /// + public EnumBillType BillType { get; set; } + /// + /// 子单据类型 + /// + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } + /// + /// 事务类型 + /// + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } + /// + /// 发运主类型 + /// + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 单据性质 + /// + [Display(Name = "单据性质")] + public string BillCharacter { get; set; } + /// + /// 原生产码 + /// + [Display(Name = "原生产码")] + public string OrigiCode { get; set; } + /// + /// 描述 + /// + [Display(Name = "描述")] + public string PartDesc { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + public string Remark { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// JIS排序单号 + /// + [Display(Name = "JIS排序单号")] + public string OrderNum { get; set; } + /// + /// JIS实际生产码 + /// + [Display(Name = "JIS实际生产码")] + public string RealCode { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + public string FromLoc { get; set; } + /// + /// 参照订单生产码 + /// + [Display(Name = "参照订单生产码")] + public string RefVinCode { get; set; } + /// + /// 发货关联单号 + /// + [Display(Name = "发货关联单号")] + public string RefBillNum { get; set; } + /// + /// Erp目标库位 + /// + [Display(Name = "Erp目标库位")] + public string ErpToLoc { get; set; } + /// + /// 塑件唯一码 + /// + [Display(Name = "塑件唯一码")] + public string UniqueCode { get; set; } + /// + /// PJS顺序号 + /// + [Display(Name = "PJS顺序号")] + public string PjsNum { get; set; } + /// + /// 虚拟小总成 + /// + [Display(Name = "虚拟小总成")] + public string MatchNumber { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public EnumBillState State { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } + /// + /// 是否有EDI数据 + /// + [Display(Name = "是否有EDI数据")] + public bool IsHaveEdiData { get; set; } + } -/// -/// 导出 -/// -public class BBAC_SE_DETAIL_EXPORT_DTO -{ /// - /// 发货单号 + /// 导出 /// - [Display(Name = "发货单号")] - [ExporterHeader(DisplayName = "发货单号")] - public string WmsBillNum { get; set; } + public class BBAC_SE_DETAIL_EXPORT_DTO + { + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + [ExporterHeader(DisplayName = "发货单号")] + public string WmsBillNum { get; set; } - /// - /// 单据编号 - /// - [Display(Name = "单据编号")] - [ExporterHeader(DisplayName = "单据编号")] - public string Num { get; set; } + /// + /// 单据编号 + /// + [Display(Name = "单据编号")] + [ExporterHeader(DisplayName = "单据编号")] + public string Num { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - [ExporterHeader(DisplayName = "发货时间")] - public DateTime BillTime { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + [ExporterHeader(DisplayName = "发货时间")] + public DateTime BillTime { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - [ExporterHeader(DisplayName = "发货人")] - public string Oper { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + [ExporterHeader(DisplayName = "发货人")] + public string Oper { get; set; } - /// - /// 排序单号 - /// - [Display(Name = "排序单号")] - [ExporterHeader(DisplayName = "排序单号")] - public string OrderNum { get; set; } + /// + /// 排序单号 + /// + [Display(Name = "排序单号")] + [ExporterHeader(DisplayName = "排序单号")] + public string OrderNum { get; set; } - /// - /// 订单序号 - /// - [Display(Name = "订单序号")] - [ExporterHeader(DisplayName = "订单序号")] - public string Seq { get; set; } + /// + /// 订单序号 + /// + [Display(Name = "订单序号")] + [ExporterHeader(DisplayName = "订单序号")] + public string Seq { get; set; } - /// - /// 实际生产码 - /// - [Display(Name = "实际生产码")] - [ExporterHeader(DisplayName = "实际生产码")] - public string RealCode { get; set; } + /// + /// 实际生产码 + /// + [Display(Name = "实际生产码")] + [ExporterHeader(DisplayName = "实际生产码")] + public string RealCode { get; set; } - /// - /// 订单生产码 - /// - [Display(Name = "订单生产码")] - [ExporterHeader(DisplayName = "订单生产码")] - public string VinCode { get; set; } + /// + /// 订单生产码 + /// + [Display(Name = "订单生产码")] + [ExporterHeader(DisplayName = "订单生产码")] + public string VinCode { get; set; } - /// - /// 生产码类型 - /// - [Display(Name = "生产码类型")] - [ExporterHeader(DisplayName = "生产码类型")] - public string CodeType { get; set; } + /// + /// 生产码类型 + /// + [Display(Name = "生产码类型")] + [ExporterHeader(DisplayName = "生产码类型")] + public string CodeType { get; set; } - /// - /// 实际零件号 - /// - [Display(Name = "实际零件号")] - [ExporterHeader(DisplayName = "实际零件号")] - public string RealPartCode { get; set; } + /// + /// 实际零件号 + /// + [Display(Name = "实际零件号")] + [ExporterHeader(DisplayName = "实际零件号")] + public string RealPartCode { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "零件号")] - public string PartCode { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "零件号")] + public string PartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - [ExporterHeader(DisplayName = "批次")] - public string Batch { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + [ExporterHeader(DisplayName = "批次")] + public string Batch { get; set; } - /// - /// MES配置码 - /// - [Display(Name = "MES配置码")] - [ExporterHeader(DisplayName = "MES配置码")] - public string MESConfigCode { get; set; } + /// + /// MES配置码 + /// + [Display(Name = "MES配置码")] + [ExporterHeader(DisplayName = "MES配置码")] + public string MESConfigCode { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - [ExporterHeader(DisplayName = "来源库位")] - public string FromLoc { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + [ExporterHeader(DisplayName = "来源库位")] + public string FromLoc { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - [ExporterHeader(DisplayName = "目标库位")] - public string ToLoc { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + [ExporterHeader(DisplayName = "目标库位")] + public string ToLoc { get; set; } - /// - /// 参照订单生产码 - /// - [Display(Name = "参照订单生产码")] - [ExporterHeader(DisplayName = "参照订单生产码")] - public string RefVinCode { get; set; } + /// + /// 参照订单生产码 + /// + [Display(Name = "参照订单生产码")] + [ExporterHeader(DisplayName = "参照订单生产码")] + public string RefVinCode { get; set; } - /// - /// 单据性质 - /// - [Display(Name = "单据性质")] - [ExporterHeader(DisplayName = "单据性质")] - public string BillCharacter { get; set; } + /// + /// 单据性质 + /// + [Display(Name = "单据性质")] + [ExporterHeader(DisplayName = "单据性质")] + public string BillCharacter { get; set; } - /// - /// 发货关联单号 - /// - [Display(Name = "发货关联单号")] - [ExporterHeader(DisplayName = "发货关联单号")] - public string RefBillNum { get; set; } + /// + /// 发货关联单号 + /// + [Display(Name = "发货关联单号")] + [ExporterHeader(DisplayName = "发货关联单号")] + public string RefBillNum { get; set; } - /// - /// Erp目标库位 - /// - [Display(Name = "Erp目标库位")] - [ExporterHeader(DisplayName = "Erp目标库位")] - public string ErpToLoc { get; set; } + /// + /// Erp目标库位 + /// + [Display(Name = "Erp目标库位")] + [ExporterHeader(DisplayName = "Erp目标库位")] + public string ErpToLoc { get; set; } - /// - /// 原生产码 - /// - [Display(Name = "原生产码")] - [ExporterHeader(DisplayName = "原生产码")] - public string OrigiCode { get; set; } + /// + /// 原生产码 + /// + [Display(Name = "原生产码")] + [ExporterHeader(DisplayName = "原生产码")] + public string OrigiCode { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - [ExporterHeader(DisplayName = "备注")] - public string Remark { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + [ExporterHeader(DisplayName = "备注")] + public string Remark { get; set; } - /// - /// 塑件唯一码 - /// - [Display(Name = "塑件唯一码")] - [ExporterHeader(DisplayName = "塑件唯一码")] - public string UniqueCode { get; set; } + /// + /// 塑件唯一码 + /// + [Display(Name = "塑件唯一码")] + [ExporterHeader(DisplayName = "塑件唯一码")] + public string UniqueCode { get; set; } - /// - /// PJS顺序号 - /// - [Display(Name = "PJS顺序号")] - [ExporterHeader(DisplayName = "PJS顺序号")] - public string PjsNum { get; set; } + /// + /// PJS顺序号 + /// + [Display(Name = "PJS顺序号")] + [ExporterHeader(DisplayName = "PJS顺序号")] + public string PjsNum { get; set; } - /// - /// 虚拟小总成 - /// - [Display(Name = "虚拟小总成")] - [ExporterHeader(DisplayName = "虚拟小总成")] - public string MatchNumber { get; set; } + /// + /// 虚拟小总成 + /// + [Display(Name = "虚拟小总成")] + [ExporterHeader(DisplayName = "虚拟小总成")] + public string MatchNumber { get; set; } - /// - /// 发货条码 - /// - [Display(Name = "发货条码")] - [ExporterHeader(DisplayName = "发货条码")] - public string DeliverCode { get; set; } + /// + /// 发货条码 + /// + [Display(Name = "发货条码")] + [ExporterHeader(DisplayName = "发货条码")] + public string DeliverCode { get; set; } - /// - /// 客户位置 - /// - [Display(Name = "客户位置")] - [ExporterHeader(DisplayName = "客户位置")] - public string Position { get; set; } + /// + /// 客户位置 + /// + [Display(Name = "客户位置")] + [ExporterHeader(DisplayName = "客户位置")] + public string Position { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs index e57cb582..aeb662ac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs @@ -1,6 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos @@ -34,9 +34,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "生产码")] public string PN { get; set; } - - - /// /// 日顺序号 /// @@ -71,7 +68,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// /// 导出 /// - public class BBAC_SE_EDI_EXPORT_DTO + public class BBAC_SE_EDI_EXPORT_DTO { /// /// LU+生产码 @@ -87,8 +84,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "期间")] public int Version { get; set; } - - [Display(Name = "原客户零件号")] public string CustomerPartCodeNoSpace { set; get; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/EdiSeCompareRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/EdiSeCompareRequestDto.cs index dd93d5f1..07451ee4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/EdiSeCompareRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/EdiSeCompareRequestDto.cs @@ -1,41 +1,42 @@ using System; using System.ComponentModel.DataAnnotations; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// Edi与发运对比请求Dto -/// -public class EdiSeCompareRequestDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 期间 - /// - [Display(Name = "期间")] - [Required(ErrorMessage = "{0}不能为空")] - public string Version { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - public string LU { get; set; } - /// - /// 通用码 - /// - [Display(Name = "通用码")] - public string PN { get; set; } - /// - /// 发运开始时间 - /// - [Display(Name = "发运开始时间")] - public DateTime? SeStartDateTime { get; set; } - /// - /// 发运结束时间 - /// - [Display(Name = "发运结束时间")] - public DateTime? SeEndDateTime { get; set; } - /// - /// 业务类型 + /// Edi与发运对比请求Dto /// - public EnumBusinessType BusinessType { get; set; } + public class EdiSeCompareRequestDto + { + /// + /// 期间 + /// + [Display(Name = "期间")] + [Required(ErrorMessage = "{0}不能为空")] + public string Version { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + /// + /// 通用码 + /// + [Display(Name = "通用码")] + public string PN { get; set; } + /// + /// 发运开始时间 + /// + [Display(Name = "发运开始时间")] + public DateTime? SeStartDateTime { get; set; } + /// + /// 发运结束时间 + /// + [Display(Name = "发运结束时间")] + public DateTime? SeEndDateTime { get; set; } + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs index 9e167ee0..8c861064 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_CAN_SA_DTO.cs @@ -1,13 +1,8 @@ -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 Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { @@ -48,8 +43,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// ///工厂地点 /// - - public string Site { get; set; } + + public string Site { get; set; } /// /// 版本 /// @@ -95,20 +90,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Amt { get; set; } - - public string InvBillNum { get; set; } - public string PartCode { get; set; } - - - - - - - - } public class HBPO_CAN_SA_DETAIL_EXP_DTO @@ -164,25 +148,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string PartCode { get; set; } } - + public class HBPO_CAN_SA_REQ_DTO : RequestInputBase { - //[Display(Name = "期间")] - //public int Version { get; set; } - //[Display(Name = "结算单据")] - //public string BillNum { get; set; } - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } - //[Display(Name = "状态")] - //public string State { get; set; } - } + //[Display(Name = "期间")] + //public int Version { get; set; } + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } + //[Display(Name = "状态")] + //public string State { get; set; } + } public class HBPO_CAN_SA_DETAIL_REQ_DTO : RequestInputBase { //[Display(Name = "关联结算单号")] //public string SettleBillNum { get; set; } - + ////[Display(Name = "业务类别")] ////public string Category { get; set; } ////[Display(Name = "是否退货")] @@ -211,9 +195,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos //[Display(Name = "结算分组号")] //public string GroupNum { get; set; } - - } - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs index ee72c745..bd136af0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_NOT_SA_DTO.cs @@ -1,17 +1,11 @@ -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 Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { - + public class HBPO_NOT_SA_DETAIL_DTO : EntityDto { /// @@ -21,8 +15,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// ///工厂地点 /// - - public string Site { get; set; } + + public string Site { get; set; } /// /// 版本 /// @@ -119,14 +113,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "厂内零件号")] public string PartCode { get; set; } - } public class HBPO_NOT_SA_DETAIL_REQ_DTO : RequestInputBase { //[Display(Name = "关联结算单号")] //public string SettleBillNum { get; set; } - + ////[Display(Name = "业务类别")] ////public string Category { get; set; } ////[Display(Name = "是否退货")] @@ -156,11 +149,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos //[Display(Name = "结算分组号")] //public string GroupNum { get; set; } - //public string PartCode { get; set; } } - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs index 6f21aac6..f34d9e22 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_PD_DTO.cs @@ -1,6 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; @@ -35,8 +35,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "地点")] public string Site { get; set; } - - [Display(Name = "状态")] public EnumBillState State { set; get; } @@ -215,7 +213,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "LU")] public string LU { get; set; } [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDesc{ get; set; } + public string MaterialDesc { get; set; } /// /// 生产码 /// @@ -262,7 +260,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string BillNum { get; set; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs index e7a64408..a073b62e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SA_DTO.cs @@ -5,276 +5,277 @@ using Microsoft.AspNetCore.Http; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// HBPO结算单 -/// -public class HBPO_SA_DTO : EntityDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - /// 结算单据 - /// - [Display(Name = "结算单据")] - public string BillNum { get; set; } - /// - /// 出库单号 - /// - [Display(Name = "出库单号")] - public string DNBillNum { get; set; } - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public string State { get; set; } - /// - /// 明细记录行数 - /// - [Display(Name = "明细记录行数")] - public string RecordCount { get; set; } - /// - /// 地点码 - /// - [Display(Name = "地点码")] - public string Site { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - public string Place { get; set; } - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumBusinessType BusinessType { get; set; } -} + /// HBPO结算单 + /// + public class HBPO_SA_DTO : EntityDto + { + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + /// 结算单据 + /// + [Display(Name = "结算单据")] + public string BillNum { get; set; } + /// + /// 出库单号 + /// + [Display(Name = "出库单号")] + public string DNBillNum { get; set; } + /// + /// 1、新建 2、已有出库3、已有扣减寄售库 + /// + [Display(Name = "状态")] + public string State { get; set; } + /// + /// 明细记录行数 + /// + [Display(Name = "明细记录行数")] + public string RecordCount { get; set; } + /// + /// 地点码 + /// + [Display(Name = "地点码")] + public string Site { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + public string Place { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumBusinessType BusinessType { get; set; } + } -/// -/// HBPO结算明细 -/// -public class HBPO_SA_DETAIL_DTO : AuditedAggregateRoot -{ - /// - /// 结算单 - /// - public string BillNum { set; get; } - /// - /// 期间 - /// - public int Version { set; get; } /// - /// 结算分组号 - /// - public string GroupNum { get; set; } - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 客户物料号 - /// - public string LU { get; set; } - /// - /// 数量 - /// - public string Qty { get; set; } - /// - /// 结算日期 - /// - public string SettleDate { set; get; } - /// - /// 单价 - /// - public decimal Price { set; get; } - /// - /// 厂内物料号 - /// - public string PartCode { get; set; } -} + /// HBPO结算明细 + /// + public class HBPO_SA_DETAIL_DTO : AuditedAggregateRoot + { + /// + /// 结算单 + /// + public string BillNum { set; get; } + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 结算分组号 + /// + public string GroupNum { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 客户物料号 + /// + public string LU { get; set; } + /// + /// 数量 + /// + public string Qty { get; set; } + /// + /// 结算日期 + /// + public string SettleDate { set; get; } + /// + /// 单价 + /// + public decimal Price { set; get; } + /// + /// 厂内物料号 + /// + public string PartCode { get; set; } + } -/// -/// HBPO结算导入请求 -/// -public class HBPOSaImportRequestDto -{ - /// - /// 文件 - /// - public IFormFileCollection Files { get; set; } - /// - /// 业务类别 - /// - public EnumBusinessType BusinessType { get; set; } /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } -} + /// HBPO结算导入请求 + /// + public class HBPOSaImportRequestDto + { + /// + /// 文件 + /// + public IFormFileCollection Files { get; set; } + /// + /// 业务类别 + /// + public EnumBusinessType BusinessType { get; set; } + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + } -/// -/// HBPO结算明细导入 -/// -public class HBPO_SA_DETAIL_IMPORT_DTO -{ - /// - /// 结算日期 - /// - [Display(Name = "ReceiveDate")] - [ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd HH:mm:ss")] - public DateTime SettleDate { set; get; } - /// - /// 结算分组号 - /// - [Display(Name = "DeliveryNode")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "DeliveryNode")] - public string GroupNum { get; set; } - /// - /// 到货日期 - /// - [Display(Name = "DeliveryDate")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "DeliveryDate", Format = "MM/yyyy/dd HH:mm:ss")] - public DateTime? DeliveryDate { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "PartNumber")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "PartNumber")] - public string LU { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ImporterHeader(Name = "Qty")] - public decimal Qty { get; set; } /// - /// 地点 - /// - [Display(Name = "地点")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "filename")] - public string Place { get; set; } - /// - /// 生产号 - /// - [Display(Name = "productionNumber")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "productionNumber")] - public string PN { get; set; } -} + /// HBPO结算明细导入 + /// + public class HBPO_SA_DETAIL_IMPORT_DTO + { + /// + /// 结算日期 + /// + [Display(Name = "ReceiveDate")] + [ImporterHeader(Name = "ReceiveDate", Format = "yyyy/MM/dd HH:mm:ss")] + public DateTime SettleDate { set; get; } + /// + /// 结算分组号 + /// + [Display(Name = "DeliveryNode")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "DeliveryNode")] + public string GroupNum { get; set; } + /// + /// 到货日期 + /// + [Display(Name = "DeliveryDate")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "DeliveryDate", Format = "MM/yyyy/dd HH:mm:ss")] + public DateTime? DeliveryDate { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "PartNumber")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "PartNumber")] + public string LU { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ImporterHeader(Name = "Qty")] + public decimal Qty { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "filename")] + public string Place { get; set; } + /// + /// 生产号 + /// + [Display(Name = "productionNumber")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "productionNumber")] + public string PN { get; set; } + } -/// -/// 买单件HBPO导入 -/// -public class MaiDanJianHBPOImportDto -{ - /// - /// 结算日期 - /// - [Display(Name = "买单日期")] - [ImporterHeader(Name = "买单日期")] - public DateTime SettleDate { set; get; } - /// - /// 客户零件号 - /// - [Display(Name = "零件号")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "零件号")] - public string LU { get; set; } - /// - /// 生产号 - /// - [Display(Name = "现产品生产号")] - [ImporterHeader(Name = "现产品生产号")] - [Required(ErrorMessage = "{0}不能为空")] - public string PN { get; set; } - /// - /// 数量 - /// - [Display(Name = "数量")] - [ImporterHeader(Name = "数量")] - public decimal Qty { get; set; } /// - /// 结算分组号 - /// - [Display(Name = "五联单号")] - [ImporterHeader(Name = "五联单号")] - [Required(ErrorMessage = "{0}不能为空")] - public string GroupNum { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - [ImporterHeader(Name = "地点")] - [Required(ErrorMessage = "{0}不能为空")] - public string Place { get; set; } -} + /// 买单件HBPO导入 + /// + public class MaiDanJianHBPOImportDto + { + /// + /// 结算日期 + /// + [Display(Name = "买单日期")] + [ImporterHeader(Name = "买单日期")] + public DateTime SettleDate { set; get; } + /// + /// 客户零件号 + /// + [Display(Name = "零件号")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "零件号")] + public string LU { get; set; } + /// + /// 生产号 + /// + [Display(Name = "现产品生产号")] + [ImporterHeader(Name = "现产品生产号")] + [Required(ErrorMessage = "{0}不能为空")] + public string PN { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + [ImporterHeader(Name = "数量")] + public decimal Qty { get; set; } + /// + /// 结算分组号 + /// + [Display(Name = "五联单号")] + [ImporterHeader(Name = "五联单号")] + [Required(ErrorMessage = "{0}不能为空")] + public string GroupNum { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [ImporterHeader(Name = "地点")] + [Required(ErrorMessage = "{0}不能为空")] + public string Place { get; set; } + } -/// -/// 结算明细导出请求 -/// -public class HBPO_SA_DETAIL_EXPORT_REQUEST_DTO -{ /// - /// 结算单号 - /// - [Display(Name = "结算单号")] - [Required(ErrorMessage = "{0}不能为空")] - public string BillNum { set; get; } -} + /// 结算明细导出请求 + /// + public class HBPO_SA_DETAIL_EXPORT_REQUEST_DTO + { + /// + /// 结算单号 + /// + [Display(Name = "结算单号")] + [Required(ErrorMessage = "{0}不能为空")] + public string BillNum { set; get; } + } -/// -/// 结算明细导出 -/// -public class HBPO_SA_DETAIL_EXPORT_DTO -{ /// - /// 结算单号 + /// 结算明细导出 /// - [Display(Name = "结算单号")] - [ExporterHeader(DisplayName = "结算单号")] - public string BillNum { set; get; } + public class HBPO_SA_DETAIL_EXPORT_DTO + { + /// + /// 结算单号 + /// + [Display(Name = "结算单号")] + [ExporterHeader(DisplayName = "结算单号")] + public string BillNum { set; get; } - /// - /// 结算日期 - /// - [Display(Name = "结算日期")] - [ExporterHeader(DisplayName = "结算日期")] - public DateTime SettleDate { set; get; } + /// + /// 结算日期 + /// + [Display(Name = "结算日期")] + [ExporterHeader(DisplayName = "结算日期")] + public DateTime SettleDate { set; get; } - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - [ExporterHeader(DisplayName = "发货单号")] - public string PN { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + [ExporterHeader(DisplayName = "发货单号")] + public string PN { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "零件号")] - public string LU { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "零件号")] + public string LU { get; set; } - /// - /// 数量 - /// - [Display(Name = "数量")] - [ExporterHeader(DisplayName = "数量")] - public decimal Qty { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { get; set; } - /// - /// 结算分组 - /// - [Display(Name = "结算分组")] - [ExporterHeader(DisplayName = "结算分组")] - public string GroupNum { get; set; } + /// + /// 结算分组 + /// + [Display(Name = "结算分组")] + [ExporterHeader(DisplayName = "结算分组")] + public string GroupNum { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs index 5762e9fa..507d2769 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs @@ -5,432 +5,433 @@ using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// HBPO发运单 -/// -public class HBPO_SE_DETAIL_DTO : EntityDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 期间 - /// - public int Version { set; get; } - /// - /// 发货时间 - /// - public DateTime ShippingDate { set; get; } - /// - /// 发运单号 - /// - public string WmsBillNum { set; get; } - /// - /// 客户零件号 - /// - public string LU { get; set; } - /// - /// 厂内零件号 - /// - public string FactoryPartCode { get; set; } - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 组合键值(PN+LU) - /// - public string KeyCode { get; set; } - /// - /// 数量 - /// - public decimal Qty { get; set; } - /// - /// UID - /// - [Display(Name = "UID")] - [DisplayName("UID")] - public long UID { get; set; } - /// - /// JIT订单号 - /// - [Display(Name = "JIT订单号")] - [DisplayName("JIT订单号")] - public string JISNum { get; set; } - /// - /// JIT排序生产码 - /// - [Display(Name = "JIT排序生产码")] - public string VinCode { get; set; } - /// - /// JIT排序生产码类型 - /// - [Display(Name = "JIT排序生产码类型")] - public string CodeType { get; set; } - /// - /// 订单零件号 - /// - [Display(Name = "订单零件号")] - public string PartCode { get; set; } - /// - /// 订单零件号 - /// - [Display(Name = "订单零件号")] - public string RealPartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - public string Batch { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - public string CustPartCode { get; set; } - /// - /// 订单序号 - /// - [Display(Name = "订单序号")] - public string Seq { get; set; } - /// - /// 订单时间 - /// - [Display(Name = "订单时间")] - public DateTime AssembleData { get; set; } - /// - /// 发货条码 - /// - [Display(Name = "发货条码")] - public string DeliverCode { get; set; } - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - public string BillNum { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - public DateTime? BillTime { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - public string Oper { get; set; } - /// - /// 客户位置 - /// - [Display(Name = "客户位置")] - public string Position { get; set; } - /// - /// 工厂 - /// - [Display(Name = "工厂")] - public string Factory { get; set; } - /// - /// MES配置码 - /// - [Display(Name = "MES配置码")] - public string MESConfigCode { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - public string ToLoc { get; set; } - /// - /// 单据类型 - /// - public EnumBillType BillType { get; set; } - /// - /// 子单据类型 - /// - [Display(Name = "子单据类型")] - public EnumSubBillType SubBillType { get; set; } - /// - /// 事务类型 - /// - [Display(Name = "事务类型")] - public EnumDelTransType TransType { get; set; } - /// - /// 发运主类型 - /// - [Display(Name = "发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } - /// - /// 发运子类型 - /// - [Display(Name = "发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } - /// - /// 单据性质 - /// - [Display(Name = "单据性质")] - public string BillCharacter { get; set; } - /// - /// 原生产码 - /// - [Display(Name = "原生产码")] - public string OrigiCode { get; set; } - /// - /// 描述 - /// - [Display(Name = "描述")] - public string PartDesc { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - public string Remark { get; set; } - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumProTpe ProType { get; set; } - /// - /// JIS排序单号 - /// - [Display(Name = "JIS排序单号")] - public string OrderNum { get; set; } - /// - /// JIS实际生产码 - /// - [Display(Name = "JIS实际生产码")] - public string RealCode { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - public string FromLoc { get; set; } - /// - /// 参照订单生产码 - /// - [Display(Name = "参照订单生产码")] - public string RefVinCode { get; set; } - /// - /// 发货关联单号 - /// - [Display(Name = "发货关联单号")] - public string RefBillNum { get; set; } - /// - /// Erp目标库位 - /// - [Display(Name = "Erp目标库位")] - public string ErpToLoc { get; set; } - /// - /// 塑件唯一码 - /// - [Display(Name = "塑件唯一码")] - public string UniqueCode { get; set; } - /// - /// PJS顺序号 - /// - [Display(Name = "PJS顺序号")] - public string PjsNum { get; set; } - /// - /// 虚拟小总成 - /// - [Display(Name = "虚拟小总成")] - public string MatchNumber { get; set; } - /// - /// 状态 - /// - [Display(Name = "状态")] - public EnumBillState State { get; set; } - /// - /// 创建时间 - /// - [Display(Name = "创建时间")] - public DateTime CreateTime { get; set; } - /// - /// 是否有EDI数据 - /// - [Display(Name = "是否有EDI数据")] - public bool IsHaveEdiData { get; set; } -} + /// HBPO发运单 + /// + public class HBPO_SE_DETAIL_DTO : EntityDto + { + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 发货时间 + /// + public DateTime ShippingDate { set; get; } + /// + /// 发运单号 + /// + public string WmsBillNum { set; get; } + /// + /// 客户零件号 + /// + public string LU { get; set; } + /// + /// 厂内零件号 + /// + public string FactoryPartCode { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 组合键值(PN+LU) + /// + public string KeyCode { get; set; } + /// + /// 数量 + /// + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } + /// + /// JIT订单号 + /// + [Display(Name = "JIT订单号")] + [DisplayName("JIT订单号")] + public string JISNum { get; set; } + /// + /// JIT排序生产码 + /// + [Display(Name = "JIT排序生产码")] + public string VinCode { get; set; } + /// + /// JIT排序生产码类型 + /// + [Display(Name = "JIT排序生产码类型")] + public string CodeType { get; set; } + /// + /// 订单零件号 + /// + [Display(Name = "订单零件号")] + public string PartCode { get; set; } + /// + /// 订单零件号 + /// + [Display(Name = "订单零件号")] + public string RealPartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 订单序号 + /// + [Display(Name = "订单序号")] + public string Seq { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 发货条码 + /// + [Display(Name = "发货条码")] + public string DeliverCode { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime? BillTime { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + public string Oper { get; set; } + /// + /// 客户位置 + /// + [Display(Name = "客户位置")] + public string Position { get; set; } + /// + /// 工厂 + /// + [Display(Name = "工厂")] + public string Factory { get; set; } + /// + /// MES配置码 + /// + [Display(Name = "MES配置码")] + public string MESConfigCode { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + public string ToLoc { get; set; } + /// + /// 单据类型 + /// + public EnumBillType BillType { get; set; } + /// + /// 子单据类型 + /// + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } + /// + /// 事务类型 + /// + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } + /// + /// 发运主类型 + /// + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 单据性质 + /// + [Display(Name = "单据性质")] + public string BillCharacter { get; set; } + /// + /// 原生产码 + /// + [Display(Name = "原生产码")] + public string OrigiCode { get; set; } + /// + /// 描述 + /// + [Display(Name = "描述")] + public string PartDesc { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + public string Remark { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// JIS排序单号 + /// + [Display(Name = "JIS排序单号")] + public string OrderNum { get; set; } + /// + /// JIS实际生产码 + /// + [Display(Name = "JIS实际生产码")] + public string RealCode { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + public string FromLoc { get; set; } + /// + /// 参照订单生产码 + /// + [Display(Name = "参照订单生产码")] + public string RefVinCode { get; set; } + /// + /// 发货关联单号 + /// + [Display(Name = "发货关联单号")] + public string RefBillNum { get; set; } + /// + /// Erp目标库位 + /// + [Display(Name = "Erp目标库位")] + public string ErpToLoc { get; set; } + /// + /// 塑件唯一码 + /// + [Display(Name = "塑件唯一码")] + public string UniqueCode { get; set; } + /// + /// PJS顺序号 + /// + [Display(Name = "PJS顺序号")] + public string PjsNum { get; set; } + /// + /// 虚拟小总成 + /// + [Display(Name = "虚拟小总成")] + public string MatchNumber { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public EnumBillState State { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } + /// + /// 是否有EDI数据 + /// + [Display(Name = "是否有EDI数据")] + public bool IsHaveEdiData { get; set; } + } -/// -/// 导出 -/// -public class HBPO_SE_DETAIL_EXPORT_DTO -{ /// - /// 发货单号 + /// 导出 /// - [Display(Name = "发货单号")] - [ExporterHeader(DisplayName = "发货单号")] - public string WmsBillNum { get; set; } + public class HBPO_SE_DETAIL_EXPORT_DTO + { + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + [ExporterHeader(DisplayName = "发货单号")] + public string WmsBillNum { get; set; } - /// - /// 单据编号 - /// - [Display(Name = "单据编号")] - [ExporterHeader(DisplayName = "单据编号")] - public string Num { get; set; } + /// + /// 单据编号 + /// + [Display(Name = "单据编号")] + [ExporterHeader(DisplayName = "单据编号")] + public string Num { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - [ExporterHeader(DisplayName = "发货时间")] - public DateTime BillTime { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + [ExporterHeader(DisplayName = "发货时间")] + public DateTime BillTime { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - [ExporterHeader(DisplayName = "发货人")] - public string Oper { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + [ExporterHeader(DisplayName = "发货人")] + public string Oper { get; set; } - /// - /// 排序单号 - /// - [Display(Name = "排序单号")] - [ExporterHeader(DisplayName = "排序单号")] - public string OrderNum { get; set; } + /// + /// 排序单号 + /// + [Display(Name = "排序单号")] + [ExporterHeader(DisplayName = "排序单号")] + public string OrderNum { get; set; } - /// - /// 订单序号 - /// - [Display(Name = "订单序号")] - [ExporterHeader(DisplayName = "订单序号")] - public string Seq { get; set; } + /// + /// 订单序号 + /// + [Display(Name = "订单序号")] + [ExporterHeader(DisplayName = "订单序号")] + public string Seq { get; set; } - /// - /// 实际生产码 - /// - [Display(Name = "实际生产码")] - [ExporterHeader(DisplayName = "实际生产码")] - public string RealCode { get; set; } + /// + /// 实际生产码 + /// + [Display(Name = "实际生产码")] + [ExporterHeader(DisplayName = "实际生产码")] + public string RealCode { get; set; } - /// - /// 订单生产码 - /// - [Display(Name = "订单生产码")] - [ExporterHeader(DisplayName = "订单生产码")] - public string VinCode { get; set; } + /// + /// 订单生产码 + /// + [Display(Name = "订单生产码")] + [ExporterHeader(DisplayName = "订单生产码")] + public string VinCode { get; set; } - /// - /// 生产码类型 - /// - [Display(Name = "生产码类型")] - [ExporterHeader(DisplayName = "生产码类型")] - public string CodeType { get; set; } + /// + /// 生产码类型 + /// + [Display(Name = "生产码类型")] + [ExporterHeader(DisplayName = "生产码类型")] + public string CodeType { get; set; } - /// - /// 实际零件号 - /// - [Display(Name = "实际零件号")] - [ExporterHeader(DisplayName = "实际零件号")] - public string RealPartCode { get; set; } + /// + /// 实际零件号 + /// + [Display(Name = "实际零件号")] + [ExporterHeader(DisplayName = "实际零件号")] + public string RealPartCode { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "零件号")] - public string PartCode { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "零件号")] + public string PartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - [ExporterHeader(DisplayName = "批次")] - public string Batch { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + [ExporterHeader(DisplayName = "批次")] + public string Batch { get; set; } - /// - /// MES配置码 - /// - [Display(Name = "MES配置码")] - [ExporterHeader(DisplayName = "MES配置码")] - public string MESConfigCode { get; set; } + /// + /// MES配置码 + /// + [Display(Name = "MES配置码")] + [ExporterHeader(DisplayName = "MES配置码")] + public string MESConfigCode { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - [ExporterHeader(DisplayName = "来源库位")] - public string FromLoc { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + [ExporterHeader(DisplayName = "来源库位")] + public string FromLoc { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - [ExporterHeader(DisplayName = "目标库位")] - public string ToLoc { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + [ExporterHeader(DisplayName = "目标库位")] + public string ToLoc { get; set; } - /// - /// 参照订单生产码 - /// - [Display(Name = "参照订单生产码")] - [ExporterHeader(DisplayName = "参照订单生产码")] - public string RefVinCode { get; set; } + /// + /// 参照订单生产码 + /// + [Display(Name = "参照订单生产码")] + [ExporterHeader(DisplayName = "参照订单生产码")] + public string RefVinCode { get; set; } - /// - /// 单据性质 - /// - [Display(Name = "单据性质")] - [ExporterHeader(DisplayName = "单据性质")] - public string BillCharacter { get; set; } + /// + /// 单据性质 + /// + [Display(Name = "单据性质")] + [ExporterHeader(DisplayName = "单据性质")] + public string BillCharacter { get; set; } - /// - /// 发货关联单号 - /// - [Display(Name = "发货关联单号")] - [ExporterHeader(DisplayName = "发货关联单号")] - public string RefBillNum { get; set; } + /// + /// 发货关联单号 + /// + [Display(Name = "发货关联单号")] + [ExporterHeader(DisplayName = "发货关联单号")] + public string RefBillNum { get; set; } - /// - /// Erp目标库位 - /// - [Display(Name = "Erp目标库位")] - [ExporterHeader(DisplayName = "Erp目标库位")] - public string ErpToLoc { get; set; } + /// + /// Erp目标库位 + /// + [Display(Name = "Erp目标库位")] + [ExporterHeader(DisplayName = "Erp目标库位")] + public string ErpToLoc { get; set; } - /// - /// 原生产码 - /// - [Display(Name = "原生产码")] - [ExporterHeader(DisplayName = "原生产码")] - public string OrigiCode { get; set; } + /// + /// 原生产码 + /// + [Display(Name = "原生产码")] + [ExporterHeader(DisplayName = "原生产码")] + public string OrigiCode { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - [ExporterHeader(DisplayName = "备注")] - public string Remark { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + [ExporterHeader(DisplayName = "备注")] + public string Remark { get; set; } - /// - /// 塑件唯一码 - /// - [Display(Name = "塑件唯一码")] - [ExporterHeader(DisplayName = "塑件唯一码")] - public string UniqueCode { get; set; } + /// + /// 塑件唯一码 + /// + [Display(Name = "塑件唯一码")] + [ExporterHeader(DisplayName = "塑件唯一码")] + public string UniqueCode { get; set; } - /// - /// PJS顺序号 - /// - [Display(Name = "PJS顺序号")] - [ExporterHeader(DisplayName = "PJS顺序号")] - public string PjsNum { get; set; } + /// + /// PJS顺序号 + /// + [Display(Name = "PJS顺序号")] + [ExporterHeader(DisplayName = "PJS顺序号")] + public string PjsNum { get; set; } - /// - /// 虚拟小总成 - /// - [Display(Name = "虚拟小总成")] - [ExporterHeader(DisplayName = "虚拟小总成")] - public string MatchNumber { get; set; } + /// + /// 虚拟小总成 + /// + [Display(Name = "虚拟小总成")] + [ExporterHeader(DisplayName = "虚拟小总成")] + public string MatchNumber { get; set; } - /// - /// 发货条码 - /// - [Display(Name = "发货条码")] - [ExporterHeader(DisplayName = "发货条码")] - public string DeliverCode { get; set; } + /// + /// 发货条码 + /// + [Display(Name = "发货条码")] + [ExporterHeader(DisplayName = "发货条码")] + public string DeliverCode { get; set; } - /// - /// 客户位置 - /// - [Display(Name = "客户位置")] - [ExporterHeader(DisplayName = "客户位置")] - public string Position { get; set; } + /// + /// 客户位置 + /// + [Display(Name = "客户位置")] + [ExporterHeader(DisplayName = "客户位置")] + public string Position { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs index f6f4ed45..e650691e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_EDI_DTO.cs @@ -1,6 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index 4e967ff6..0302785b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -1,11 +1,7 @@ -using Magicodes.ExporterAndImporter.Core; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.Shared.Constant; @@ -202,7 +198,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal PreTaxDiff { get; set; } - + //[ImporterHeader(Name = "税后金额", FixAllSpace = true)] //[Required(ErrorMessage = "{0}是必填项")] @@ -275,7 +271,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } public class UNSETTLED_DETAIL_DTO { - [Display(Name ="结算分组号")] + [Display(Name = "结算分组号")] public string GroupNum { set; get; } [Display(Name = "零件号")] public string LU { set; get; } @@ -447,7 +443,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// [Display(Name = "业务分类")] public string BussiessType { get; set; } - + /// ///扩展字段3 @@ -465,7 +461,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos - public class INVOICE_WAIT_DETAIL_DTO + public class INVOICE_WAIT_DETAIL_DTO { @@ -531,7 +527,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// //[Display(Name = "SA号")] //public string Extend1 { get; set; } - + /// ///扩展字段3 /// @@ -543,7 +539,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "价格结束日期")] public DateTime EndDate { get; set; } [Display(Name = "扩展字段", AutoGenerateField = false)] - + public Dictionary ExtraProperties { get; set; } @@ -566,7 +562,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } - public class INVOICE_MAP_GROUP_DTO + public class INVOICE_MAP_GROUP_DTO { @@ -662,7 +658,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public string InvGroupNum { get; set; } } - public class INVOICE_NOT_SETTLE_DTO + public class INVOICE_NOT_SETTLE_DTO { [Display(Name = "金税发票")] public string RealInvBillNum { get; set; } @@ -736,7 +732,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "不可结数量")] public string Qty { get; set; } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs index 2f8d9f09..997fb967 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_ADJ_DETAIL_DTO.cs @@ -1,134 +1,117 @@ using System; -using System.Collections; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -public class PUB_ADJ_DETAIL_DTO : EntityDto -{ - - - [Display(Name = "金税发票")] - public string RealInvBillNum { get; set; } - ///// - /////作废发票号 - ///// - //[Display(Name = "作废发票号")] - //public string OldInvBillNum { get; set; } - /// - ///发票号 - /// - [Display(Name = "发票号")] - public string InvBillNum { get; set; } - /// - /// 下线日期 - /// - [Display(Name = "下线日期")] - public DateTime SettleDate { get; set; } - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } - [Display(Name = "零件号")] - public string LU { get; set; } - [Display(Name = "标识号")] - public string PN { get; set; } - [Display(Name = "数量")] - public decimal Qty { get; set; } - [Display(Name = "结算分组")] - public string GroupNum { get; set; } - - [Display(Name = "键值")] - public string KeyCode { get; set; } - [Display(Name = "价格")] - public decimal Price { get; set; } - - - -} -public class PUB_ADJ_DETAIL_EXP_DTO +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { - /// - ///发票号 - /// - [Display(Name = "发票号")] - public string OldInvBillNum { get; set; } - - [Display(Name = "新发票号")] - public string InvBillNum { get; set; } - - [Display(Name = "下线日期")] - public DateTime SettleDate { get; set; } - - [Display(Name = "零件号")] - public string LU { get; set; } - [Display(Name = "标识号")] - public string PN { get; set; } - [Display(Name = "数量")] - public decimal Qty { get; set; } - [Display(Name = "结算分组号")] - public string GroupNum { get; set; } - public string PartCode { get; set; } - + public class PUB_ADJ_DETAIL_DTO : EntityDto + { + + [Display(Name = "金税发票")] + public string RealInvBillNum { get; set; } + ///// + /////作废发票号 + ///// + //[Display(Name = "作废发票号")] + //public string OldInvBillNum { get; set; } + /// + ///发票号 + /// + [Display(Name = "发票号")] + public string InvBillNum { get; set; } + /// + /// 下线日期 + /// + [Display(Name = "下线日期")] + public DateTime SettleDate { get; set; } + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } + [Display(Name = "零件号")] + public string LU { get; set; } + [Display(Name = "标识号")] + public string PN { get; set; } + [Display(Name = "数量")] + public decimal Qty { get; set; } + [Display(Name = "结算分组")] + public string GroupNum { get; set; } + + [Display(Name = "键值")] + public string KeyCode { get; set; } + [Display(Name = "价格")] + public decimal Price { get; set; } + + } + public class PUB_ADJ_DETAIL_EXP_DTO + { + /// + ///发票号 + /// + [Display(Name = "发票号")] + public string OldInvBillNum { get; set; } + + [Display(Name = "新发票号")] + public string InvBillNum { get; set; } + + [Display(Name = "下线日期")] + public DateTime SettleDate { get; set; } + + [Display(Name = "零件号")] + public string LU { get; set; } + [Display(Name = "标识号")] + public string PN { get; set; } + [Display(Name = "数量")] + public decimal Qty { get; set; } + [Display(Name = "结算分组号")] + public string GroupNum { get; set; } + public string PartCode { get; set; } + + } + + public class PUB_ADJ_DETAIL_IMP_DTO + { + /// + ///发票号 + /// + [ImporterHeader(Name = "发票号")] + public string OldInvBillNum { get; set; } + [ImporterHeader(Name = "下线日期")] + public DateTime SettleDate { get; set; } + [ImporterHeader(Name = "零件号")] + public string LU { get; set; } + + [ImporterHeader(Name = "厂内零件号")] + public string PartCode { get; set; } + + [ImporterHeader(Name = "标识号")] + public string PN { get; set; } + [ImporterHeader(Name = "数量")] + public decimal Qty { get; set; } + [ImporterHeader(Name = "结算分组号")] + public string GroupNum { get; set; } + + } + + public class PUB_ADJ_DETAIL_REQ_DTO : RequestInputBase + { + + /// + ///发票号 + /// + [Display(Name = "发票号")] + public string OldInvBillNum { get; set; } + [Display(Name = "下线日期")] + public DateTime SettleDate { get; set; } + [Display(Name = "零件号")] + public string LU { get; set; } + [Display(Name = "标识号")] + public string PN { get; set; } + [Display(Name = "数量")] + public decimal Qty { get; set; } + [Display(Name = "结算分组号")] + public string GroupNum { get; set; } + + } } - - - -public class PUB_ADJ_DETAIL_IMP_DTO -{ - /// - ///发票号 - /// - [ImporterHeader(Name = "发票号")] - public string OldInvBillNum { get; set; } - [ImporterHeader(Name = "下线日期")] - public DateTime SettleDate { get; set; } - [ImporterHeader(Name = "零件号")] - public string LU { get; set; } - - [ImporterHeader(Name = "厂内零件号")] - public string PartCode { get; set; } - - [ImporterHeader(Name = "标识号")] - public string PN { get; set; } - [ImporterHeader(Name = "数量")] - public decimal Qty { get; set; } - [ImporterHeader(Name = "结算分组号")] - public string GroupNum { get; set; } - -} - - - -public class PUB_ADJ_DETAIL_REQ_DTO : RequestInputBase -{ - - /// - ///发票号 - /// - [Display(Name = "发票号")] - public string OldInvBillNum { get; set; } - [Display(Name = "下线日期")] - public DateTime SettleDate { get; set; } - [Display(Name = "零件号")] - public string LU { get; set; } - [Display(Name = "标识号")] - public string PN { get; set; } - [Display(Name = "数量")] - public decimal Qty { get; set; } - [Display(Name = "结算分组号")] - public string GroupNum { get; set; } - -} - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs index 8804488f..13630258 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_CAN_SA_DTO.cs @@ -1,14 +1,8 @@ -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 Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { @@ -62,7 +56,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "发票分组号")] public string InvGroupNum { get; set; } - } public class PUB_CAN_SA_DETAIL_DTO : EntityDto { @@ -116,12 +109,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "行号")] public int IndexNum { get; set; } - - } - - public class PUB_CAN_SA_DETAIL_EXP_DTO { @@ -162,20 +151,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [ExporterHeader(DisplayName = "物料描述")] public string MaterialDesc { set; get; } - [ExporterHeader(DisplayName= "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] public string PartCode { get; set; } - - - } - - - - - - public class PUB_CAN_SA_DETAIL_REQ_DTO : RequestInputBase { @@ -210,16 +190,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "发货单号、交付单号")] public string PN { get; set; } - - } - - } - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs index da7906a4..c25e75e3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_NOT_SA_DTO.cs @@ -1,13 +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; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { @@ -55,8 +49,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } - - public class PUB_NOT_SA_DETAIL_EXP_DTO { @@ -103,40 +95,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } - - - - - - public class PUB_NOT_SA_DETAIL_REQ_DTO : RequestInputBase { //[Display(Name = "工厂地点")] //public string Site { get; set; } - + //[Display(Name = "业务分类")] //public EnumBusinessType BusinessType { get; set; } - + //public int Version { get; set; } //public string SettleBillNum { get; set; } - + //public string InvGroupNum { get; set; } //public string LU { get; set; } //public string PN { get; set; } - + //public string GroupNum { get; set; } - - + } } - - - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs index 6c82bf2a..21a54602 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_PD_DTO.cs @@ -1,6 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Bases; @@ -37,9 +37,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos [Display(Name = "业务类型")] public EnumBusinessType BusinessType { get; set; } - - - [Display(Name = "状态")] public EnumBillState State { set; get; } @@ -165,8 +162,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos } - - public class PUB_PD_DETAIL_EXP_DTO { @@ -264,7 +259,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// public string BillNum { get; set; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs index 5f5a5bd5..05c823fd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SA_DTO.cs @@ -5,529 +5,530 @@ using Microsoft.AspNetCore.Http; using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// PUB结算 -/// -public class PUB_SA_DTO : EntityDto -{ - /// - /// 期间 - /// - [Display(Name = "期间")] - public string Version { get; set; } - /// - /// 结算单据 - /// - [Display(Name = "结算单据")] - public string BillNum { get; set; } - /// - /// 状态 - /// - [Display(Name = "状态")] - public string State { get; set; } - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public BusinessType BusinessType { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - public string Place { get; set; } -} - -/// -/// 查询 -/// -public class PUB_SARequestDto : RequestDto -{ - /// - /// 业务类别 - /// - public EnumBusinessType BusinessType { get; set; } -} - -/// -/// 导入请求 -/// -public class PUB_SAImportRequestDto -{ - /// - /// 文件 - /// - public IFormFileCollection Files { get; set; } - /// - /// 业务类别 - /// - public EnumBusinessType BusinessType { get; set; } - /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - public string Site { get; set; } -} - -/// -/// 直供件BBAC导入 -/// -public class ZhiGongJianBBACImportDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 结算日期 - /// - [Display(Name = "Pstng Date")] - [ImporterHeader(Name = "Pstng Date")] - public DateTime SettleDate { set; get; } - /// - /// 客户零件号 - /// - [Display(Name = "Material")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "Material")] - public string LU { get; set; } - /// - /// 生产号 - /// - [Display(Name = "External Delivery ID")] - [ImporterHeader(Name = "External Delivery ID")] - [Required(ErrorMessage = "{0}不能为空")] - public string PN { get; set; } - /// - /// 数量 - /// - [Display(Name = "Quantity")] - [ImporterHeader(Name = "Quantity")] - public decimal Qty { get; set; } - /// - /// 结算分组号 - /// - [Display(Name = "External Delivery ID")] - [ImporterHeader(Name = "External Delivery ID")] - [Required(ErrorMessage = "{0}不能为空")] - public string GroupNum { get; set; } - /// - /// 根据Vendor=15663496过滤数据 - /// - [Display(Name = "Vendor")] - [ImporterHeader(Name = "Vendor")] - public string Vendor { get; set; } -} - -/// -/// 直供件HBPO导入 -/// -public class ZhiGongJianHBPOImportDto -{ - /// - /// 结算日期 - /// - [Display(Name = "结算日期")] - [ImporterHeader(IsIgnore = true)] - public DateTime SettleDate { set; get; } - /// - /// 客户零件号 - /// - [Display(Name = "零件号")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "零件号")] - public string LU { get; set; } - /// - /// 生产号 - /// - [Display(Name = "订单编号")] - [ImporterHeader(Name = "订单编号")] - [Required(ErrorMessage = "{0}不能为空")] - public string PN { get; set; } - /// - /// 数量 - /// - [Display(Name = "数量")] - [ImporterHeader(Name = "数量")] - public decimal Qty { get; set; } - /// - /// 结算分组号 - /// - [Display(Name = "订单编号")] - [ImporterHeader(Name = "订单编号")] - [Required(ErrorMessage = "{0}不能为空")] - public string GroupNum { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - [ImporterHeader(Name = "地点")] - [Required(ErrorMessage = "{0}不能为空")] - public string Place { get; set; } -} - -/// -/// 备件导入 -/// -public class BeiJianImportDto : BeiJianExtraImportDto -{ - /// - /// 结算日期 - /// - [Display(Name = "结算日期")] - [ImporterHeader(Name = "零件时间")] - public DateTime SettleDate { set; get; } - - /// - /// 客户零件号 - /// - [Display(Name = "零件号")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "零件号")] - public string LU { get; set; } - - /// - /// 生产号 - /// - [Display(Name = "交付识别号")] - [ImporterHeader(Name = "交付识别号")] - [Required(ErrorMessage = "{0}不能为空")] - public string PN { get; set; } - - /// - /// 数量 - /// - [Display(Name = "数量")] - [ImporterHeader(Name = "数量")] - public decimal Qty { get; set; } - - /// - /// 结算分组号 - /// - [Display(Name = "凭证号")] - [ImporterHeader(Name = "凭证号")] - [Required(ErrorMessage = "{0}不能为空")] - public string GroupNum { get; set; } - - /// - /// 采购订单号 - /// - [Display(Name = "采购订单号")] - [ImporterHeader(Name = "采购订单号")] - public string Extend3 { get; set; } -} - -/// -/// 备件扩展 -/// -public class BeiJianExtraImportDto -{ - /// - /// 交货号 - /// - [Display(Name = "交货号")] - [ImporterHeader(Name = "交货号")] - public string DeliveryNumber { set; get; } - - /// - /// 发票号 - /// - [Display(Name = "发票号")] - [ImporterHeader(Name = "发票号")] - public string InvoiceNumber { set; get; } - - /// - /// 开票日期 - /// - [Display(Name = "开票日期")] - [ImporterHeader(Name = "开票日期")] - public DateTime? MakeDate { set; get; } - - /// - /// 供应商代码 - /// - [Display(Name = "供应商代码")] - [ImporterHeader(Name = "供应商代码")] - public string VendorCode { set; get; } - - /// - /// 供应商名称 - /// - [Display(Name = "供应商名称")] - [ImporterHeader(Name = "供应商名称")] - public string VendorName { set; get; } - - /// - /// 交付索引号 - /// - [Display(Name = "交付索引号")] - [ImporterHeader(Name = "交付索引号")] - public string DeliveryIndexNumber { set; get; } - - /// - /// 零件名称 - /// - [Display(Name = "零件名称")] - [ImporterHeader(Name = "零件名称")] - public string PartName { set; get; } - - /// - /// 价格 - /// - [Display(Name = "价格")] - [ImporterHeader(Name = "价格")] - public decimal? Price { set; get; } - - /// - /// 金额 - /// - [Display(Name = "金额")] - [ImporterHeader(Name = "金额")] - public decimal? Amount { set; get; } - - /// - /// 税额 - /// - [Display(Name = "税额")] - [ImporterHeader(Name = "税额")] - public decimal? Tallage { set; get; } - - /// - /// 价税合计 - /// - [Display(Name = "价税合计")] - [ImporterHeader(Name = "价税合计")] - public decimal? Total { set; get; } - - /// - /// 协议编号 - /// - [Display(Name = "协议编号")] - [ImporterHeader(Name = "协议编号")] - public string ProtocolNumber { set; get; } - - /// - /// 备注 - /// - [Display(Name = "备注")] - [ImporterHeader(Name = "备注")] - public string Remark { set; get; } - - /// - /// 商品组 - /// - [Display(Name = "商品组")] - [ImporterHeader(Name = "商品组")] - public string CommodityGroup { set; get; } -} - -/// -/// 印度件导入 -/// -public class YinDuJianImportDto -{ - /// - /// 结算日期 - /// - [Display(Name = "Delivery Date")] - [ImporterHeader(Name = "Delivery Date")] - public DateTime SettleDate { set; get; } - - /// - /// 客户零件号 - /// - [Display(Name = "Material")] - [Required(ErrorMessage = "{0}不能为空")] - [ImporterHeader(Name = "Material")] - public string LU { get; set; } - - /// - /// 生产号 - /// - [Display(Name = "External Delivery ID")] - [ImporterHeader(Name = "External Delivery ID")] - [Required(ErrorMessage = "{0}不能为空")] - public string PN { get; set; } - - /// - /// 数量 - /// - [Display(Name = "数量")] - [ImporterHeader(Name = "Item")] - public decimal Qty { get; set; } - - /// - /// 结算分组号 - /// - [Display(Name = "External Delivery ID")] - [ImporterHeader(Name = "External Delivery ID")] - [Required(ErrorMessage = "{0}不能为空")] - public string GroupNum { get; set; } - - /// - /// Supplier - /// - [Display(Name = "Supplier")] - [ImporterHeader(Name = "Supplier")] - public string Supplier { get; set; } -} - -/// -/// PUB结算明细 -/// -public class PUB_SA_DETAIL_DTO : AuditedAggregateRoot -{ - /// - /// 结算单 - /// - public string BillNum { set; get; } - /// - /// 期间 - /// - public int Version { set; get; } - /// - /// 结算分组号 - /// - public string GroupNum { get; set; } - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 客户物料号 - /// - public string LU { get; set; } - /// - /// 数量 - /// - public string Qty { get; set; } - /// - /// 结算日期 - /// - public string SettleDate { set; get; } - /// - /// 单价 - /// - public decimal Price { set; get; } - /// - /// 厂内物料号 - /// - public string PartCode { get; set; } -} - -/// -/// 结算明细导出请求 -/// -public class PUB_SA_DETAIL_EXPORT_REQUEST_DTO -{ - /// - /// 结算单号 - /// - [Display(Name = "结算单号")] - [Required(ErrorMessage = "{0}不能为空")] - public string BillNum { set; get; } -} - -/// -/// 结算明细导出 -/// -public class PUB_SA_DETAIL_EXPORT_DTO -{ - /// - /// 结算单号 - /// - [Display(Name = "结算单号")] - [ExporterHeader(DisplayName = "结算单号")] - public string BillNum { set; get; } - - /// - /// 结算日期(收货日期) - /// - [Display(Name = "结算日期(收货日期)")] - [ExporterHeader(DisplayName = "Pstng Date")] - public DateTime SettleDate { set; get; } - - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "Material")] - public string LU { get; set; } - - /// - /// 数量 - /// - [Display(Name = "数量")] - [ExporterHeader(DisplayName = "Quantity")] - public decimal Qty { get; set; } - - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - [ExporterHeader(DisplayName = "External Delivery ID")] - public string PN { get; set; } - - /// - /// 结算分组 - /// - [Display(Name = "结算分组")] - [ExporterHeader(DisplayName = "Delivery")] - public string GroupNum { get; set; } -} - -/// -/// Pub结算与发运对比请求 -/// -public class PubSaSeCompareRequestDto -{ - /// - /// 期间 - /// - [Display(Name = "期间")] - [Required(ErrorMessage = "{0}不能为空")] - public string Version { get; set; } - - /// - /// 零件号 - /// - [Display(Name = "零件号")] - public string LU { get; set; } - - /// - /// 通用码 - /// - [Display(Name = "通用码")] - public string PN { get; set; } - - /// - /// 业务类型 - /// - public EnumBusinessType BusinessType { get; set; } - - /// - /// 发运开始时间 - /// - public DateTime? SeStartDateTime { get; set; } - - /// - /// 发运结束时间 - /// - public DateTime? SeEndDateTime { get; set; } -} - -public class JobRequestDto -{ - /// - /// 业务类别 - /// - public EnumBusinessType BusinessType { get; set; } - - //public Guid Id { get; set; } - - //public List ExportName { get; set; } - - //public List Propert { get; set; } + /// PUB结算 + /// + public class PUB_SA_DTO : EntityDto + { + /// + /// 期间 + /// + [Display(Name = "期间")] + public string Version { get; set; } + /// + /// 结算单据 + /// + [Display(Name = "结算单据")] + public string BillNum { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public string State { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public BusinessType BusinessType { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + public string Place { get; set; } + } + + /// + /// 查询 + /// + public class PUB_SARequestDto : RequestDto + { + /// + /// 业务类别 + /// + public EnumBusinessType BusinessType { get; set; } + } + + /// + /// 导入请求 + /// + public class PUB_SAImportRequestDto + { + /// + /// 文件 + /// + public IFormFileCollection Files { get; set; } + /// + /// 业务类别 + /// + public EnumBusinessType BusinessType { get; set; } + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + public string Site { get; set; } + } + + /// + /// 直供件BBAC导入 + /// + public class ZhiGongJianBBACImportDto + { + /// + /// 结算日期 + /// + [Display(Name = "Pstng Date")] + [ImporterHeader(Name = "Pstng Date")] + public DateTime SettleDate { set; get; } + /// + /// 客户零件号 + /// + [Display(Name = "Material")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "Material")] + public string LU { get; set; } + /// + /// 生产号 + /// + [Display(Name = "External Delivery ID")] + [ImporterHeader(Name = "External Delivery ID")] + [Required(ErrorMessage = "{0}不能为空")] + public string PN { get; set; } + /// + /// 数量 + /// + [Display(Name = "Quantity")] + [ImporterHeader(Name = "Quantity")] + public decimal Qty { get; set; } + /// + /// 结算分组号 + /// + [Display(Name = "External Delivery ID")] + [ImporterHeader(Name = "External Delivery ID")] + [Required(ErrorMessage = "{0}不能为空")] + public string GroupNum { get; set; } + /// + /// 根据Vendor=15663496过滤数据 + /// + [Display(Name = "Vendor")] + [ImporterHeader(Name = "Vendor")] + public string Vendor { get; set; } + } + + /// + /// 直供件HBPO导入 + /// + public class ZhiGongJianHBPOImportDto + { + /// + /// 结算日期 + /// + [Display(Name = "结算日期")] + [ImporterHeader(IsIgnore = true)] + public DateTime SettleDate { set; get; } + /// + /// 客户零件号 + /// + [Display(Name = "零件号")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "零件号")] + public string LU { get; set; } + /// + /// 生产号 + /// + [Display(Name = "订单编号")] + [ImporterHeader(Name = "订单编号")] + [Required(ErrorMessage = "{0}不能为空")] + public string PN { get; set; } + /// + /// 数量 + /// + [Display(Name = "数量")] + [ImporterHeader(Name = "数量")] + public decimal Qty { get; set; } + /// + /// 结算分组号 + /// + [Display(Name = "订单编号")] + [ImporterHeader(Name = "订单编号")] + [Required(ErrorMessage = "{0}不能为空")] + public string GroupNum { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [ImporterHeader(Name = "地点")] + [Required(ErrorMessage = "{0}不能为空")] + public string Place { get; set; } + } + + /// + /// 备件导入 + /// + public class BeiJianImportDto : BeiJianExtraImportDto + { + /// + /// 结算日期 + /// + [Display(Name = "结算日期")] + [ImporterHeader(Name = "零件时间")] + public DateTime SettleDate { set; get; } + + /// + /// 客户零件号 + /// + [Display(Name = "零件号")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "零件号")] + public string LU { get; set; } + + /// + /// 生产号 + /// + [Display(Name = "交付识别号")] + [ImporterHeader(Name = "交付识别号")] + [Required(ErrorMessage = "{0}不能为空")] + public string PN { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [ImporterHeader(Name = "数量")] + public decimal Qty { get; set; } + + /// + /// 结算分组号 + /// + [Display(Name = "凭证号")] + [ImporterHeader(Name = "凭证号")] + [Required(ErrorMessage = "{0}不能为空")] + public string GroupNum { get; set; } + + /// + /// 采购订单号 + /// + [Display(Name = "采购订单号")] + [ImporterHeader(Name = "采购订单号")] + public string Extend3 { get; set; } + } + + /// + /// 备件扩展 + /// + public class BeiJianExtraImportDto + { + /// + /// 交货号 + /// + [Display(Name = "交货号")] + [ImporterHeader(Name = "交货号")] + public string DeliveryNumber { set; get; } + + /// + /// 发票号 + /// + [Display(Name = "发票号")] + [ImporterHeader(Name = "发票号")] + public string InvoiceNumber { set; get; } + + /// + /// 开票日期 + /// + [Display(Name = "开票日期")] + [ImporterHeader(Name = "开票日期")] + public DateTime? MakeDate { set; get; } + + /// + /// 供应商代码 + /// + [Display(Name = "供应商代码")] + [ImporterHeader(Name = "供应商代码")] + public string VendorCode { set; get; } + + /// + /// 供应商名称 + /// + [Display(Name = "供应商名称")] + [ImporterHeader(Name = "供应商名称")] + public string VendorName { set; get; } + + /// + /// 交付索引号 + /// + [Display(Name = "交付索引号")] + [ImporterHeader(Name = "交付索引号")] + public string DeliveryIndexNumber { set; get; } + + /// + /// 零件名称 + /// + [Display(Name = "零件名称")] + [ImporterHeader(Name = "零件名称")] + public string PartName { set; get; } + + /// + /// 价格 + /// + [Display(Name = "价格")] + [ImporterHeader(Name = "价格")] + public decimal? Price { set; get; } + + /// + /// 金额 + /// + [Display(Name = "金额")] + [ImporterHeader(Name = "金额")] + public decimal? Amount { set; get; } + + /// + /// 税额 + /// + [Display(Name = "税额")] + [ImporterHeader(Name = "税额")] + public decimal? Tallage { set; get; } + + /// + /// 价税合计 + /// + [Display(Name = "价税合计")] + [ImporterHeader(Name = "价税合计")] + public decimal? Total { set; get; } + + /// + /// 协议编号 + /// + [Display(Name = "协议编号")] + [ImporterHeader(Name = "协议编号")] + public string ProtocolNumber { set; get; } + + /// + /// 备注 + /// + [Display(Name = "备注")] + [ImporterHeader(Name = "备注")] + public string Remark { set; get; } + + /// + /// 商品组 + /// + [Display(Name = "商品组")] + [ImporterHeader(Name = "商品组")] + public string CommodityGroup { set; get; } + } + + /// + /// 印度件导入 + /// + public class YinDuJianImportDto + { + /// + /// 结算日期 + /// + [Display(Name = "Delivery Date")] + [ImporterHeader(Name = "Delivery Date")] + public DateTime SettleDate { set; get; } + + /// + /// 客户零件号 + /// + [Display(Name = "Material")] + [Required(ErrorMessage = "{0}不能为空")] + [ImporterHeader(Name = "Material")] + public string LU { get; set; } + + /// + /// 生产号 + /// + [Display(Name = "External Delivery ID")] + [ImporterHeader(Name = "External Delivery ID")] + [Required(ErrorMessage = "{0}不能为空")] + public string PN { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [ImporterHeader(Name = "Item")] + public decimal Qty { get; set; } + + /// + /// 结算分组号 + /// + [Display(Name = "External Delivery ID")] + [ImporterHeader(Name = "External Delivery ID")] + [Required(ErrorMessage = "{0}不能为空")] + public string GroupNum { get; set; } + + /// + /// Supplier + /// + [Display(Name = "Supplier")] + [ImporterHeader(Name = "Supplier")] + public string Supplier { get; set; } + } + + /// + /// PUB结算明细 + /// + public class PUB_SA_DETAIL_DTO : AuditedAggregateRoot + { + /// + /// 结算单 + /// + public string BillNum { set; get; } + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 结算分组号 + /// + public string GroupNum { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 客户物料号 + /// + public string LU { get; set; } + /// + /// 数量 + /// + public string Qty { get; set; } + /// + /// 结算日期 + /// + public string SettleDate { set; get; } + /// + /// 单价 + /// + public decimal Price { set; get; } + /// + /// 厂内物料号 + /// + public string PartCode { get; set; } + } + + /// + /// 结算明细导出请求 + /// + public class PUB_SA_DETAIL_EXPORT_REQUEST_DTO + { + /// + /// 结算单号 + /// + [Display(Name = "结算单号")] + [Required(ErrorMessage = "{0}不能为空")] + public string BillNum { set; get; } + } + + /// + /// 结算明细导出 + /// + public class PUB_SA_DETAIL_EXPORT_DTO + { + /// + /// 结算单号 + /// + [Display(Name = "结算单号")] + [ExporterHeader(DisplayName = "结算单号")] + public string BillNum { set; get; } + + /// + /// 结算日期(收货日期) + /// + [Display(Name = "结算日期(收货日期)")] + [ExporterHeader(DisplayName = "Pstng Date")] + public DateTime SettleDate { set; get; } + + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "Material")] + public string LU { get; set; } + + /// + /// 数量 + /// + [Display(Name = "数量")] + [ExporterHeader(DisplayName = "Quantity")] + public decimal Qty { get; set; } + + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + [ExporterHeader(DisplayName = "External Delivery ID")] + public string PN { get; set; } + + /// + /// 结算分组 + /// + [Display(Name = "结算分组")] + [ExporterHeader(DisplayName = "Delivery")] + public string GroupNum { get; set; } + } + + /// + /// Pub结算与发运对比请求 + /// + public class PubSaSeCompareRequestDto + { + /// + /// 期间 + /// + [Display(Name = "期间")] + [Required(ErrorMessage = "{0}不能为空")] + public string Version { get; set; } + + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + + /// + /// 通用码 + /// + [Display(Name = "通用码")] + public string PN { get; set; } + + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + + /// + /// 发运开始时间 + /// + public DateTime? SeStartDateTime { get; set; } + + /// + /// 发运结束时间 + /// + public DateTime? SeEndDateTime { get; set; } + } + + public class JobRequestDto + { + /// + /// 业务类别 + /// + public EnumBusinessType BusinessType { get; set; } + + //public Guid Id { get; set; } + + //public List ExportName { get; set; } + + //public List Propert { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs index c2313e59..7f9a0da7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs @@ -5,385 +5,386 @@ using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// PUB发运数据 -/// -public class PUB_SE_DETAIL_DTO : EntityDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 期间 - /// - public int Version { set; get; } - /// - /// 发货时间 - /// - public DateTime ShippingDate { set; get; } - /// - /// 发运单号 - /// - public string WmsBillNum { set; get; } - /// - /// 客户零件号 - /// - public string LU { get; set; } - /// - /// 厂内零件号 - /// - public string FactoryPartCode { get; set; } - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 组合键值(PN+LU) - /// - public string KeyCode { get; set; } - /// - /// 数量 - /// - public decimal Qty { get; set; } - /// - /// UID - /// - [Display(Name = "UID")] - [DisplayName("UID")] - public long UID { get; set; } - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - public string BillNum { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - public DateTime BillTime { get; set; } - /// - /// 订单时间 - /// - [Display(Name = "订单时间")] - public DateTime AssembleData { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - public string PartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - public string Batch { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - public string CustPartCode { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - public string Oper { get; set; } - /// - /// DN单据号 - /// - [Display(Name = "DN单据号")] - public string DnBillNum { get; set; } - /// - /// DN单据时间 - /// - [Display(Name = "DN单据时间")] - public DateTime DnBillTime { get; set; } - /// - /// DN单添加人 - /// - [Display(Name = "DN单添加人")] - public string DnOper { get; set; } - /// - /// 交付索引 - /// - [Display(Name = "交付索引")] - public string DeliveryIndex { get; set; } - /// - /// 客户 - /// - [Display(Name = "客户")] - public string CustId { get; set; } - /// - /// 发货仓库 - /// - [Display(Name = "发货仓库")] - public string DeliveryHose { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - public string FromLocCode { get; set; } - /// - /// 来源仓库 - /// - [Display(Name = "来源仓库")] - public string FromHose { get; set; } - /// - /// 来源ERP库存 - /// - [Display(Name = "来源ERP库存")] - public string FromErpLocCode { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - public string ToLocCode { get; set; } - /// - /// 目标仓库 - /// - [Display(Name = "目标仓库")] - public string ToHose { get; set; } - /// - /// 目标Erp库位 - /// - [Display(Name = "目标Erp库位")] - public string ToErpLocCode { get; set; } - /// - /// 状态 - /// - [Display(Name = "状态")] - public EnumBillState State { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - public string Remark { get; set; } - /// - /// 单据类型 - /// - [Display(Name = "单据类型")] - public EnumBillType BillType { get; set; } - /// - /// 子单据类型 - /// - [Display(Name = "子单据类型")] - public EnumSubBillType SubBillType { get; set; } - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumProTpe ProType { get; set; } - /// - /// 事务类型 - /// - [Display(Name = "事务类型")] - public EnumDelTransType TransType { get; set; } - /// - /// 发运主类型 - /// - [Display(Name = "发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } - /// - /// 发运子类型 - /// - [Display(Name = "发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } - /// - /// 创建时间 - /// - [Display(Name = "创建时间")] - public DateTime CreateTime { get; set; } -} + /// PUB发运数据 + /// + public class PUB_SE_DETAIL_DTO : EntityDto + { + /// + /// 期间 + /// + public int Version { set; get; } + /// + /// 发货时间 + /// + public DateTime ShippingDate { set; get; } + /// + /// 发运单号 + /// + public string WmsBillNum { set; get; } + /// + /// 客户零件号 + /// + public string LU { get; set; } + /// + /// 厂内零件号 + /// + public string FactoryPartCode { get; set; } + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 组合键值(PN+LU) + /// + public string KeyCode { get; set; } + /// + /// 数量 + /// + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime BillTime { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string PartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + public string Oper { get; set; } + /// + /// DN单据号 + /// + [Display(Name = "DN单据号")] + public string DnBillNum { get; set; } + /// + /// DN单据时间 + /// + [Display(Name = "DN单据时间")] + public DateTime DnBillTime { get; set; } + /// + /// DN单添加人 + /// + [Display(Name = "DN单添加人")] + public string DnOper { get; set; } + /// + /// 交付索引 + /// + [Display(Name = "交付索引")] + public string DeliveryIndex { get; set; } + /// + /// 客户 + /// + [Display(Name = "客户")] + public string CustId { get; set; } + /// + /// 发货仓库 + /// + [Display(Name = "发货仓库")] + public string DeliveryHose { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + public string FromLocCode { get; set; } + /// + /// 来源仓库 + /// + [Display(Name = "来源仓库")] + public string FromHose { get; set; } + /// + /// 来源ERP库存 + /// + [Display(Name = "来源ERP库存")] + public string FromErpLocCode { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + public string ToLocCode { get; set; } + /// + /// 目标仓库 + /// + [Display(Name = "目标仓库")] + public string ToHose { get; set; } + /// + /// 目标Erp库位 + /// + [Display(Name = "目标Erp库位")] + public string ToErpLocCode { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public EnumBillState State { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + public string Remark { get; set; } + /// + /// 单据类型 + /// + [Display(Name = "单据类型")] + public EnumBillType BillType { get; set; } + /// + /// 子单据类型 + /// + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// 事务类型 + /// + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } + /// + /// 发运主类型 + /// + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } + } -/// -/// 查询 -/// -public class PUB_SE_DETAIL_RequestDto : RequestDto -{ /// - /// 业务类别 + /// 查询 /// - public EnumBusinessType BusinessType { get; set; } -} + public class PUB_SE_DETAIL_RequestDto : RequestDto + { + /// + /// 业务类别 + /// + public EnumBusinessType BusinessType { get; set; } + } -/// -/// 导出 -/// -public class PUB_SE_DETAIL_EXPORT_DTO -{ - /// - /// 期间 - /// - [ExporterHeader(DisplayName = "期间")] - public int Version { set; get; } - /// - /// 发货时间 - /// - [ExporterHeader(DisplayName = "发货时间")] - public DateTime ShippingDate { set; get; } - /// - /// 发运单号 - /// - [ExporterHeader(DisplayName = "发运单号")] - public string WmsBillNum { set; get; } - /// - /// 客户零件号 - /// - [ExporterHeader(DisplayName = "客户零件号")] - public string LU { get; set; } - /// - /// 厂内零件号 - /// - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } /// - /// 生产号 - /// - [ExporterHeader(DisplayName = "生产号")] - public string PN { get; set; } - /// - /// 组合键值(PN+LU) - /// - [ExporterHeader(DisplayName = "组合键值")] - public string KeyCode { get; set; } - /// - /// 数量 - /// - [ExporterHeader(DisplayName = "数量")] - public decimal Qty { get; set; } - /// - /// UID - /// - [Display(Name = "UID")] - [ExporterHeader(DisplayName = "UID")] - public long UID { get; set; } - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - [ExporterHeader(DisplayName = "发货单号")] - public string BillNum { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - [ExporterHeader(DisplayName = "发货时间")] - public DateTime BillTime { get; set; } - /// - /// 订单时间 - /// - [Display(Name = "订单时间")] - [ExporterHeader(DisplayName = "订单时间")] - public DateTime AssembleData { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "零件号")] - public string PartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - [ExporterHeader(DisplayName = "批次")] - public string Batch { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - [ExporterHeader(DisplayName = "客户零件号")] - public string CustPartCode { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - [ExporterHeader(DisplayName = "发货人")] - public string Oper { get; set; } - /// - /// DN单据号 - /// - [Display(Name = "DN单据号")] - [ExporterHeader(DisplayName = "DN单据号")] - public string DnBillNum { get; set; } - /// - /// DN单据时间 - /// - [Display(Name = "DN单据时间")] - [ExporterHeader(DisplayName = "DN单据时间")] - public DateTime DnBillTime { get; set; } - /// - /// DN单添加人 - /// - [Display(Name = "DN单添加人")] - [ExporterHeader(DisplayName = "DN单添加人")] - public string DnOper { get; set; } - /// - /// 交付索引 - /// - [Display(Name = "交付索引")] - [ExporterHeader(DisplayName = "交付索引")] - public string DeliveryIndex { get; set; } - /// - /// 客户 - /// - [Display(Name = "客户")] - [ExporterHeader(DisplayName = "客户")] - public string CustId { get; set; } - /// - /// 发货仓库 - /// - [Display(Name = "发货仓库")] - [ExporterHeader(DisplayName = "发货仓库")] - public string DeliveryHose { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - [ExporterHeader(DisplayName = "来源库位")] - public string FromLocCode { get; set; } - /// - /// 来源仓库 - /// - [Display(Name = "来源仓库")] - [ExporterHeader(DisplayName = "来源仓库")] - public string FromHose { get; set; } - /// - /// 来源ERP库存 - /// - [Display(Name = "来源ERP库存")] - [ExporterHeader(DisplayName = "来源ERP库存")] - public string FromErpLocCode { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - [ExporterHeader(DisplayName = "目标库位")] - public string ToLocCode { get; set; } - /// - /// 目标仓库 - /// - [Display(Name = "目标仓库")] - [ExporterHeader(DisplayName = "目标仓库")] - public string ToHose { get; set; } - /// - /// 目标Erp库位 - /// - [Display(Name = "目标Erp库位")] - [ExporterHeader(DisplayName = "目标Erp库位")] - public string ToErpLocCode { get; set; } - /// - /// 状态 - /// - [Display(Name = "状态")] - [ExporterHeader(DisplayName = "状态")] - public EnumBillState State { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - [ExporterHeader(DisplayName = "备注")] - public string Remark { get; set; } - /// - /// 创建时间 - /// - [Display(Name = "创建时间")] - [ExporterHeader(DisplayName = "创建时间")] - public DateTime CreateTime { get; set; } + /// 导出 + /// + public class PUB_SE_DETAIL_EXPORT_DTO + { + /// + /// 期间 + /// + [ExporterHeader(DisplayName = "期间")] + public int Version { set; get; } + /// + /// 发货时间 + /// + [ExporterHeader(DisplayName = "发货时间")] + public DateTime ShippingDate { set; get; } + /// + /// 发运单号 + /// + [ExporterHeader(DisplayName = "发运单号")] + public string WmsBillNum { set; get; } + /// + /// 客户零件号 + /// + [ExporterHeader(DisplayName = "客户零件号")] + public string LU { get; set; } + /// + /// 厂内零件号 + /// + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } + /// + /// 生产号 + /// + [ExporterHeader(DisplayName = "生产号")] + public string PN { get; set; } + /// + /// 组合键值(PN+LU) + /// + [ExporterHeader(DisplayName = "组合键值")] + public string KeyCode { get; set; } + /// + /// 数量 + /// + [ExporterHeader(DisplayName = "数量")] + public decimal Qty { get; set; } + /// + /// UID + /// + [Display(Name = "UID")] + [ExporterHeader(DisplayName = "UID")] + public long UID { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + [ExporterHeader(DisplayName = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + [ExporterHeader(DisplayName = "发货时间")] + public DateTime BillTime { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + [ExporterHeader(DisplayName = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "零件号")] + public string PartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + [ExporterHeader(DisplayName = "批次")] + public string Batch { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + [ExporterHeader(DisplayName = "发货人")] + public string Oper { get; set; } + /// + /// DN单据号 + /// + [Display(Name = "DN单据号")] + [ExporterHeader(DisplayName = "DN单据号")] + public string DnBillNum { get; set; } + /// + /// DN单据时间 + /// + [Display(Name = "DN单据时间")] + [ExporterHeader(DisplayName = "DN单据时间")] + public DateTime DnBillTime { get; set; } + /// + /// DN单添加人 + /// + [Display(Name = "DN单添加人")] + [ExporterHeader(DisplayName = "DN单添加人")] + public string DnOper { get; set; } + /// + /// 交付索引 + /// + [Display(Name = "交付索引")] + [ExporterHeader(DisplayName = "交付索引")] + public string DeliveryIndex { get; set; } + /// + /// 客户 + /// + [Display(Name = "客户")] + [ExporterHeader(DisplayName = "客户")] + public string CustId { get; set; } + /// + /// 发货仓库 + /// + [Display(Name = "发货仓库")] + [ExporterHeader(DisplayName = "发货仓库")] + public string DeliveryHose { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + [ExporterHeader(DisplayName = "来源库位")] + public string FromLocCode { get; set; } + /// + /// 来源仓库 + /// + [Display(Name = "来源仓库")] + [ExporterHeader(DisplayName = "来源仓库")] + public string FromHose { get; set; } + /// + /// 来源ERP库存 + /// + [Display(Name = "来源ERP库存")] + [ExporterHeader(DisplayName = "来源ERP库存")] + public string FromErpLocCode { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + [ExporterHeader(DisplayName = "目标库位")] + public string ToLocCode { get; set; } + /// + /// 目标仓库 + /// + [Display(Name = "目标仓库")] + [ExporterHeader(DisplayName = "目标仓库")] + public string ToHose { get; set; } + /// + /// 目标Erp库位 + /// + [Display(Name = "目标Erp库位")] + [ExporterHeader(DisplayName = "目标Erp库位")] + public string ToErpLocCode { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + [ExporterHeader(DisplayName = "状态")] + public EnumBillState State { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + [ExporterHeader(DisplayName = "备注")] + public string Remark { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + [ExporterHeader(DisplayName = "创建时间")] + public DateTime CreateTime { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs index a139c935..5ef27817 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PURCHASE_PRICE_DTO.cs @@ -3,63 +3,64 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; -namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos; - -/// -/// 采购价格单 -/// -public class PURCHASE_PRICE_DTO : EntityDto +namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { /// - /// 零件号 + /// 采购价格单 /// - [Display(Name = "零件号")] - public string LU { get; set; } + public class PURCHASE_PRICE_DTO : EntityDto + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } - /// - /// 价格 - /// - [Display(Name = "价格")] - public decimal Price { get; set; } -} + /// + /// 价格 + /// + [Display(Name = "价格")] + public decimal Price { get; set; } + } -/// -/// 导入 -/// -public class PURCHASE_PRICE_IMPORT_DTO -{ /// - /// 零件号 + /// 导入 /// - [Display(Name = "零件号")] - [Required(ErrorMessage = "{0}是必填项")] - [ImporterHeader(Name = "零件号")] - public string LU { get; set; } + public class PURCHASE_PRICE_IMPORT_DTO + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [Required(ErrorMessage = "{0}是必填项")] + [ImporterHeader(Name = "零件号")] + public string LU { get; set; } - /// - /// 价格 - /// - [Display(Name = "价格")] - [ImporterHeader(Name = "价格")] - public decimal Price { get; set; } -} + /// + /// 价格 + /// + [Display(Name = "价格")] + [ImporterHeader(Name = "价格")] + public decimal Price { get; set; } + } -/// -/// 导出 -/// -public class PURCHASE_PRICE_EXPORT_DTO -{ /// - /// 零件号 + /// 导出 /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "零件号")] - public string LU { get; set; } + public class PURCHASE_PRICE_EXPORT_DTO + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "零件号")] + public string LU { get; set; } - /// - /// 价格 - /// - [Display(Name = "价格")] - [ExporterHeader(DisplayName = "价格")] - public decimal Price { get; set; } + /// + /// 价格 + /// + [Display(Name = "价格")] + [ExporterHeader(DisplayName = "价格")] + public decimal Price { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs index d01a0557..46248a9d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/RequestDto.cs @@ -1,4 +1,4 @@ -using Win.Sfs.Shared.DtoBase; +using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/SaSeCompareRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/SaSeCompareRequestDto.cs index 0636012c..a9c63ec7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/SaSeCompareRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/SaSeCompareRequestDto.cs @@ -1,51 +1,52 @@ using System; using System.ComponentModel.DataAnnotations; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// 结算与发运对比请求Dto -/// -public class SaSeCompareRequestDto +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// 期间 - /// - [Display(Name = "期间")] - [Required(ErrorMessage = "{0}不能为空")] - public string Version { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - public string LU { get; set; } - /// - /// 通用码 - /// - [Display(Name = "通用码")] - public string PN { get; set; } - /// - /// 发运开始时间 - /// - [Display(Name = "发运开始时间")] - public DateTime? SeStartDateTime { get; set; } - /// - /// 发运结束时间 - /// - [Display(Name = "发运结束时间")] - public DateTime? SeEndDateTime { get; set; } - /// - /// 下线开始时间 - /// - [Display(Name = "下线开始时间")] - public DateTime? DownLineStartDateTime { get; set; } - /// - /// 下线结束时间 - /// - [Display(Name = "下线结束时间")] - public DateTime? DownLineEndDateTime { get; set; } - /// - /// 业务类型 - /// - public EnumBusinessType BusinessType { get; set; } + /// 结算与发运对比请求Dto + /// + public class SaSeCompareRequestDto + { + /// + /// 期间 + /// + [Display(Name = "期间")] + [Required(ErrorMessage = "{0}不能为空")] + public string Version { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + /// + /// 通用码 + /// + [Display(Name = "通用码")] + public string PN { get; set; } + /// + /// 发运开始时间 + /// + [Display(Name = "发运开始时间")] + public DateTime? SeStartDateTime { get; set; } + /// + /// 发运结束时间 + /// + [Display(Name = "发运结束时间")] + public DateTime? SeEndDateTime { get; set; } + /// + /// 下线开始时间 + /// + [Display(Name = "下线开始时间")] + public DateTime? DownLineStartDateTime { get; set; } + /// + /// 下线结束时间 + /// + [Display(Name = "下线结束时间")] + public DateTime? DownLineEndDateTime { get; set; } + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs index ab4bb7b7..abb14131 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/TB_RePartsRelationship_DTO.cs @@ -1,6 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs index 90e2de45..c3d52baf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_BA_SERVICE.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Win.Sfs.SettleAccount.Boms; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -12,7 +7,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public interface IBBAC_BA_SERVICE { - Task GenerateInvoice(INVOICE_GRP_REQ_DTO input); Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input); @@ -21,15 +15,5 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Task RejectAsync(INVOICE_GRP_REQ_DTO input); - - - - - - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_CAN_SA_SERVICE.cs index 11fc8be3..101f4b6b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_CAN_SA_SERVICE.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.DependencyInjection; @@ -9,14 +5,12 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ { - public interface IBBAC_CAN_SA_SERVICE:ITransientDependency + public interface IBBAC_CAN_SA_SERVICE : ITransientDependency { Task GenerateInvoice(BBAC_CAN_SA_REQ_DTO input); Task> MainQueryAsync(BBAC_CAN_SA_REQ_DTO input); Task> DetailQueryAsync(BBAC_CAN_SA_DETAIL_REQ_DTO input); Task ExportAsync(BBAC_CAN_SA_REQ_DTO input); - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_NOT_SA_SERVICE.cs index d8cae972..464524a3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_NOT_SA_SERVICE.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_PD_SERVICE.cs index a2eb34a6..c575b5aa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_PD_SERVICE.cs @@ -1,17 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Win.Sfs.SettleAccount.Entities.BQ.Dtos; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IBBAC_PD_SERVICE { - //Task GenerateInvoice(BBAC_CAN_SA_REQ_DTO input); //Task> MainQueryAsync(BBAC_CAN_SA_REQ_DTO input); //Task> DetailQueryAsync(BBAC_CAN_SA_DETAIL_REQ_DTO input); @@ -20,10 +11,5 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //Task ExportAsync(BBAC_CAN_SA_REQ_DTO input); - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_SE_EDI_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_SE_EDI_SERVICE.cs index 1f9ab0d4..cef33586 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_SE_EDI_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IBBAC_SE_EDI_SERVICE.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IBBAC_SE_EDI_SERVICE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_BA_SERVICE.cs index 67473c61..eaa4c584 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_BA_SERVICE.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IHBPO_BA_SERVICE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_CAN_SA_SERVICE.cs index 6c43009e..16a0a4e3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_CAN_SA_SERVICE.cs @@ -1,23 +1,18 @@ -using SettleAccount.Bases; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using SettleAccount.Bases; using Volo.Abp.Application.Dtos; -using Volo.Abp.Domain.Entities; -using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; namespace Win.Sfs.SettleAccount.Entities.BQ { public interface ICAN_SA_SERVICE - where TEntity : SA_CAN_BASE + where TEntity : SA_CAN_BASE where TEntityDto : class, IEntityDto, new() where TEntityDetailDto : class, IEntityDto, new() where TRequestMainInput : PagedAndSortedResultRequestDto where TRequestDetailInput : PagedAndSortedResultRequestDto - + { Task GenerateInvoice(TRequestMainInput input); @@ -25,13 +20,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Task> DetailQueryAsync(TRequestDetailInput input); Task ExportAsync(TRequestMainInput input); - - - // List ISettlementOrderCheckRule(List p_list, Configuation config) where TEntity : ISABASE - //bList ISettlementOrderCheckState(List p_list) where TEntity:ISABASE - - - + // List ISettlementOrderCheckRule(List p_list, Configuation config) where TEntity : ISABASE + //bList ISettlementOrderCheckState(List p_list) where TEntity:ISABASE } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_NOT_SA_SERVICE.cs index 973f3927..b7215f1d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_NOT_SA_SERVICE.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_PD_SERVICE.cs index bb4aa48b..a71235d0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_PD_SERVICE.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IHBPO_PD_SERVICE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_SE_EDI_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_SE_EDI_SERVICE.cs index 5388cebb..9f5fe71b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_SE_EDI_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IHBPO_SE_EDI_SERVICE.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IHBPO_SE_EDI_SERVICE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs index adf9dfb2..737a1146 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IINVOICE_SERVICE.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -16,7 +12,5 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input); Task ExportAsync(INVOICE_GRP_REQ_DTO input); - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs index d0d5d692..04fe8072 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_BA_SERVICE.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IPUB_BA_SERVICE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_CAN_SA_SERVICE.cs index 6c50ad2a..4f4c605d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_CAN_SA_SERVICE.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_NOT_SA_SERVICE.cs index 1f284a5f..5a368519 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_NOT_SA_SERVICE.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_PD_SERVICE.cs index 10bce60c..1fa8b6a5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/IPUB_PD_SERVICE.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.BQ { public interface IPUB_PD_SERVICE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateDto.cs index fd3fa78c..95738ad3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateDto.cs @@ -1,16 +1,15 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Boms { public class BomCreateDto : BomCreateOrUpdateDtoBase, IBranch { - + [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] public Guid BranchId { set; get; } @@ -21,6 +20,6 @@ namespace Win.Sfs.SettleAccount.Boms [Display(Name = "组件编码")] [Required(ErrorMessage = "{0}是必填项")] - public string ChildItemCode { get; set; } + public string ChildItemCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateOrUpdateDtoBase.cs index cbfd6e8b..8bcc09a7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomCreateOrUpdateDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -8,23 +8,20 @@ using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Boms { - public class BomCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class BomCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { [Display(Name = "父物料描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ParentItemDesc { get; set; } - [Display(Name = "组件描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ChildItemDesc { get; set; } - [Display(Name = "组件计量单位")] public string ChildItemUom { get; set; } - [Display(Name = "组件数量")] [Required(ErrorMessage = "{0}是必填项")] public decimal Qty { get; set; } @@ -32,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Boms [Display(Name = "工序")] public int OperateProcess { get; set; } - [Display(Name = "废品率")] public decimal ScrapPercent { get; set; } @@ -55,4 +51,4 @@ namespace Win.Sfs.SettleAccount.Boms public bool Enabled { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomDto.cs index 26537991..a0b760bf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomDto.cs @@ -2,76 +2,77 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -namespace Win.Sfs.SettleAccount.Boms; - -/// -/// Bom -/// -public class BomDto : EntityDto +namespace Win.Sfs.SettleAccount.Boms { /// - /// 父物料编码 + /// Bom /// - [Display(Name = "父物料编码")] - public string ParentItemCode { get; set; } + public class BomDto : EntityDto + { + /// + /// 父物料编码 + /// + [Display(Name = "父物料编码")] + public string ParentItemCode { get; set; } - /// - /// 父物料描述 - /// - [Display(Name = "父物料描述")] - public string ParentItemDesc { get; set; } + /// + /// 父物料描述 + /// + [Display(Name = "父物料描述")] + public string ParentItemDesc { get; set; } - /// - /// 组件编码 - /// - [Display(Name = "组件编码")] - public string ChildItemCode { get; set; } + /// + /// 组件编码 + /// + [Display(Name = "组件编码")] + public string ChildItemCode { get; set; } - /// - /// 组件描述 - /// - [Display(Name = "组件描述")] - public string ChildItemDesc { get; set; } + /// + /// 组件描述 + /// + [Display(Name = "组件描述")] + public string ChildItemDesc { get; set; } - /// - /// 组件计量单位 - /// - [Display(Name = "组件计量单位")] - public string ChildItemUom { get; set; } + /// + /// 组件计量单位 + /// + [Display(Name = "组件计量单位")] + public string ChildItemUom { get; set; } - /// - /// 组件数量 - /// - [Display(Name = "组件数量")] - public decimal Qty { get; set; } + /// + /// 组件数量 + /// + [Display(Name = "组件数量")] + public decimal Qty { get; set; } - /// - /// 结构类型 - /// - [Display(Name = "结构类型")] - public string BomType { get; set; } + /// + /// 结构类型 + /// + [Display(Name = "结构类型")] + public string BomType { get; set; } - /// - /// 工序 - /// - [Display(Name = "工序")] - public int OperateProcess { get; set; } + /// + /// 工序 + /// + [Display(Name = "工序")] + public int OperateProcess { get; set; } - /// - /// 废品率 - /// - [Display(Name = "废品率")] - public decimal ScrapPercent { get; set; } + /// + /// 废品率 + /// + [Display(Name = "废品率")] + public decimal ScrapPercent { get; set; } - /// - /// 子物品消耗位置 - /// - [Display(Name = "子物品消耗位置")] - public string IssuePosition { get; set; } + /// + /// 子物品消耗位置 + /// + [Display(Name = "子物品消耗位置")] + public string IssuePosition { get; set; } - /// - /// 结构层级 - /// - [Display(Name = "结构层级")] - public int BomLevel { get; set; } + /// + /// 结构层级 + /// + [Display(Name = "结构层级")] + public int BomLevel { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomExportDto.cs index 1f2e1f56..6a478f49 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomExportDto.cs @@ -1,87 +1,88 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; -namespace Win.Sfs.SettleAccount.Entities.Boms; - -/// -/// Bom导出 -/// -public class BomExportDto +namespace Win.Sfs.SettleAccount.Entities.Boms { /// - /// 父物料编码 + /// Bom导出 /// - [Display(Name = "父物料编码")] - [ExporterHeader(DisplayName = "父物料编码")] - public string ParentItemCode { get; set; } + public class BomExportDto + { + /// + /// 父物料编码 + /// + [Display(Name = "父物料编码")] + [ExporterHeader(DisplayName = "父物料编码")] + public string ParentItemCode { get; set; } - /// - /// 父物料描述 - /// - [Display(Name = "父物料描述")] - [ExporterHeader(DisplayName = "父物料描述")] - public string ParentItemDesc { get; set; } + /// + /// 父物料描述 + /// + [Display(Name = "父物料描述")] + [ExporterHeader(DisplayName = "父物料描述")] + public string ParentItemDesc { get; set; } - /// - /// 组件编码 - /// - [Display(Name = "组件编码")] - [ExporterHeader(DisplayName = "组件编码")] - public string ChildItemCode { get; set; } + /// + /// 组件编码 + /// + [Display(Name = "组件编码")] + [ExporterHeader(DisplayName = "组件编码")] + public string ChildItemCode { get; set; } - /// - /// 组件描述 - /// - [Display(Name = "组件描述")] - [ExporterHeader(DisplayName = "组件描述")] - public string ChildItemDesc { get; set; } + /// + /// 组件描述 + /// + [Display(Name = "组件描述")] + [ExporterHeader(DisplayName = "组件描述")] + public string ChildItemDesc { get; set; } - /// - /// 组件计量单位 - /// - [Display(Name = "组件计量单位")] - [ExporterHeader(DisplayName = "组件计量单位")] - public string ChildItemUom { get; set; } + /// + /// 组件计量单位 + /// + [Display(Name = "组件计量单位")] + [ExporterHeader(DisplayName = "组件计量单位")] + public string ChildItemUom { get; set; } - /// - /// 组件数量 - /// - [Display(Name = "组件数量")] - [ExporterHeader(DisplayName = "组件数量")] - public decimal Qty { get; set; } + /// + /// 组件数量 + /// + [Display(Name = "组件数量")] + [ExporterHeader(DisplayName = "组件数量")] + public decimal Qty { get; set; } - /// - /// 结构类型 - /// - [Display(Name = "结构类型")] - [ExporterHeader(DisplayName = "结构类型")] - public string BomType { get; set; } + /// + /// 结构类型 + /// + [Display(Name = "结构类型")] + [ExporterHeader(DisplayName = "结构类型")] + public string BomType { get; set; } - /// - /// 工序 - /// - [Display(Name = "工序")] - [ExporterHeader(DisplayName = "工序")] - public int OperateProcess { get; set; } + /// + /// 工序 + /// + [Display(Name = "工序")] + [ExporterHeader(DisplayName = "工序")] + public int OperateProcess { get; set; } - /// - /// 废品率 - /// - [Display(Name = "废品率")] - [ExporterHeader(DisplayName = "废品率")] - public decimal ScrapPercent { get; set; } + /// + /// 废品率 + /// + [Display(Name = "废品率")] + [ExporterHeader(DisplayName = "废品率")] + public decimal ScrapPercent { get; set; } - /// - /// 子物品消耗位置 - /// - [Display(Name = "子物品消耗位置")] - [ExporterHeader(DisplayName = "子物品消耗位置")] - public string IssuePosition { get; set; } + /// + /// 子物品消耗位置 + /// + [Display(Name = "子物品消耗位置")] + [ExporterHeader(DisplayName = "子物品消耗位置")] + public string IssuePosition { get; set; } - /// - /// 结构层级 - /// - [Display(Name = "结构层级")] - [ExporterHeader(DisplayName = "结构层级")] - public int BomLevel { get; set; } + /// + /// 结构层级 + /// + [Display(Name = "结构层级")] + [ExporterHeader(DisplayName = "结构层级")] + public int BomLevel { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomRequestDto.cs index 588bf3d5..3a64ed49 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomRequestDto.cs @@ -1,4 +1,4 @@ -using Win.Sfs.Shared.DtoBase; +using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Boms { @@ -6,4 +6,4 @@ namespace Win.Sfs.SettleAccount.Boms { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomUpdateDto.cs index 41e145ce..3321bba9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomUpdateDto.cs @@ -1,16 +1,12 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; -using Volo.Abp.ObjectExtending; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Boms { - public class BomUpdateDto : BomCreateOrUpdateDtoBase, IHasConcurrencyStamp + public class BomUpdateDto : BomCreateOrUpdateDtoBase, IHasConcurrencyStamp { public string ConcurrencyStamp { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomVersionDtoBase.cs index 1e960aed..67ec7ef1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/BomVersionDtoBase.cs @@ -1,16 +1,14 @@ - + using System; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.Boms -{ +{ /// /// BomVersion /// -public class BomVersionDtoBase :CreateOrUpdateEntityDtoBase + public class BomVersionDtoBase : CreateOrUpdateEntityDtoBase { public string Year { get; private set; } @@ -28,31 +26,27 @@ public class BomVersionDtoBase :CreateOrUpdateEntityDtoBase /// public string CustomerCode { private set; get; } - } - - public class BomVersionDto : AuditedEntityDtoBase, IBranch { public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// public string CustomerCode { set; get; } - public string Factory { set; get; } - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } } public class BomVersionCreateDto : BomVersionDtoBase @@ -76,10 +70,10 @@ public class BomVersionDtoBase :CreateOrUpdateEntityDtoBase /// 客户号 /// public string CustomerCode { private set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } - public class BomVersionImportDto + public class BomVersionImportDto { public string Year { get; private set; } @@ -97,8 +91,6 @@ public class BomVersionDtoBase :CreateOrUpdateEntityDtoBase /// public string CustomerCode { private set; get; } - } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/IBomAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/IBomAppService.cs index aa60d416..df5391f5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/IBomAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/IBomAppService.cs @@ -1,125 +1,101 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.Boms; -using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.Boms { - public interface IBomAppService + public interface IBomAppService { /// - /// 빦 + /// 导入功能 /// - /// ϴļ(ǰѾֻϴһ) + /// 上传的文件(前端已经限制只能上传一个附件) /// - Task BomUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory); - - - + Task BomUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory); /// - /// IDȡΨһʵ + /// 按ID获取唯一实体 /// /// - /// ʵȫ + /// 返回实体全部属性 /// /// ID - /// ʵDTO + /// 实体DTO Task GetAsync(Guid id); /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб + /// 请求条件 + /// 实体DTO列表 Task> GetListAsync(Guid parentId, BomRequestDto input); - - - /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб + /// 请求条件 + /// 实体DTO列表 Task> GetVersionListAsync(BomVersionRequestDto input); - - - /// - /// ȡʵ + /// 获取实体总数 /// - /// ʵ + /// 实体总数 Task GetTotalCountAsync(Guid branchId); - /// - /// ȡȫʵб + /// 获取全部实体列表 /// - /// ʵDTOб + /// 实体DTO列表 //Task> GetAllAsync(Guid branchId); - - - - ///// - ///// ʵ + ///// 新增实体 ///// - ///// ʵDTO - ///// ʵDTO - + ///// 新增实体DTO + ///// 实体DTO //Task CreateAsync(BomCreateDto input); - ///// - ///// ޸ʵ + ///// 修改实体 ///// ///// ID - ///// ޸ʵDTO - ///// ʵDTO + ///// 修改实体DTO + ///// 实体DTO //Task UpdateAsync(Guid id, BomUpdateDto input); - - - ///// - ///// ɾʵ + ///// 删除实体 ///// ///// ID - ///// + ///// //Task DeleteAsync(Guid id); - /// - /// IDsɾʵб + /// 按IDs删除实体列表 /// /// IDs - /// Ƿִгɹ + /// 是否执行成功 Task DeleteListAsync(List ids); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/ImportBomDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/ImportBomDto.cs index d95038dd..d67a70f1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/ImportBomDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Boms/ImportBomDto.cs @@ -1,13 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com +using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Boms { @@ -18,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Boms /// [ImportProject(Name = SettleAccountModuleName.Bom)] [ExcelImporter(IsLabelingError = true, MaxCount = int.MaxValue)] - public class ImportBomDto + public class ImportBomDto { ///// ///// 分支id @@ -42,13 +39,10 @@ namespace Win.Sfs.SettleAccount.Boms [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ParentItemCode { get; set; } - - - [ImporterHeader(Name = "父物料描述")] + [ImporterHeader(Name = "父物料描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ParentItemDesc { get; set; } - [ImporterHeader(Name = "组件", FixAllSpace = true)] [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] @@ -58,12 +52,10 @@ namespace Win.Sfs.SettleAccount.Boms [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ChildItemDesc { get; set; } - [ImporterHeader(Name = "组件数量")] [Required(ErrorMessage = "{0}是必填项")] - - public decimal Qty { get; set; } + public decimal Qty { get; set; } //[Display(Name = "工序")] //[Required(ErrorMessage = "{0}是必填项")] @@ -93,7 +85,5 @@ namespace Win.Sfs.SettleAccount.Boms public string ChildItemUom { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/CodeSettingDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/CodeSettingDtoBase.cs index 09750315..3b4190f4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/CodeSettingDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/CodeSettingDtoBase.cs @@ -1,21 +1,16 @@ -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 Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.CodeSettings { - - public class CodeSettingDtoBase : CreateOrUpdateEntityDtoBase + + public class CodeSettingDtoBase : CreateOrUpdateEntityDtoBase { /// /// 项目 @@ -44,7 +39,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings } public class CodeSettingUpdateDto : CodeSettingDtoBase { - + @@ -67,11 +62,11 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings /// 描述 /// public virtual string Description { set; get; } - public virtual Guid BranchId { get ; set ; } + public virtual Guid BranchId { get; set; } } public class CodeSettingDto : AuditedEntityDtoBase, IBranch { - + /// /// 项目 /// @@ -87,11 +82,11 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings /// 描述 /// public virtual string Description { set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } - [ImportProject(Name= SettleAccountModuleName.CodeSetting)] - public class CodeSettingImportDto + [ImportProject(Name = SettleAccountModuleName.CodeSetting)] + public class CodeSettingImportDto { /// /// 项目 @@ -117,13 +112,13 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings /// 描述 /// [ImporterHeader(Name = "描述")] - + [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] - + public virtual string Description { set; get; } - - + + } @@ -132,14 +127,14 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings public class CodeSettingExportDto { - + /// 项目 /// - [ExporterHeader(DisplayName = "项目")] + [ExporterHeader(DisplayName = "项目")] [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] @@ -149,7 +144,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings /// 值 /// /// 描述 /// - [ExporterHeader(DisplayName = "描述")] + [ExporterHeader(DisplayName = "描述")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/ICodeSettingAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/ICodeSettingAppService.cs index c0e1aa89..5f6ea8f7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/ICodeSettingAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/CodeSettingTables/ICodeSettingAppService.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables { - + public interface ICodeSettingAppService : ICrudAppService ///年度 /// - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 @@ -71,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls /// 是否开放状态 /// public bool State { set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } public class CentralizedControlImportDto { @@ -100,7 +96,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls /// /// 导出Dto /// - public class CentralizedControlExportDto + public class CentralizedControlExportDto { /// /// 年度 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/ICentralizedControlAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/ICentralizedControlAppService.cs index 79f6c19c..6e2a9bdd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/ICentralizedControlAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Controls/ICentralizedControlAppService.cs @@ -1,12 +1,8 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; -using Win.Sfs.Shared; using Win.Sfs.Shared.ApplicationBase; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.Controls { @@ -21,18 +17,10 @@ namespace Win.Sfs.SettleAccount.Entities.Controls { Task OpenVersion(List ids); - Task ClosedVersion(List ids); - - Task> GetOpenVersionList(); - - - } - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ERPShpping/ERPShppingDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ERPShpping/ERPShppingDto.cs index 60d87115..8725fbff 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ERPShpping/ERPShppingDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ERPShpping/ERPShppingDto.cs @@ -1,18 +1,13 @@ -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 Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.ERPShpping { - public class ERPShippingDetailDto + public class ERPShippingDetailDto { - [ImporterHeader(Name = "保管")] public string Person { set; get; } @@ -52,10 +47,9 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShpping [ImporterHeader(Name = "期间")] public string Version { get; set; } } - public class ERPShippingDetailRequestDto: RequestDtoBase, IBranch + public class ERPShippingDetailRequestDto : RequestDtoBase, IBranch { - [ImporterHeader(Name = "保管")] public string Person { set; get; } [ImporterHeader(Name = "成本")] @@ -70,12 +64,12 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShpping public decimal Qty { set; get; } [ImporterHeader(Name = "调出仓库")] public string Output { set; get; } - [ImporterHeader(Name = "调出仓库代码",IsIgnore =true)] + [ImporterHeader(Name = "调出仓库代码", IsIgnore = true)] public string OutputCode { set; get; } [ImporterHeader(Name = "调入仓库")] public string Input { set; get; } - [ImporterHeader(Name = "调入仓库代码",IsIgnore =true)] + [ImporterHeader(Name = "调入仓库代码", IsIgnore = true)] public string InputCode { set; get; } [ImporterHeader(Name = "辅助出库关联数量")] public decimal OutputAssQty { set; get; } @@ -98,7 +92,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShpping public class ERPShippingDetailExportDto { - [Display(Name = "保管")] public string Person { set; get; } [Display(Name = "成本")] @@ -138,8 +131,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShpping public string Version { get; set; } } - - public class ERPShippingVersionRequestDto : RequestDtoBase, IBranch { @@ -160,7 +151,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShpping public Guid BranchId { get; set; } } - public class ERPShippingVersionDto { public string Year { get; set; } @@ -178,10 +168,8 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShpping /// public string CustomerCode { set; get; } - public string Factory { set; get; } - - } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISDtoBase.cs index 8fdac47e..7bf9b842 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISDtoBase.cs @@ -1,12 +1,7 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.Enums.SettleAccount; @@ -15,7 +10,7 @@ namespace Win.Sfs.SettleAccount.FISes /// /// FIS /// - public class FISDtoBase :CreateOrUpdateEntityDtoBase + public class FISDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -47,8 +42,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string Model { set; get; } - - public string Extend1 { set; get; } /// /// 底盘号 @@ -68,45 +61,31 @@ namespace Win.Sfs.SettleAccount.FISes /// public string SequenceNumber { set; get; } - /// /// 底盘号2 /// public string ChassisNumber2 { set; get; } - - /// /// CP7时间 /// public DateTime CP7Time { set; get; } - /// /// 结算数量 /// public decimal SettledQty { get; set; } - - - - } - - public class FISDto : AuditedEntityDtoBase, IBranch { - /// /// KENEN号 /// public string KENNCode { set; get; } - - - public string Version { set; get; } /// ///年度 @@ -146,29 +125,23 @@ namespace Win.Sfs.SettleAccount.FISes /// public decimal Qty { set; get; } - /// /// CP5时间 /// public DateTime CP5Time { set; get; } - /// /// 顺序号 /// public string SequenceNumber { set; get; } - public string ChassisNumber2 { set; get; } - - /// /// CP7时间 /// public DateTime CP7Time { set; get; } - /// /// 结算数量 /// @@ -184,9 +157,8 @@ namespace Win.Sfs.SettleAccount.FISes /// public DateTime EndTime { set; get; } - public EnumSettleStatus State { set; get; } - public Guid BranchId { get; set ; } + public Guid BranchId { get; set; } } public class FISCreateDto : FISDtoBase @@ -204,7 +176,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string Version { get; set; } - /// ///年度 /// @@ -227,12 +198,10 @@ namespace Win.Sfs.SettleAccount.FISes /// public string ItemCode { set; get; } - /// /// 车型 /// - public string Model { set; get; } - + public string Model { set; get; } public string Extend1 { set; get; } /// @@ -244,13 +213,11 @@ namespace Win.Sfs.SettleAccount.FISes /// public decimal Qty { set; get; } - /// /// CP5时间 /// public DateTime CP5Time { set; get; } - /// /// 顺序号 /// @@ -261,18 +228,15 @@ namespace Win.Sfs.SettleAccount.FISes /// public string ChassisNumber2 { set; get; } - - /// /// CP7时间 /// public DateTime CP7Time { set; get; } - /// /// 结算数量 /// - public decimal SettledQty { get; set; } + public decimal SettledQty { get; set; } /// /// 状态 @@ -282,7 +246,7 @@ namespace Win.Sfs.SettleAccount.FISes public virtual Guid ParentId { get; set; } } - public class FISImportDto + public class FISImportDto { /// @@ -290,7 +254,6 @@ namespace Win.Sfs.SettleAccount.FISes /// /// - public string Year { get; set; } /// @@ -303,7 +266,6 @@ namespace Win.Sfs.SettleAccount.FISes ///// //public string Version { set; get; } - /// ///FIS年度 /// @@ -323,9 +285,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string Model { set; get; } - - - public string Extend1 { set; get; } /// /// 底盘号 @@ -336,20 +295,17 @@ namespace Win.Sfs.SettleAccount.FISes /// public decimal Qty { set; get; } - /// /// CP5时间 /// public DateTime CP5Time { set; get; } - /// /// 顺序号 /// public string SequenceNumber { set; get; } - - } + } [ExcelExporter(AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)] public class FISExportDto @@ -366,7 +322,6 @@ namespace Win.Sfs.SettleAccount.FISes [ExporterHeader(DisplayName = "期间")] public string Version { set; get; } - ///// /////FIS年度 ///// @@ -392,7 +347,6 @@ namespace Win.Sfs.SettleAccount.FISes //[ExporterHeader(DisplayName = "产线")] //public string Model { set; get; } - /// /// 车型 /// @@ -413,8 +367,6 @@ namespace Win.Sfs.SettleAccount.FISes public string ChassisNumber2 { set; get; } - - /// /// 用量 /// @@ -422,7 +374,6 @@ namespace Win.Sfs.SettleAccount.FISes public decimal Qty { set; get; } - /// /// CP5时间 /// @@ -435,22 +386,18 @@ namespace Win.Sfs.SettleAccount.FISes [ExporterHeader(DisplayName = "CP7时间")] public DateTime CP7Time { set; get; } - /// /// 结算数量 /// [ExporterHeader(DisplayName = "结算数量")] public decimal SettledQty { get; set; } - /// /// 顺序号 /// [ExporterHeader(DisplayName = "顺序号")] public string SequenceNumber { set; get; } - - /// /// 开始时间 /// @@ -463,15 +410,12 @@ namespace Win.Sfs.SettleAccount.FISes [ExporterHeader(DisplayName = "结束时间")] public DateTime EndTime { set; get; } - - /// /// 状态 /// [ExporterHeader(DisplayName = "状态")] public EnumSettleStatus State { set; get; } - /// /// Erp总成号 /// @@ -483,12 +427,4 @@ namespace Win.Sfs.SettleAccount.FISes } - - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISVersionDtoBase.cs index 4d5dd820..93273750 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FISVersionDtoBase.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.FISes @@ -12,14 +7,14 @@ namespace Win.Sfs.SettleAccount.FISes /// /// FISVersion /// - public class FISVersionDtoBase :CreateOrUpdateEntityDtoBase + public class FISVersionDtoBase : CreateOrUpdateEntityDtoBase { - public string Year { get;set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// @@ -28,7 +23,7 @@ namespace Win.Sfs.SettleAccount.FISes /// /// 客户号 /// - public string CustomerCode { set; get; } + public string CustomerCode { set; get; } /// /// 车型 @@ -45,29 +40,25 @@ namespace Win.Sfs.SettleAccount.FISes /// public DateTime EndDate { set; get; } - } - - public class FISVersionDto : AuditedEntityDtoBase, IBranch { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get;set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// public string CustomerCode { set; get; } - /// /// 车型 /// @@ -82,7 +73,7 @@ namespace Win.Sfs.SettleAccount.FISes /// 结束时间 /// public DateTime EndDate { set; get; } - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } } public class FISVersionCreateDto : FISVersionDtoBase @@ -96,7 +87,7 @@ namespace Win.Sfs.SettleAccount.FISes /// /// 期间 /// - public string Period { get;set; } + public string Period { get; set; } /// /// 版本号 /// @@ -107,7 +98,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string CustomerCode { set; get; } - /// /// 车型 /// @@ -122,28 +112,27 @@ namespace Win.Sfs.SettleAccount.FISes /// 结束时间 /// public DateTime EndDate { set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } - public class FISVersionImportDto + public class FISVersionImportDto { public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// public string CustomerCode { set; get; } - /// /// 车型 /// @@ -159,8 +148,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public DateTime EndDate { set; get; } - } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FIS_THDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FIS_THDtoBase.cs index bc383f53..9e6e613a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FIS_THDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/FIS_THDtoBase.cs @@ -1,11 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.Enums.SettleAccount; @@ -14,7 +9,7 @@ namespace Win.Sfs.SettleAccount.FISes /// /// FIS /// - public class FIS_THDtoBase :CreateOrUpdateEntityDtoBase + public class FIS_THDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -86,8 +81,8 @@ namespace Win.Sfs.SettleAccount.FISes /// public decimal SettledQty { get; set; } - - + + } @@ -185,7 +180,7 @@ namespace Win.Sfs.SettleAccount.FISes public EnumSettleStatus State { set; get; } - public Guid BranchId { get; set ; } + public Guid BranchId { get; set; } } public class FIS_THCreateDto : FISDtoBase @@ -230,7 +225,7 @@ namespace Win.Sfs.SettleAccount.FISes /// /// 车型 /// - public string Model { set; get; } + public string Model { set; get; } public string Extend1 { set; get; } @@ -271,7 +266,7 @@ namespace Win.Sfs.SettleAccount.FISes /// /// 结算数量 /// - public decimal SettledQty { get; set; } + public decimal SettledQty { get; set; } /// /// 状态 @@ -281,7 +276,7 @@ namespace Win.Sfs.SettleAccount.FISes public virtual Guid ParentId { get; set; } } - public class FIS_THImportDto + public class FIS_THImportDto { /// @@ -346,7 +341,7 @@ namespace Win.Sfs.SettleAccount.FISes /// 顺序号 /// public string SequenceNumber { set; get; } - + } public class FIS_THExportDto { @@ -363,7 +358,7 @@ namespace Win.Sfs.SettleAccount.FISes public string Version { set; get; } - + /// /// 订单编号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/IFISAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/IFISAppService.cs index dcb931c6..0a02bd51 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/IFISAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/FISes/IFISAppService.cs @@ -1,19 +1,13 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.FISes { - public interface IFISAppService - + public interface IFISAppService { @@ -23,10 +17,7 @@ namespace Win.Sfs.SettleAccount.FISes /// 上传的文件(前端已经限制只能上传一个附件) /// - Task FISUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory, string model, DateTime? beginDate, DateTime? endDate); - - - + Task FISUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory, string model, DateTime? beginDate, DateTime? endDate); /// /// 按ID获取唯一实体 @@ -48,10 +39,7 @@ namespace Win.Sfs.SettleAccount.FISes /// 请求条件 /// 实体DTO列表 - Task> GetListAsync(Guid parentId,FISRequestDto input); - - - + Task> GetListAsync(Guid parentId, FISRequestDto input); /// /// 根据筛选条件获取实体列表 @@ -64,9 +52,6 @@ namespace Win.Sfs.SettleAccount.FISes Task> GetVersionListAsync(FISVersionRequestDto input); - - - /// /// 获取实体总数 /// @@ -74,7 +59,6 @@ namespace Win.Sfs.SettleAccount.FISes Task GetTotalCountAsync(Guid branchId); - ///// ///// 获取全部实体列表 ///// @@ -82,20 +66,14 @@ namespace Win.Sfs.SettleAccount.FISes //Task> GetAllAsync(Guid branchId); - - - - ///// ///// 新增实体 ///// ///// 新增实体DTO ///// 实体DTO - //Task CreateAsync(FISCreateDto input); - ///// ///// 修改实体 ///// @@ -105,9 +83,6 @@ namespace Win.Sfs.SettleAccount.FISes //Task UpdateAsync(Guid id, FISUpdateDto input); - - - ///// ///// 删除实体 ///// @@ -116,7 +91,6 @@ namespace Win.Sfs.SettleAccount.FISes //Task DeleteAsync(Guid id); - /// /// 按IDs删除实体列表 /// @@ -124,8 +98,6 @@ namespace Win.Sfs.SettleAccount.FISes /// 是否执行成功 Task DeleteListAsync(List ids); - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/FactoryDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/FactoryDtoBase.cs index 77ef5261..b6fa0a33 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/FactoryDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/FactoryDtoBase.cs @@ -1,13 +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; -using Win.Sfs.Shared; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; @@ -24,10 +18,10 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// 编码 /// public string Code { set; get; } - /// - /// 描述 - /// - public string Desc { set; get; } + /// + /// 描述 + /// + public string Desc { set; get; } } public class FactoryCreateDto : FactoryDtoBase @@ -54,7 +48,7 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// public string Desc { set; get; } - public Guid BranchId{set;get;} + public Guid BranchId { set; get; } /// /// 用户IID @@ -64,7 +58,7 @@ namespace Win.Sfs.SettleAccount.Entities.Factories } - + public class FactoryDto : AuditedEntityDtoBase { public string CustomerCode { set; get; } @@ -76,9 +70,9 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// 描述 /// public string Desc { set; get; } - + } - [ImportProject(Name ="工厂")] + [ImportProject(Name = "工厂")] public class FactoryImportDto { [ImporterHeader(Name = "客户编码")] @@ -92,7 +86,7 @@ namespace Win.Sfs.SettleAccount.Entities.Factories [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Desc { set; get; } - + } public class FactoryExportDto { @@ -101,14 +95,14 @@ namespace Win.Sfs.SettleAccount.Entities.Factories public string CustomerCode { set; get; } [ExporterHeader(DisplayName = "编码")] - + public string Code { set; get; } [ExporterHeader(DisplayName = "描述")] - + public string Desc { set; get; } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/IFactoryAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/IFactoryAppService.cs index 7f50353c..17dbcde6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/IFactoryAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Factories/IFactoryAppService.cs @@ -1,17 +1,6 @@ -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 Volo.Abp.Application.Services; -using Win.Sfs.Shared; using Win.Sfs.Shared.ApplicationBase; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; - namespace Win.Sfs.SettleAccount.Entities.Factories { @@ -26,11 +15,4 @@ namespace Win.Sfs.SettleAccount.Entities.Factories { } - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapDtoBase.cs index 399754ff..4fc4a895 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapDtoBase.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; @@ -19,8 +16,6 @@ namespace Win.Sfs.SettleAccount.Entities.ImportColumnMaps } - - public class ImportColumnMapExportDto { @@ -32,8 +27,6 @@ namespace Win.Sfs.SettleAccount.Entities.ImportColumnMaps } - - public class ImportColumnMapImportDto { @@ -45,8 +38,6 @@ namespace Win.Sfs.SettleAccount.Entities.ImportColumnMaps } - - public class ImportColumnMapRequestDto : PagedAndSortedResultRequestDto { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapHelper.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapHelper.cs index 8318998f..3d035aff 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapHelper.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ImportColumnMaps/ImportColumnMapHelper.cs @@ -1,15 +1,12 @@ -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.SettleAccount.Entities.ImportMap; namespace Win.Sfs.SettleAccount.Entities.ImportColumnMaps { public class ImportColumnMapHelper { - private static List CurrentColumnList = new List(); + private static readonly List CurrentColumnList = new List(); public static void Init(List p_list) { @@ -39,9 +36,7 @@ namespace Win.Sfs.SettleAccount.Entities.ImportColumnMaps return column; - } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/IInventoryDetailAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/IInventoryDetailAppService.cs index 0b2e5d47..cce64760 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/IInventoryDetailAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/IInventoryDetailAppService.cs @@ -1,20 +1,16 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion; using Win.Sfs.SettleAccount.Inventories; -using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.Entities.Inventories { public interface IInventoryDetailAppService - + { /// @@ -23,10 +19,7 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories /// 上传的文件(前端已经限制只能上传一个附件) /// - Task InventoryDetailUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory); - - - + Task InventoryDetailUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory); /// /// 按ID获取唯一实体 @@ -50,9 +43,6 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories Task> GetListAsync(Guid parentId, InventoryDetailRequestDto input); - - - /// /// 根据筛选条件获取实体列表 /// @@ -64,9 +54,6 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories Task> GetVersionListAsync(InventoryDetialVersionRequestDto input); - - - /// /// 获取实体总数 /// @@ -74,7 +61,6 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories Task GetTotalCountAsync(Guid branchId); - ///// ///// 获取全部实体列表 ///// @@ -82,20 +68,14 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories //Task> GetAllAsync(Guid branchId); - - - - ///// ///// 新增实体 ///// ///// 新增实体DTO ///// 实体DTO - //Task CreateAsync(InventoryDetailCreateDto input); - ///// ///// 修改实体 ///// @@ -105,9 +85,6 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories //Task UpdateAsync(Guid id, InventoryDetailUpdateDto input); - - - ///// ///// 删除实体 ///// @@ -116,7 +93,6 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories //Task DeleteAsync(Guid id); - /// /// 按IDs删除实体列表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailCreateDto.cs index 29514958..91312046 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailCreateDto.cs @@ -1,17 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { public class InventoryDetailCreateDto : InventoryDetailDtoBase, IBranch { - public virtual Guid BranchId { get ; set ; } + public virtual Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDto.cs index 8e4d1884..a0c4f4c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDto.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { - public class InventoryDetailDto : AuditedEntityDtoBase, IBranch + public class InventoryDetailDto : AuditedEntityDtoBase, IBranch { /// ///年度 @@ -21,12 +15,11 @@ namespace Win.Sfs.SettleAccount.Inventories /// 期间 /// public string Period { set; get; } - + /// /// 物料编号 /// - public virtual string MaterialCode { get; set; } - + public virtual string MaterialCode { get; set; } /// /// 物料描述 @@ -76,11 +69,10 @@ namespace Win.Sfs.SettleAccount.Inventories /// 价格 /// public virtual decimal Price { get; set; } - public virtual Guid BranchId { get ; set; } - + public virtual Guid BranchId { get; set; } public string Factory { get; set; } public string Version { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDtoBase.cs index 8e28f82d..f67233f5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailDtoBase.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using Win.Sfs.Shared.DomainBase; +using System; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { - public class InventoryDetailDtoBase : CreateOrUpdateEntityDtoBase + public class InventoryDetailDtoBase : CreateOrUpdateEntityDtoBase { /// ///年度 @@ -24,8 +18,7 @@ namespace Win.Sfs.SettleAccount.Inventories /// /// 物料编号 /// - public virtual string MaterialCode { get; set; } - + public virtual string MaterialCode { get; set; } /// /// 物料描述 @@ -76,8 +69,5 @@ namespace Win.Sfs.SettleAccount.Inventories /// public virtual decimal Price { get; set; } - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailExportDto.cs index 680075fd..262e920d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailExportDto.cs @@ -1,18 +1,8 @@ - using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { - public class InventoryDetailExportDto + public class InventoryDetailExportDto { [ExporterHeader(DisplayName = "工厂")] @@ -22,16 +12,12 @@ namespace Win.Sfs.SettleAccount.Inventories public string Version { set; get; } - - /// /// 物料号 /// [ExporterHeader(DisplayName = "物料号")] - - - public virtual string MaterialCode { get; set; } + public virtual string MaterialCode { get; set; } /// /// 物料描述 @@ -44,44 +30,43 @@ namespace Win.Sfs.SettleAccount.Inventories /// 入库数量 /// [ExporterHeader(DisplayName = "入库数量")] - - + public virtual decimal InputQty { get; set; } /// /// 出库数量 /// [ExporterHeader(DisplayName = "出库数量")] - + public virtual decimal OutputQty { get; set; } /// /// 期初库存数 /// [ExporterHeader(DisplayName = "期初库存数")] - + public virtual decimal OpeningInventoryQty { get; set; } /// /// 期末库存数 /// [ExporterHeader(DisplayName = "期末库存数")] - + public virtual decimal EndingInventoryQty { get; set; } /// /// 估价类 /// [ExporterHeader(DisplayName = "估价类")] - + public virtual string AppraisalCategory { get; set; } /// /// 估价描述 /// [ExporterHeader(DisplayName = "估价描述")] - + public virtual string AppraisalDesc { get; set; } /// /// 存储地點 /// [ExporterHeader(DisplayName = "存储地点")] - + public virtual string StorageLocation { get; set; } ///// @@ -96,7 +81,7 @@ namespace Win.Sfs.SettleAccount.Inventories /// 基本计量单位 /// [ExporterHeader(DisplayName = "基本计量单位")] - + public virtual string Unit { get; set; } /// @@ -107,7 +92,5 @@ namespace Win.Sfs.SettleAccount.Inventories //[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] //public virtual decimal Price { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailImportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailImportDto.cs index 6acbb99d..f5a01a26 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailImportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailImportDto.cs @@ -1,36 +1,26 @@ -using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { [ImportProject(Name = "库存明细")] - public class InventoryDetailImportDto + public class InventoryDetailImportDto { - - /// /// 物料号 /// [ImporterHeader(Name = "物料号")] [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] - public virtual string MaterialCode { get; set; } - + public virtual string MaterialCode { get; set; } ///// ///// 物料描述 ///// //[ImporterHeader(Name = "描述",IsIgnore =true)] - + //public virtual string MaterialDesc { get; set; } /// /// 入库数量 @@ -105,7 +95,5 @@ namespace Win.Sfs.SettleAccount.Inventories //[MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] //public virtual decimal Price { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailRequestDto.cs index f7790b0c..08bae026 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailRequestDto.cs @@ -1,24 +1,16 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { - public class InventoryDetailRequestDto : RequestDtoBase, IBranch + public class InventoryDetailRequestDto : RequestDtoBase, IBranch { - /// /// 物料编号 /// - public virtual string MaterialCode { get; set; } - + public virtual string MaterialCode { get; set; } /// /// 物料描述 @@ -69,12 +61,11 @@ namespace Win.Sfs.SettleAccount.Inventories /// public virtual decimal Price { get; set; } - public virtual Guid ParentId { get; set; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } public virtual Guid UserId { get; set; } public virtual int FileType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailUpdateDto.cs index 46e0d038..885e63b6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailUpdateDto.cs @@ -1,21 +1,7 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; - namespace Win.Sfs.SettleAccount.Inventories { - public class InventoryDetailUpdateDto : InventoryDetailDtoBase + public class InventoryDetailUpdateDto : InventoryDetailDtoBase { - - - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailVersionDtoBase.cs index e07e635d..bd78bc33 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Inventories/InventoryDetailVersionDtoBase.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.InventoryDetialVersion @@ -12,7 +7,7 @@ namespace Win.Sfs.SettleAccount.Entities.InventoryDetialVersion /// /// InventoryDetialVersion /// - public class InventoryDetialVersionDtoBase :CreateOrUpdateEntityDtoBase + public class InventoryDetialVersionDtoBase : CreateOrUpdateEntityDtoBase { public string Year { get; private set; } @@ -30,31 +25,27 @@ namespace Win.Sfs.SettleAccount.Entities.InventoryDetialVersion /// public string CustomerCode { private set; get; } - } - - public class InventoryDetialVersionDto : AuditedEntityDtoBase, IBranch { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - + public string CustomerCode { set; get; } public string Factory { set; get; } - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } } public class InventoryDetialVersionCreateDto : InventoryDetialVersionDtoBase @@ -78,10 +69,10 @@ namespace Win.Sfs.SettleAccount.Entities.InventoryDetialVersion /// 客户号 /// public string CustomerCode { private set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } - public class InventoryDetialVersionImportDto + public class InventoryDetialVersionImportDto { public string Year { get; private set; } @@ -99,8 +90,6 @@ namespace Win.Sfs.SettleAccount.Entities.InventoryDetialVersion /// public string CustomerCode { private set; get; } - } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs index 503f61f2..05e12c54 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiff.cs @@ -1,9 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; @@ -16,18 +13,14 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string MaterialCode { get; set; } public decimal InvoiceQty { get; set; } public decimal SettleQty { get; set; } - - } - + } public class InvoiceSettledDiffExportDto { - - - // 期间 发运类型 物料组 SAP编码 工厂 零件号 零件号格式整理 零件名称 开票数量 开票 金额 开票单价 结算数量 CP7报废 索赔/退货 数量差异 定价 价格差异 + // 期间 发运类型 物料组 SAP编码 工厂 零件号 零件号格式整理 零件名称 开票数量 开票 金额 开票单价 结算数量 CP7报废 索赔/退货 数量差异 定价 价格差异 [ExporterHeader(DisplayName = "期间")] public string Version { get; set; } @@ -37,7 +30,7 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string SapMaterialCode { get; set; } [ExporterHeader(DisplayName = "工厂")] public string Factory { get; set; } - [ExporterHeader(DisplayName ="零件编号")] + [ExporterHeader(DisplayName = "零件编号")] public string MaterialCode { get; set; } [ExporterHeader(DisplayName = "零件名称")] public string MaterialDesc { get; set; } @@ -47,7 +40,7 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public decimal InvoiceAmt { get; set; } [ExporterHeader(DisplayName = "开票单价")] public decimal InvoicePrice { get; set; } - [ExporterHeader(DisplayName ="结算数量")] + [ExporterHeader(DisplayName = "结算数量")] public decimal SettleQty { get; set; } [ExporterHeader(DisplayName = "数量差")] public decimal DiffQty { get; set; } @@ -62,8 +55,6 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs } - - public class InvoiceSettledDiffImportDto { @@ -71,10 +62,8 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string MaterialCode { get; set; } public decimal InvoiceQty { get; set; } public decimal SettleQty { get; set; } - - } - + } public class InvoiceSettledDiffRequestDto : PagedAndSortedResultRequestDto @@ -83,12 +72,9 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string MaterialCode { get; set; } public decimal InvoiceQty { get; set; } public decimal SettleQty { get; set; } - + public virtual List Filters { get; set; } = new List(); } - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs index 85293f42..55861e91 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; @@ -19,10 +16,8 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string CustomName { get; set; } public string CreatorName { get; set; } public string ProjectName { get; set; } - - } - + } public class InvoiceSettledDiffVersionExportDto @@ -35,10 +30,8 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string CustomName { get; set; } public string CreatorName { get; set; } public string ProjectName { get; set; } - - } - + } public class InvoiceSettledDiffVersionImportDto @@ -51,10 +44,8 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string CustomName { get; set; } public string CreatorName { get; set; } public string ProjectName { get; set; } - - } - + } public class InvoiceSettledDiffVersionRequestDto : PagedAndSortedResultRequestDto @@ -67,12 +58,9 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs public string CustomName { get; set; } public string CreatorName { get; set; } public string ProjectName { get; set; } - + public virtual List Filters { get; set; } = new List(); } - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/IInvoiceAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/IInvoiceAppService.cs index ba7bd5cd..3f881332 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/IInvoiceAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/IInvoiceAppService.cs @@ -1,10 +1,8 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; using Win.Sfs.SettleAccount.Entities.Invoices.Win.Sfs.SettleAccount.Entities.Invoices; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceDtoBase.cs index 8645ef8e..51085964 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceDtoBase.cs @@ -1,10 +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; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; @@ -43,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [ImporterHeader(Name = "金额")] public decimal Amt { get; set; } - } public class InvoiceTHExportDto @@ -59,7 +55,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices /// [Display(Name = "工厂")] public string Factory { get; set; } - + /// ///零件号 /// @@ -81,12 +77,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices /// [Display(Name = "金额")] public decimal Amt { get; set; } - } - - public class InvoiceDto : EntityDto { /// @@ -105,7 +98,6 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [Display(Name = "版本号")] public string Version { set; get; } - /// ///工厂 /// @@ -156,17 +148,13 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices ///// //[Display(Name = "记账日期")] //public DateTime AccountDate { get; set; } - - } - + } public class InvoiceExportDto { - - [Display(Name = "版本号")] public string Version { set; get; } @@ -220,10 +208,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices ///// //[ExporterHeader(DisplayName = "记账日期")] //public DateTime AccountDate { get; set; } - - } - + } public class InvoiceImportDto @@ -279,10 +265,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices ///// //[ImporterHeader(Name = "记账日期")] //public DateTime AccountDate { get; set; } - - } - + } public class InvoiceRequestDto : PagedAndSortedResultRequestDto @@ -330,12 +314,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public virtual int FileType { get; set; } public string Site { get; set; } - + public virtual List Filters { get; set; } = new List(); } - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceVersionDtoBase.cs index b0558ec3..447399be 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Invoices/InvoiceVersionDtoBase.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; @@ -19,10 +16,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - - } - + } public class InvoiceVersionExportDto @@ -33,10 +28,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - - } - + } public class InvoiceVersionImportDto @@ -47,10 +40,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - - } - + } public class InvoiceVersionRequestDto : PagedAndSortedResultRequestDto @@ -61,13 +52,10 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - + public virtual List Filters { get; set; } = new List(); } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/IItemInvoicePriceAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/IItemInvoicePriceAppService.cs index e4c2b1c9..a900412d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/IItemInvoicePriceAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/IItemInvoicePriceAppService.cs @@ -1,125 +1,101 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices; -using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.ItemInvoicePrices { public interface IItemInvoicePriceAppService { /// - /// 빦 + /// 导入功能 /// - /// ϴļ(ǰѾֻϴһ) + /// 上传的文件(前端已经限制只能上传一个附件) /// Task ItemInvoicePriceUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory); - - - /// - /// IDȡΨһʵ + /// 按ID获取唯一实体 /// /// - /// ʵȫ + /// 返回实体全部属性 /// /// ID - /// ʵDTO + /// 实体DTO Task GetAsync(Guid id); /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб - - Task> GetListAsync( ItemInvoicePriceRequestDto input); - - + /// 请求条件 + /// 实体DTO列表 + Task> GetListAsync(ItemInvoicePriceRequestDto input); /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб + /// 请求条件 + /// 实体DTO列表 Task> GetVersionListAsync(ItemInvoicePriceVersionRequestDto input); - - - /// - /// ȡʵ + /// 获取实体总数 /// - /// ʵ + /// 实体总数 Task GetTotalCountAsync(Guid branchId); - /// - /// ȡȫʵб + /// 获取全部实体列表 /// - /// ʵDTOб + /// 实体DTO列表 //Task> GetAllAsync(Guid branchId); - - - - ///// - ///// ʵ + ///// 新增实体 ///// - ///// ʵDTO - ///// ʵDTO - + ///// 新增实体DTO + ///// 实体DTO //Task CreateAsync(ItemInvoicePriceCreateDto input); - ///// - ///// ޸ʵ + ///// 修改实体 ///// ///// ID - ///// ޸ʵDTO - ///// ʵDTO + ///// 修改实体DTO + ///// 实体DTO //Task UpdateAsync(Guid id, ItemInvoicePriceUpdateDto input); - - - ///// - ///// ɾʵ + ///// 删除实体 ///// ///// ID - ///// + ///// //Task DeleteAsync(Guid id); - /// - /// IDsɾʵб + /// 按IDs删除实体列表 /// /// IDs - /// Ƿִгɹ + /// 是否执行成功 Task DeleteListAsync(List ids); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ImportItemInvoicePriceDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ImportItemInvoicePriceDto.cs index 1c13d4c3..94a234ef 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ImportItemInvoicePriceDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ImportItemInvoicePriceDto.cs @@ -1,13 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com +using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { @@ -18,15 +14,11 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices /// [ImportProject(Name = SettleAccountModuleName.ItemInvoicePrice)] [ExcelImporter(IsLabelingError = true, MaxCount = int.MaxValue)] - public class ImportItemInvoicePriceDto + public class ImportItemInvoicePriceDto { - //Ln Item Number UM Sales Sub-Acct CC Backorder Price Extended Price Extended Margin - - - /// /// 零件号 /// @@ -55,7 +47,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "销售订单")] public string Sales { set; get; } - /// /// SubAcct /// @@ -63,7 +54,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "SubAcct")] public string SubAcct { set; get; } - /// /// 销售客户 /// @@ -71,7 +61,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "销售客户")] public string CC { set; get; } - /// /// 开票数量 /// @@ -79,7 +68,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "开票数量")] public string Backorder { set; get; } - /// /// 开票单价 /// @@ -87,8 +75,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "开票单价")] public decimal Price { set; get; } - - /// /// 总金额 /// @@ -103,16 +89,13 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "ExtendedMargin")] public decimal ExtendedMargin { set; get; } - } public class ExportItemInvoicePriceDto { - //Ln Item Number UM Sales Sub-Acct CC Backorder Price Extended Price Extended Margin - /// ///年 /// @@ -137,7 +120,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "工厂")] public string Factory { set; get; } - /// /// 零件号 /// @@ -166,7 +148,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "销售订单")] public string Sales { set; get; } - /// /// SubAcct /// @@ -174,7 +155,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "SubAcct")] public string SubAcct { set; get; } - /// /// 销售客户 /// @@ -182,7 +162,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "销售客户")] public string CC { set; get; } - /// /// 开票数量 /// @@ -190,7 +169,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "开票数量")] public string Backorder { set; get; } - /// /// 开票单价 /// @@ -198,8 +176,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "开票单价")] public decimal Price { set; get; } - - /// /// 总金额 /// @@ -214,8 +190,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "ExtendedMargin")] public decimal ExtendedMargin { set; get; } - } - -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateDto.cs index bb02a8f3..56a99d36 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateDto.cs @@ -1,22 +1,19 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { public class ItemInvoicePriceCreateDto : ItemInvoicePriceCreateOrUpdateDtoBase, IBranch { - + [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] public Guid BranchId { set; get; } - - /// ///年 /// @@ -34,4 +31,4 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices public string Version { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateOrUpdateDtoBase.cs index ed947aff..8d270f39 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceCreateOrUpdateDtoBase.cs @@ -1,14 +1,13 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { - public class ItemInvoicePriceCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class ItemInvoicePriceCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -17,7 +16,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "工厂")] public string Factory { set; get; } - /// /// 零件号 /// @@ -42,54 +40,43 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "销售订单")] public string Sales { set; get; } - /// /// SubAcct /// [Display(Name = "SubAcct")] public string SubAcct { set; get; } - /// /// 销售客户 /// [Display(Name = "销售客户")] public string CC { set; get; } - /// /// 开票数量 /// [Display(Name = "开票数量")] public string Backorder { set; get; } - /// /// 开票单价 /// [Display(Name = "开票单价")] public decimal Price { set; get; } - - /// /// 总金额 /// [Display(Name = "总金额")] public decimal ExtendedPrice { set; get; } - - - - /// /// ExtendedMargin /// [Display(Name = "ExtendedMargin")] public decimal ExtendedMargin { set; get; } - public bool Enabled { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceDto.cs index 73157e5f..51b23577 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceDto.cs @@ -1,12 +1,11 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; - + namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { public class ItemInvoicePriceDto : AuditedEntityDtoBase, IBranch @@ -19,7 +18,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices public Guid BranchId { get; set; } - /// ///年 /// @@ -41,7 +39,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "工厂")] public string Factory { set; get; } - /// /// 零件号 /// @@ -66,53 +63,41 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [Display(Name = "销售订单")] public string Sales { set; get; } - /// /// SubAcct /// [Display(Name = "SubAcct")] public string SubAcct { set; get; } - /// /// 销售客户 /// [Display(Name = "销售客户")] public string CC { set; get; } - /// /// 开票数量 /// [Display(Name = "开票数量")] public string Backorder { set; get; } - /// /// 开票单价 /// [Display(Name = "开票单价")] public decimal Price { set; get; } - - /// /// 总金额 /// [Display(Name = "总金额")] public decimal ExtendedPrice { set; get; } - - - - /// /// ExtendedMargin /// [Display(Name = "ExtendedMargin")] public decimal ExtendedMargin { set; get; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceExportDto.cs index 49e064d5..4766f449 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceExportDto.cs @@ -1,22 +1,11 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Core.Filters; -using Magicodes.ExporterAndImporter.Core.Models; -using Magicodes.ExporterAndImporter.Excel; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { - + public class ItemInvoicePriceExportDto { - - - ///// ///// 期间 @@ -24,16 +13,13 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices //[ExporterHeader(DisplayName = "期间")] //public string Period { set; get; } - - /// /// 版本 /// - + [ExporterHeader(DisplayName = "版本")] public string Version { set; get; } - /// /// 零件号 /// @@ -49,8 +35,8 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices public string MaterialDesc { get; set; } /// - /// 单位 - /// + /// 单位 + /// //[Display(Name = "单位")] [ExporterHeader(DisplayName = "单位")] public string UM { get; set; } @@ -62,7 +48,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "销售订单")] public string Sales { set; get; } - /// /// SubAcct /// @@ -70,7 +55,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "SubAcct")] public string SubAcct { set; get; } - /// /// 销售客户 /// @@ -78,7 +62,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "销售客户")] public string CC { set; get; } - /// /// 开票数量 /// @@ -86,7 +69,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "开票数量")] public string Backorder { set; get; } - /// /// 开票单价 /// @@ -94,8 +76,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "开票单价")] public decimal Price { set; get; } - - /// /// 总金额 /// @@ -103,10 +83,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "总金额")] public decimal ExtendedPrice { set; get; } - - - - /// /// ExtendedMargin /// @@ -114,9 +90,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "ExtendedMargin")] public decimal ExtendedMargin { set; get; } - - - /// /// ExtendedMargin /// @@ -131,7 +104,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices [ExporterHeader(DisplayName = "价差")] public decimal DiffPrice { set; get; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceRequestDto.cs index 5b77ebce..3921b37e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceRequestDto.cs @@ -1,15 +1,13 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { - public class ItemInvoicePriceRequestDto : RequestDtoBase,IBranch + public class ItemInvoicePriceRequestDto : RequestDtoBase, IBranch { //public Guid ParentId { set; get; } public Guid BranchId { get; set; } @@ -17,13 +15,11 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices /// /// 版本号 /// - public string Version { get; set; } - + public string Version { get; set; } public virtual Guid UserId { get; set; } public virtual int FileType { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceUpdateDto.cs index 4d379765..c2834204 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceUpdateDto.cs @@ -1,16 +1,12 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; -using Volo.Abp.ObjectExtending; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { - public class ItemInvoicePriceUpdateDto : ItemInvoicePriceCreateOrUpdateDtoBase, IHasConcurrencyStamp + public class ItemInvoicePriceUpdateDto : ItemInvoicePriceCreateOrUpdateDtoBase, IHasConcurrencyStamp { public string ConcurrencyStamp { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceVersionDtoBase.cs index 414e53f5..ffb5058b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/ItemInvoicePrices/ItemInvoicePriceVersionDtoBase.cs @@ -1,16 +1,14 @@ - + using System; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices -{ +{ /// /// ItemInvoicePriceVersion /// -public class ItemInvoicePriceVersionDtoBase :CreateOrUpdateEntityDtoBase + public class ItemInvoicePriceVersionDtoBase : CreateOrUpdateEntityDtoBase { public string Year { get; private set; } @@ -23,26 +21,21 @@ public class ItemInvoicePriceVersionDtoBase :CreateOrUpdateEntityDtoBase /// public string Version { get; private set; } - - } - - public class ItemInvoicePriceVersionDto : AuditedEntityDtoBase, IBranch { public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } - - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } } public class ItemInvoicePriceVersionCreateDto : ItemInvoicePriceVersionDtoBase @@ -62,11 +55,10 @@ public class ItemInvoicePriceVersionDtoBase :CreateOrUpdateEntityDtoBase /// public string Version { get; private set; } - - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } - public class ItemInvoicePriceVersionImportDto + public class ItemInvoicePriceVersionImportDto { public string Year { get; private set; } @@ -79,9 +71,6 @@ public class ItemInvoicePriceVersionDtoBase :CreateOrUpdateEntityDtoBase /// public string Version { get; private set; } - - } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/IItemAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/IItemAppService.cs index a0214580..8e0464cb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/IItemAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/IItemAppService.cs @@ -15,4 +15,4 @@ namespace Win.Sfs.SettleAccount.Items { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateDto.cs index 3105c0dc..42541438 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateDto.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -8,7 +8,7 @@ using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Items { - public class ItemCreateDto: ItemCreateOrUpdateDtoBase, IBranch + public class ItemCreateDto : ItemCreateOrUpdateDtoBase, IBranch { [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] @@ -23,4 +23,4 @@ namespace Win.Sfs.SettleAccount.Items public string Code { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateOrUpdateDtoBase.cs index 34231e07..b2fdc4b3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemCreateOrUpdateDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -7,7 +7,7 @@ using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Items { - public class ItemCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class ItemCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -51,23 +51,18 @@ namespace Win.Sfs.SettleAccount.Items [Display(Name = "基本计量单位Id")] public string BasicUomCode { get; internal set; } - - - /// /// 产品类 /// [Display(Name = "产品类")] public string ProductLine { get; internal set; } - /// /// 项目ID /// [Display(Name = "项目编码")] public string ProjectCode { get; internal set; } - /// /// 是否关键物品 /// @@ -79,12 +74,10 @@ namespace Win.Sfs.SettleAccount.Items [Display(Name = "是否虚拟物品")] public bool? IsVirtualItem { get; internal set; } - [Display(Name = "名称")] public string Name { get; internal set; } public Guid? TenantId { set; get; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemDto.cs index b2e1ba20..33af0eb6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemDto.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -62,23 +62,18 @@ namespace Win.Sfs.SettleAccount.Items [Display(Name = "基本计量单位Id")] public string BasicUomCode { get; internal set; } - - - /// /// 产品类 /// [Display(Name = "产品类")] public string ProductLine { get; internal set; } - /// /// 项目ID /// [Display(Name = "项目编码")] public string ProjectCode { get; internal set; } - /// /// 是否关键物品 /// @@ -90,13 +85,10 @@ namespace Win.Sfs.SettleAccount.Items [Display(Name = "是否虚拟物品")] public bool? IsVirtualItem { get; internal set; } - [Display(Name = "名称")] public string Name { get; internal set; } public Guid? TenantId { set; get; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemRequestDto.cs index a89df84c..3ec1baaa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemRequestDto.cs @@ -1,16 +1,14 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Items { - public class ItemRequestDto : RequestDtoBase,IBranch + public class ItemRequestDto : RequestDtoBase, IBranch { public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemUpdateDto.cs index 560c7f91..4f1a8667 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Items/ItemUpdateDto.cs @@ -1,16 +1,12 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; -using Volo.Abp.ObjectExtending; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Items { - public class ItemUpdateDto : ItemCreateOrUpdateDtoBase, IHasConcurrencyStamp + public class ItemUpdateDto : ItemCreateOrUpdateDtoBase, IHasConcurrencyStamp { public string ConcurrencyStamp { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs index 1e08ca1c..76e24399 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/IMaterialRelationshipAppService.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships +namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships { public interface IMaterialRelationshipAppService { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs index 263a90b8..513cb1f6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/MaterialRelationship/MaterialRelationshipDtoBase.cs @@ -1,27 +1,24 @@ using System; +using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DtoBase; using Magicodes.ExporterAndImporter.Core; -using Win.Sfs.Shared; +using Microsoft.AspNetCore.Http; using Volo.Abp.Application.Dtos; +using Win.Sfs.Shared.Constant; +using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.Filter; -using System.Collections.Generic; -using Microsoft.AspNetCore.Http; namespace Win.Sfs.SettleAccount.MaterialRelationships { /// /// FIS /// - public class MaterialRelationshipDtoBase : CreateOrUpdateEntityDtoBase + public class MaterialRelationshipDtoBase : CreateOrUpdateEntityDtoBase { /// /// ERP物料号 /// - public virtual string ErpMaterialCode { get; set; } + public virtual string ErpMaterialCode { get; set; } /// /// 物料描述 /// @@ -31,13 +28,11 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships /// public virtual string MaterialProperty { get; set; } - /// /// 结算物料号 /// public virtual string SettleMaterialCode { get; set; } - /// /// 发货看板物料号 /// @@ -49,24 +44,19 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships /// public virtual string AppraisalCategory { get; set; } - - } /// /// 产品结构 /// public class MaterialRelationshipCreateDto : MaterialRelationshipDtoBase { - - - } /// /// 产品结构 /// public class MaterialRelationshipUpdateDto : MaterialRelationshipDtoBase - { + { } /// @@ -102,12 +92,12 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships /// /// 导出 /// - public class MaterialRelationshipExportDto + public class MaterialRelationshipExportDto { /// /// 厂内物料号 /// - [ExporterHeaderAttribute(DisplayName = "厂内物料号")] + [ExporterHeaderAttribute(DisplayName = "厂内物料号")] public string ErpMaterialCode { get; set; } /// @@ -193,23 +183,19 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public string ShipMaterailCode { get; set; } public string AppraisalCategory { get; set; } public decimal Qty { get; set; } - - } - + } public class MaterialRelationshipDetailExportDto { - [ExporterHeaderAttribute(DisplayName = "版本号")] public virtual string Version { get; set; } //[ExporterHeaderAttribute(DisplayName = "客户代码")] //public virtual string CustomerCode { get; set; } - [ExporterHeaderAttribute(DisplayName = "ERP物料号")] public virtual string ErpMaterialCode { get; set; } @@ -238,26 +224,22 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public virtual string SettleMaterialCode { get; set; } - ///// ///// 发货看板物料号 ///// //[ExporterHeaderAttribute(DisplayName = "发货看板物料号")] //public virtual string ShipMaterailCode { get; set; } - + [ExporterHeaderAttribute(DisplayName = "数量")] public virtual decimal Qty { get; set; } - - } - + } public class MaterialRelationshipDetailImportDto { - /// /// ERP物料号 /// @@ -288,7 +270,6 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public virtual string SettleMaterialCode { get; set; } - /// /// 发货看板物料号 /// @@ -297,7 +278,6 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public virtual string ShipMaterailCode { get; set; } - [ImporterHeader(Name = "估价类")] /// /// 估价类 @@ -311,10 +291,8 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships [ImporterHeader(Name = "数量")] public decimal Qty { get; set; } - - } - + } public class MaterialRelationshipDetailRequestDto : PagedAndSortedResultRequestDto @@ -329,7 +307,7 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public string ShipMaterailCode { get; set; } public string AppraisalCategory { get; set; } public decimal Qty { get; set; } - + public virtual List Filters { get; set; } = new List(); } @@ -342,10 +320,8 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - - } - + } public class MaterialRelationshipVersionExportDto @@ -356,10 +332,8 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - - } - + } public class MaterialRelationshipVersionImportDto @@ -370,10 +344,8 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - - } - + } public class MaterialRelationshipVersionRequestDto : PagedAndSortedResultRequestDto @@ -384,13 +356,8 @@ namespace Win.Sfs.SettleAccount.MaterialRelationships public string Version { get; set; } public string CustomerCode { get; set; } public string Factory { get; set; } - + public virtual List Filters { get; set; } = new List(); } - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/IMaterialAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/IMaterialAppService.cs index be1b3ab5..5fcf3552 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/IMaterialAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Materials/IMaterialAppService.cs @@ -1,14 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Volo.Abp.Application.Services; using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.Entities.Materials { - + public interface IMaterialAppService : ICrudAppService ///错误单据号 /// - [ImporterHeader(Name = "底盘|看板号|订单号")] + [ImporterHeader(Name = "底盘|看板号|订单号")] public string BillNum { get; set; } /// /// 物料号 @@ -125,10 +121,10 @@ namespace Win.Sfs.SettleAccount.Entities.Materials { public class MaterialImportDtoTH { - [ImporterHeader(Name= "PART NUMBER COMP")] - public virtual string ChildMaterialCode + [ImporterHeader(Name = "PART NUMBER COMP")] + public virtual string ChildMaterialCode { - set;get; + set; get; } [ImporterHeader(Name = "Description1")] @@ -182,15 +178,15 @@ namespace Win.Sfs.SettleAccount.Entities.Materials /// 基础计量单位 /// //[ImporterHeader(Name = "基本计量单位")] - - + + //public virtual string Unit { set; get; } /// /// 估价类 /// [ImporterHeader(Name = "ITEM TYPE FG")] - + [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public virtual string EstimateType { set; get; } @@ -211,7 +207,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials /// /// 物料主数据 /// - public class MaterialDtoBase: CreateOrUpdateEntityDtoBase + public class MaterialDtoBase : CreateOrUpdateEntityDtoBase { /// ///工厂 @@ -234,8 +230,10 @@ namespace Win.Sfs.SettleAccount.Entities.Materials ///物料描述 /// [ImporterHeader(Name = "物料描述")] - - public virtual string MaterialDesc { set; get; + + public virtual string MaterialDesc + { + set; get; } /// /// 基础计量单位 @@ -269,12 +267,12 @@ namespace Win.Sfs.SettleAccount.Entities.Materials } public class MaterialUpdateDto : MaterialDtoBase { - + } public class MaterialRequestDto : RequestDtoBase { - + } /// @@ -296,7 +294,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials } [ImportProject(Name = SettleAccountModuleName.Material)] - public class MaterialImportDto + public class MaterialImportDto { /// ///工厂 @@ -343,10 +341,10 @@ namespace Win.Sfs.SettleAccount.Entities.Materials /// 估价类描述 /// [ImporterHeader(Name = "估价类描述")] - + public virtual string EstimateTypeDesc { set; get; } - + } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/IPrebatchAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/IPrebatchAppService.cs index ae98254d..8dabb129 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/IPrebatchAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/IPrebatchAppService.cs @@ -1,16 +1,6 @@ -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 Volo.Abp.Application.Services; -using Win.Sfs.Shared; using Win.Sfs.Shared.ApplicationBase; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Prebatches { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/PrebatchDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/PrebatchDtoBase.cs index 74bf6d34..e8da07ba 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/PrebatchDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prebatches/PrebatchDtoBase.cs @@ -1,19 +1,12 @@ -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 Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.Prebatches -{ +{ public class PrebatchDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -21,14 +14,11 @@ namespace Win.Sfs.SettleAccount.Prebatches /// public string KENNCode { set; get; } - /// /// 状态 /// public int State { set; get; } - - } public class PrebatchCreateDto : PrebatchDtoBase { @@ -79,17 +69,14 @@ namespace Win.Sfs.SettleAccount.Prebatches /// public string KENNCode { set; get; } - /// /// 状态 /// public int State { set; get; } public Guid BranchId { get; set; } - public Guid UserId { get; set; } - /// /// 车型 /// @@ -112,12 +99,11 @@ namespace Win.Sfs.SettleAccount.Prebatches /// public string KENNCode { set; get; } - /// /// 状态 /// public int State { set; get; } - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } /// /// 车型 @@ -134,11 +120,10 @@ namespace Win.Sfs.SettleAccount.Prebatches /// public string Year { get; set; } } - [ImportProject(Name ="预批量")] + [ImportProject(Name = "预批量")] public class PrebatchImportDto { - /// /// KENEN号 /// @@ -155,7 +140,6 @@ namespace Win.Sfs.SettleAccount.Prebatches /// public int State { set; get; } - [ImporterHeader(Name = "车型")] [Required(ErrorMessage = "{0}是必填项")] public string CarCode { get; set; } @@ -164,12 +148,10 @@ namespace Win.Sfs.SettleAccount.Prebatches [Required(ErrorMessage = "{0}是必填项")] public string YearKennCode { get; set; } - [ImporterHeader(Name = "年份")] [Required(ErrorMessage = "{0}是必填项")] public string Year { get; set; } - } public class PrebatchExportDto { @@ -177,18 +159,16 @@ namespace Win.Sfs.SettleAccount.Prebatches /// KENEN号 /// [ExporterHeader(DisplayName = "KENN号")] - + public string KENNCode { set; get; } [ExporterHeader(DisplayName = "状态")] - - + /// /// 状态 /// public int State { set; get; } - [ExporterHeader(DisplayName = "车型")] public string CarCode { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs index 788027af..7e809fcf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListDtoBase.cs @@ -7,401 +7,402 @@ using Win.Sfs.SettleAccount.Attributes; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.Shared.Filter; -namespace Win.Sfs.SettleAccount.Entities.Prices; - -public class PriceListDto : EntityDto -{ - /// - /// 零件号 - /// - [Display(Name = "零件号")] - public string LU { get; set; } - /// - /// 价格 - /// - [Display(Name = "价格")] - public Decimal Price { set; get; } - /// - /// 开始时间 - /// - [Display(Name = "开始时间")] - public DateTime BeginTime { set; get; } - /// - /// 结束时间 - /// - [Display(Name = "结束时间")] - public DateTime EndTime { set; get; } - /// - /// 客户编码 - /// - [Display(Name = "客户编码")] - public string ClientCode { get; set; } - /// - /// 业务类别 - /// - [Display(Name = "业务类别")] - public EnumBusinessType BusinessType { get; set; } - /// - /// 版本 - /// - [Display(Name = "版本")] - public string Version { set; get; } - /// - /// 合同签订时间 - /// - [Display(Name = "合同签订时间")] - public string Date { get; set; } - /// - /// 合同号 - /// - [Display(Name = "合同号")] - public string ContractNo { get; set; } - /// - /// 是否作废 - /// - [Display(Name = "是否作废")] - public bool IsCancel { get; set; } -} - -/// -/// 销售价格单导出 -/// -public class PriceListExportDto -{ - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [ExporterHeader(DisplayName = "客户零件号")] - public string LU { get; set; } - /// - /// 价格 - /// - [Display(Name = "价格")] - [ExporterHeader(DisplayName = "价格")] - public Decimal Price { set; get; } - /// - /// 开始时间 - /// - [Display(Name = "开始时间")] - [ExporterHeader(DisplayName = "开始时间")] - public DateTime BeginTime { set; get; } - /// - /// 结束时间 - /// - [Display(Name = "结束时间")] - [ExporterHeader(DisplayName = "结束时间")] - public DateTime EndTime { set; get; } - /// - /// 客户编码 - /// - [Display(Name = "客户编码")] - [ExporterHeader(DisplayName = "客户编码")] - public string ClientCode { get; set; } - /// - /// 合同签订时间 - /// - [Display(Name = "合同签订时间")] - [ExporterHeader(DisplayName = "合同签订时间")] - public DateTime Date { get; set; } - /// - /// 合同号 - /// - [Display(Name = "合同号")] - [ExporterHeader(DisplayName = "合同号")] - public string ContractNo { get; set; } -} - -/// -/// 销售价格导入 -/// -[Importer(HeaderRowIndex = 22)] -public class PriceListImportDto -{ - /// - /// 合同签订时间 - /// - [ImporterHeader(IsIgnore = true)] - [ExcelImporterHeadDesc(Row = 1, Cell = 1)] - public string Date { get; set; } - /// - /// 合同号 - /// - [ImporterHeader(IsIgnore = true)] - [ExcelImporterHeadDesc(Row = 2, Cell = 1)] - public string ContractNo { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [Required(ErrorMessage = "{0}是必填项")] - [ImporterHeader(Name = "Part No.")] - public string PartNo { get; set; } - /// - /// 价格 - /// - [ImporterHeader(Name = "Total Price")] - public decimal TotalPrice { get; set; } - /// - /// 开始时间 - /// - [ImporterHeader(Name = "Valid From")] - public DateTime ValidFrom { get; set; } - /// - /// 结束时间 - /// - [ImporterHeader(Name = "Valid To")] - public DateTime ValidTo { get; set; } - /// - /// 客户编码 - /// - [ImporterHeader(Name = "Plant")] - public string Plant { get; set; } - /// - /// ES1 - /// - [ImporterHeader(Name = "ES1")] - public string ES1 { get; set; } - /// - /// ES2 - /// - [ImporterHeader(Name = "ES2")] - public string ES2 { get; set; } -} - -public class PriceListRequestDto : PagedAndSortedResultRequestDto -{ - [Display(Name = "开始时间")] - public DateTime BeginDate { get; set; } - [Display(Name = "结算时间")] - public DateTime EndDate { get; set; } - [Display(Name = "价格")] - public decimal Price { get; set; } - [Display(Name = "物料编号")] - public string MaterialCode { get; set; } - [Display(Name = "价格类型")] - public int Type { get; set; } - - public Guid ParentId { set; get; } - - public int FileType { set; get; } - - public string Version { set; get; } - - public virtual List Filters { get; set; } = new List(); -} - -/// -/// UpdateDto -/// -public class PriceListUpdateDto : EntityDto -{ - /// - /// 是否作废 - /// - [Display(Name = "是否作废")] - public bool IsCancel { get; set; } -} - -#region 备件价格 -/// -/// 备件价格 -/// -public class PriceListBJDto : AuditedEntityDto -{ - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - public string LU { get; set; } - - /// - /// 价格 - /// - [Display(Name = "价格")] - public decimal Price { get; set; } - - /// - /// 开始时间 - /// - [Display(Name = "开始时间")] - public DateTime BeginDate { set; get; } - - /// - /// 结束时间 - /// - [Display(Name = "结束时间")] - public DateTime EndDate { set; get; } - - /// - /// 客户编码 - /// - [Display(Name = "客户编码")] - public string ClientCode { get; set; } - - /// - /// 合同签订时间 - /// - [Display(Name = "合同签订时间")] - public DateTime Date { get; set; } - - /// - /// 合同号 - /// - [Display(Name = "合同号")] - public string ContractNo { get; set; } - /// - /// 是否作废 - /// - [Display(Name = "是否作废")] - public bool IsCancel { get; set; } -} - -/// -/// 备件价格导出 -/// -[Display(Name = "备件价格")] -public class PriceListBJExportDto -{ - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - [ExporterHeader(DisplayName = "客户零件号")] - public string LU { get; set; } - - /// - /// 价格 - /// - [Display(Name = "价格")] - [ExporterHeader(DisplayName = "价格")] - public decimal Price { get; set; } - - /// - /// 开始时间 - /// - [Display(Name = "开始时间")] - [ExporterHeader(DisplayName = "开始时间")] - public DateTime BeginDate { set; get; } - - /// - /// 结束时间 - /// - [Display(Name = "结束时间")] - [ExporterHeader(DisplayName = "结束时间")] - public DateTime EndDate { set; get; } - - /// - /// 客户编码 - /// - [Display(Name = "客户编码")] - [ExporterHeader(DisplayName = "客户编码")] - public string ClientCode { get; set; } - - /// - /// 合同签订时间 - /// - [Display(Name = "合同签订时间")] - [ExporterHeader(DisplayName = "合同签订时间")] - public DateTime Date { get; set; } - - /// - /// 合同号 - /// - [Display(Name = "合同号")] - [ExporterHeader(DisplayName = "合同号")] - public string ContractNo { get; set; } -} - -/// -/// 客户备件价格导入 -/// -[Importer(HeaderRowIndex = 22)] -public class PriceListBJImportDto -{ - /// - /// 合同签订时间 - /// - [ImporterHeader(IsIgnore = true)] - [ExcelImporterHeadDesc(Row = 1, Cell = 1)] - public string Date { get; set; } - /// - /// 合同号 - /// - [ImporterHeader(IsIgnore = true)] - [ExcelImporterHeadDesc(Row = 2, Cell = 1)] - public string ContractNo { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - [Required(ErrorMessage = "{0}是必填项")] - [ImporterHeader(Name = "Part No.")] - public string PartNo { get; set; } - /// - /// 价格 - /// - [ImporterHeader(Name = "Total Price")] - public decimal TotalPrice { get; set; } - /// - /// 开始时间 - /// - [ImporterHeader(Name = "Valid From")] - public DateTime ValidFrom { get; set; } - /// - /// 结束时间 - /// - [ImporterHeader(Name = "Valid To")] - public DateTime ValidTo { get; set; } - /// - /// 客户编码 - /// - [ImporterHeader(Name = "Plant")] - public string Plant { get; set; } - /// - /// ES1 - /// - [ImporterHeader(Name = "ES1")] - public string ES1 { get; set; } - /// - /// ES2 - /// - [ImporterHeader(Name = "ES2")] - public string ES2 { get; set; } -} - -public class PriceListBJRequestDto : RequestInputBase +namespace Win.Sfs.SettleAccount.Entities.Prices { - [Display(Name = "开始时间")] - public DateTime BeginDate { get; set; } - [Display(Name = "结算时间")] - public DateTime EndDate { get; set; } - [Display(Name = "价格")] - public decimal Price { get; set; } - [Display(Name = "物料编号")] - public string MaterialCode { get; set; } - [Display(Name = "价格类型")] - public int Type { get; set; } - - public Guid ParentId { set; get; } - - public int FileType { set; get; } - - public string Version { set; get; } - - public virtual List Filters { get; set; } = new List(); -} - -/// -/// UpdateDto -/// -public class PriceListBJUpdateDto : EntityDto -{ - /// - /// 是否作废 - /// - [Display(Name = "是否作废")] - public bool IsCancel { get; set; } + public class PriceListDto : EntityDto + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string LU { get; set; } + /// + /// 价格 + /// + [Display(Name = "价格")] + public Decimal Price { set; get; } + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + public DateTime BeginTime { set; get; } + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + public DateTime EndTime { set; get; } + /// + /// 客户编码 + /// + [Display(Name = "客户编码")] + public string ClientCode { get; set; } + /// + /// 业务类别 + /// + [Display(Name = "业务类别")] + public EnumBusinessType BusinessType { get; set; } + /// + /// 版本 + /// + [Display(Name = "版本")] + public string Version { set; get; } + /// + /// 合同签订时间 + /// + [Display(Name = "合同签订时间")] + public string Date { get; set; } + /// + /// 合同号 + /// + [Display(Name = "合同号")] + public string ContractNo { get; set; } + /// + /// 是否作废 + /// + [Display(Name = "是否作废")] + public bool IsCancel { get; set; } + } + + /// + /// 销售价格单导出 + /// + public class PriceListExportDto + { + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string LU { get; set; } + /// + /// 价格 + /// + [Display(Name = "价格")] + [ExporterHeader(DisplayName = "价格")] + public Decimal Price { set; get; } + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + [ExporterHeader(DisplayName = "开始时间")] + public DateTime BeginTime { set; get; } + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + [ExporterHeader(DisplayName = "结束时间")] + public DateTime EndTime { set; get; } + /// + /// 客户编码 + /// + [Display(Name = "客户编码")] + [ExporterHeader(DisplayName = "客户编码")] + public string ClientCode { get; set; } + /// + /// 合同签订时间 + /// + [Display(Name = "合同签订时间")] + [ExporterHeader(DisplayName = "合同签订时间")] + public DateTime Date { get; set; } + /// + /// 合同号 + /// + [Display(Name = "合同号")] + [ExporterHeader(DisplayName = "合同号")] + public string ContractNo { get; set; } + } + + /// + /// 销售价格导入 + /// + [Importer(HeaderRowIndex = 22)] + public class PriceListImportDto + { + /// + /// 合同签订时间 + /// + [ImporterHeader(IsIgnore = true)] + [ExcelImporterHeadDesc(Row = 1, Cell = 1)] + public string Date { get; set; } + /// + /// 合同号 + /// + [ImporterHeader(IsIgnore = true)] + [ExcelImporterHeadDesc(Row = 2, Cell = 1)] + public string ContractNo { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [Required(ErrorMessage = "{0}是必填项")] + [ImporterHeader(Name = "Part No.")] + public string PartNo { get; set; } + /// + /// 价格 + /// + [ImporterHeader(Name = "Total Price")] + public decimal TotalPrice { get; set; } + /// + /// 开始时间 + /// + [ImporterHeader(Name = "Valid From")] + public DateTime ValidFrom { get; set; } + /// + /// 结束时间 + /// + [ImporterHeader(Name = "Valid To")] + public DateTime ValidTo { get; set; } + /// + /// 客户编码 + /// + [ImporterHeader(Name = "Plant")] + public string Plant { get; set; } + /// + /// ES1 + /// + [ImporterHeader(Name = "ES1")] + public string ES1 { get; set; } + /// + /// ES2 + /// + [ImporterHeader(Name = "ES2")] + public string ES2 { get; set; } + } + + public class PriceListRequestDto : PagedAndSortedResultRequestDto + { + [Display(Name = "开始时间")] + public DateTime BeginDate { get; set; } + [Display(Name = "结算时间")] + public DateTime EndDate { get; set; } + [Display(Name = "价格")] + public decimal Price { get; set; } + [Display(Name = "物料编号")] + public string MaterialCode { get; set; } + [Display(Name = "价格类型")] + public int Type { get; set; } + + public Guid ParentId { set; get; } + + public int FileType { set; get; } + + public string Version { set; get; } + + public virtual List Filters { get; set; } = new List(); + } + + /// + /// UpdateDto + /// + public class PriceListUpdateDto : EntityDto + { + /// + /// 是否作废 + /// + [Display(Name = "是否作废")] + public bool IsCancel { get; set; } + } + + #region 备件价格 + /// + /// 备件价格 + /// + public class PriceListBJDto : AuditedEntityDto + { + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string LU { get; set; } + + /// + /// 价格 + /// + [Display(Name = "价格")] + public decimal Price { get; set; } + + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + public DateTime BeginDate { set; get; } + + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + public DateTime EndDate { set; get; } + + /// + /// 客户编码 + /// + [Display(Name = "客户编码")] + public string ClientCode { get; set; } + + /// + /// 合同签订时间 + /// + [Display(Name = "合同签订时间")] + public DateTime Date { get; set; } + + /// + /// 合同号 + /// + [Display(Name = "合同号")] + public string ContractNo { get; set; } + /// + /// 是否作废 + /// + [Display(Name = "是否作废")] + public bool IsCancel { get; set; } + } + + /// + /// 备件价格导出 + /// + [Display(Name = "备件价格")] + public class PriceListBJExportDto + { + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string LU { get; set; } + + /// + /// 价格 + /// + [Display(Name = "价格")] + [ExporterHeader(DisplayName = "价格")] + public decimal Price { get; set; } + + /// + /// 开始时间 + /// + [Display(Name = "开始时间")] + [ExporterHeader(DisplayName = "开始时间")] + public DateTime BeginDate { set; get; } + + /// + /// 结束时间 + /// + [Display(Name = "结束时间")] + [ExporterHeader(DisplayName = "结束时间")] + public DateTime EndDate { set; get; } + + /// + /// 客户编码 + /// + [Display(Name = "客户编码")] + [ExporterHeader(DisplayName = "客户编码")] + public string ClientCode { get; set; } + + /// + /// 合同签订时间 + /// + [Display(Name = "合同签订时间")] + [ExporterHeader(DisplayName = "合同签订时间")] + public DateTime Date { get; set; } + + /// + /// 合同号 + /// + [Display(Name = "合同号")] + [ExporterHeader(DisplayName = "合同号")] + public string ContractNo { get; set; } + } + + /// + /// 客户备件价格导入 + /// + [Importer(HeaderRowIndex = 22)] + public class PriceListBJImportDto + { + /// + /// 合同签订时间 + /// + [ImporterHeader(IsIgnore = true)] + [ExcelImporterHeadDesc(Row = 1, Cell = 1)] + public string Date { get; set; } + /// + /// 合同号 + /// + [ImporterHeader(IsIgnore = true)] + [ExcelImporterHeadDesc(Row = 2, Cell = 1)] + public string ContractNo { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + [Required(ErrorMessage = "{0}是必填项")] + [ImporterHeader(Name = "Part No.")] + public string PartNo { get; set; } + /// + /// 价格 + /// + [ImporterHeader(Name = "Total Price")] + public decimal TotalPrice { get; set; } + /// + /// 开始时间 + /// + [ImporterHeader(Name = "Valid From")] + public DateTime ValidFrom { get; set; } + /// + /// 结束时间 + /// + [ImporterHeader(Name = "Valid To")] + public DateTime ValidTo { get; set; } + /// + /// 客户编码 + /// + [ImporterHeader(Name = "Plant")] + public string Plant { get; set; } + /// + /// ES1 + /// + [ImporterHeader(Name = "ES1")] + public string ES1 { get; set; } + /// + /// ES2 + /// + [ImporterHeader(Name = "ES2")] + public string ES2 { get; set; } + } + + public class PriceListBJRequestDto : RequestInputBase + { + [Display(Name = "开始时间")] + public DateTime BeginDate { get; set; } + [Display(Name = "结算时间")] + public DateTime EndDate { get; set; } + [Display(Name = "价格")] + public decimal Price { get; set; } + [Display(Name = "物料编号")] + public string MaterialCode { get; set; } + [Display(Name = "价格类型")] + public int Type { get; set; } + + public Guid ParentId { set; get; } + + public int FileType { set; get; } + + public string Version { set; get; } + + public virtual List Filters { get; set; } = new List(); + } + + /// + /// UpdateDto + /// + public class PriceListBJUpdateDto : EntityDto + { + /// + /// 是否作废 + /// + [Display(Name = "是否作废")] + public bool IsCancel { get; set; } + } } #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs index d9d6823d..cbe4fd42 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Prices/PriceListVersionDtoBase.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Filter; @@ -16,10 +13,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public string Period { get; set; } public string Version { get; set; } public string Factory { get; set; } - - } - + } public class PriceListVersionExportDto @@ -29,10 +24,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public string Period { get; set; } public string Version { get; set; } public string Factory { get; set; } - - } - + } public class PriceListVersionImportDto @@ -42,10 +35,8 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public string Period { get; set; } public string Version { get; set; } public string Factory { get; set; } - - } - + } public class PriceListVersionRequestDto : PagedAndSortedResultRequestDto @@ -55,24 +46,10 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public string Period { get; set; } public string Version { get; set; } public string Factory { get; set; } - + public virtual List Filters { get; set; } = new List(); } - - - - - - - - - - - - - - public class PriceListVersionBJDto : EntityDto { @@ -84,8 +61,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices } - - public class PriceListVersionBJExportDto { @@ -97,8 +72,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices } - - public class PriceListVersionBJImportDto { @@ -110,8 +83,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices } - - public class PriceListVersionBJRequestDto : PagedAndSortedResultRequestDto { @@ -124,11 +95,5 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public virtual List Filters { get; set; } = new List(); } - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/ISettleAccountAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/ISettleAccountAppService.cs index 628eaf74..62f1a6fa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/ISettleAccountAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/ISettleAccountAppService.cs @@ -1,23 +1,16 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; -using Win.Sfs.Shared.ApplicationBase; - namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { public interface ISettleAccountAppService - - { - + { /// /// 导入功能 @@ -25,10 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// 上传的文件(前端已经限制只能上传一个附件) /// - Task SettleAccountUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory); - - - + Task SettleAccountUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory); /// /// 按ID获取唯一实体 @@ -52,9 +42,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts Task> GetListAsync(Guid parentId, SettleAccountRequestDto input); - - - /// /// 根据筛选条件获取实体列表 /// @@ -66,9 +53,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts Task> GetVersionListAsync(SettleAccountVersionRequestDto input); - - - /// /// 获取实体总数 /// @@ -76,7 +60,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts Task GetTotalCountAsync(Guid branchId); - ///// ///// 获取全部实体列表 ///// @@ -84,20 +67,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts //Task> GetAllAsync(Guid branchId); - - - - ///// ///// 新增实体 ///// ///// 新增实体DTO ///// 实体DTO - //Task CreateAsync(SettleAccountCreateDto input); - ///// ///// 修改实体 ///// @@ -107,9 +84,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts //Task UpdateAsync(Guid id, SettleAccountUpdateDto input); - - - ///// ///// 删除实体 ///// @@ -118,7 +92,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts //Task DeleteAsync(Guid id); - /// /// 按IDs删除实体列表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountCreateDto.cs index ebc61729..5f80bfdf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountCreateDto.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { public class SettleAccountCreateDto : SettleAccountDtoBase, IBranch { - public virtual Guid BranchId { get ; set ; } + public virtual Guid BranchId { get; set; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDto.cs index c941492b..17415263 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDto.cs @@ -1,33 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - - - - - - - public class SettleAccountDto: AuditedEntityDtoBase, IBranch + public class SettleAccountDto : AuditedEntityDtoBase, IBranch { - - /// /// 期间 /// public string Period { set; get; } - - /// /// 年份 /// @@ -36,52 +21,50 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// /// 年份 /// - public virtual string Year { set; get; } + public virtual string Year { set; get; } /// /// KENEN号 /// - public virtual string KENNCode { set; get; } + public virtual string KENNCode { set; get; } /// /// 底盘号 /// - public virtual string ChassisNumber { set; get; } + public virtual string ChassisNumber { set; get; } /// /// 车型 /// - public virtual string Model { set; get; } + public virtual string Model { set; get; } /// /// CP5A日期 /// - public virtual DateTime CP5A { set; get; } + public virtual DateTime CP5A { set; get; } /// /// CP7 /// - public virtual DateTime CP7 { set; get; } + public virtual DateTime CP7 { set; get; } /// /// 零件号 /// - public virtual string MaterialCode { get; set; } + public virtual string MaterialCode { get; set; } /// /// 数量 /// - public virtual decimal Qty { get; set; } + public virtual decimal Qty { get; set; } /// /// 结算标识 /// - public virtual string SettlementID { get; set; } + public virtual string SettlementID { get; set; } /// /// 结算供应商 /// - public virtual string SettlementSupplier { get; set; } - + public virtual string SettlementSupplier { get; set; } public virtual string State { get; set; } - public virtual Guid BranchId { get ; set ; } - + public virtual Guid BranchId { get; set; } public virtual string Version { get; set; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDtoBase.cs index 2965f8b2..c467f186 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountDtoBase.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared.DomainBase; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - public class SettleAccountDtoBase: CreateOrUpdateEntityDtoBase + public class SettleAccountDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -16,8 +11,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// public string Period { set; get; } - - /// /// 年份 /// @@ -25,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// /// 年份 /// - public virtual string Year { set; get; } + public virtual string Year { set; get; } /// /// KENEN号 /// @@ -66,6 +59,5 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// public virtual string SettlementSupplier { get; set; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountExportDto.cs index 6cb9cbb1..913366e0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountExportDto.cs @@ -1,25 +1,18 @@ -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; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - public class SettleAccountExportDto + public class SettleAccountExportDto { [ExporterHeader(DisplayName = "版本")] public string Version { set; get; } - /// /// 期间 /// - //[ExporterHeader(DisplayName = "期间")] //public string Period { set; get; } @@ -33,53 +26,53 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// KENEN号 /// [ExporterHeader(DisplayName = "KENN号")] - public virtual string KENNCode { set; get; } + public virtual string KENNCode { set; get; } /// /// 底盘号 /// [ExporterHeader(DisplayName = "底盘号")] - public virtual string ChassisNumber { set; get; } + public virtual string ChassisNumber { set; get; } /// /// 车型 /// [ExporterHeader(DisplayName = "车型")] - public virtual string Model { set; get; } + public virtual string Model { set; get; } /// /// CP5A日期 /// [ExporterHeader(DisplayName = "CP5日期")] - public virtual DateTime CP5A { set; get; } + public virtual DateTime CP5A { set; get; } /// /// CP7 /// [ExporterHeader(DisplayName = "CP7日期")] - public virtual DateTime CP7 { set; get; } + public virtual DateTime CP7 { set; get; } /// /// 零件号 /// [ExporterHeader(DisplayName = "零件号")] - public virtual string MaterialCode { get; set; } + public virtual string MaterialCode { get; set; } /// /// 数量 /// [ExporterHeader(DisplayName = "数量")] - public virtual decimal Qty { get; set; } + public virtual decimal Qty { get; set; } /// /// 结算标识 /// [ExporterHeader(DisplayName = "R3结算数据")] - public virtual string SettlementID { get; set; } + public virtual string SettlementID { get; set; } /// /// 结算供应商 /// [ExporterHeader(DisplayName = "结算供应商")] - public virtual string SettlementSupplier { get; set; } + public virtual string SettlementSupplier { get; set; } //[ExporterHeader(DisplayName = "结算状态")] //public virtual int State { get; set; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountImportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountImportDto.cs index addcbd64..2eba7a4a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountImportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountImportDto.cs @@ -1,80 +1,71 @@ -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; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - public class SettleAccountImportDto + public class SettleAccountImportDto { // 年份 KENN号 底盘号 车型 CP5A日期 CP7日期 零件号 数量 结算标识 结算供应商 //过账日期 物料 物料描述 数量 单位 金额 工厂 工厂名称 物料凭证 物料凭证的年份 货币 项目 - - - // 年份 KENN号 底盘号 车型 CP5A日期 CP7日期 零件号 数量 结算标识 结算供应商 - + // 年份 KENN号 底盘号 车型 CP5A日期 CP7日期 零件号 数量 结算标识 结算供应商 /// /// 年份 /// - [ImporterHeader(Name= "年份")] + [ImporterHeader(Name = "年份")] public string SettleYear { set; get; } /// /// KENEN号 /// [ImporterHeader(Name = "KENN号")] - public virtual string KENNCode { set; get; } + public virtual string KENNCode { set; get; } /// /// 底盘号 /// [ImporterHeader(Name = "底盘号")] - public virtual string ChassisNumber { set; get; } + public virtual string ChassisNumber { set; get; } /// /// 车型 /// [ImporterHeader(Name = "车型")] - public virtual string Model { set; get; } + public virtual string Model { set; get; } /// /// CP5A日期 /// [ImporterHeader(Name = "CP5A日期")] - public virtual DateTime CP5A { set; get; } + public virtual DateTime CP5A { set; get; } /// /// CP7日期 /// [ImporterHeader(Name = "CP7日期")] - public virtual DateTime CP7 { set; get; } + public virtual DateTime CP7 { set; get; } /// /// 零件号 /// [ImporterHeader(Name = "零件号")] - public virtual string MaterialCode { get; set; } + public virtual string MaterialCode { get; set; } /// /// 数量 /// [ImporterHeader(Name = "数量")] - public virtual decimal Qty { get; set; } + public virtual decimal Qty { get; set; } /// /// 结算标识 /// [ImporterHeader(Name = "结算标识")] - public virtual string SettlementID { get; set; } + public virtual string SettlementID { get; set; } /// /// 结算供应商 /// [ImporterHeader(Name = "结算供应商")] - public virtual string SettlementSupplier { get; set; } - + public virtual string SettlementSupplier { get; set; } } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountRequestDto.cs index 32ab4e7b..aba90d9f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountRequestDto.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - public class SettleAccountRequestDto: RequestDtoBase, IBranch + public class SettleAccountRequestDto : RequestDtoBase, IBranch { /// @@ -17,8 +12,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// public string Period { set; get; } - - /// /// 年份 /// @@ -26,50 +19,49 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// /// 年份 /// - public virtual string Year { set; get; } + public virtual string Year { set; get; } /// /// KENEN号 /// - public virtual string KENNCode { set; get; } + public virtual string KENNCode { set; get; } /// /// 底盘号 /// - public virtual string ChassisNumber { set; get; } + public virtual string ChassisNumber { set; get; } /// /// 车型 /// - public virtual string Model { set; get; } + public virtual string Model { set; get; } /// /// CP5A日期 /// - public virtual DateTime CP5A { set; get; } + public virtual DateTime CP5A { set; get; } /// /// CP7 /// - public virtual DateTime CP7 { set; get; } + public virtual DateTime CP7 { set; get; } /// /// 零件号 /// - public virtual string MaterialCode { get; set; } + public virtual string MaterialCode { get; set; } /// /// 数量 /// - public virtual decimal Qty { get; set; } + public virtual decimal Qty { get; set; } /// /// 结算标识 /// - public virtual string SettlementID { get; set; } + public virtual string SettlementID { get; set; } /// /// 结算供应商 /// - public virtual string SettlementSupplier { get; set; } - + public virtual string SettlementSupplier { get; set; } public virtual Guid ParentId { get; set; } - public virtual Guid BranchId { get; set ; } + public virtual Guid BranchId { get; set; } public virtual Guid UserId { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountUpdateDto.cs index 0feef813..a4768850 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountUpdateDto.cs @@ -1,16 +1,7 @@ -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.SettleAccounts { - public class SettleAccountUpdateDto: SettleAccountDtoBase + public class SettleAccountUpdateDto : SettleAccountDtoBase { - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountVersionDtoBase.cs index 19efeb8e..400ab9d5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettleAccounts/SettleAccountVersionDtoBase.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccountVersion @@ -30,14 +25,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccountVersion /// public string CustomerCode { private set; get; } - } - - public class SettleAccountVersionDto : AuditedEntityDtoBase, IBranch { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// @@ -50,8 +42,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccountVersion /// /// 客户号 /// - public string CustomerCode { set; get; } - public Guid BranchId { get ; set; } + public string CustomerCode { set; get; } + public Guid BranchId { get; set; } } public class SettleAccountVersionCreateDto : SettleAccountVersionDtoBase @@ -75,10 +67,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccountVersion /// 客户号 /// public string CustomerCode { private set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } - public class SettleAccountVersionImportDto + public class SettleAccountVersionImportDto { public string Year { get; private set; } @@ -96,8 +88,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccountVersion /// public string CustomerCode { private set; get; } - } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/ISettlementPakAndSparePartsAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/ISettlementPakAndSparePartsAppService.cs index cd9e3e49..f74537e8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/ISettlementPakAndSparePartsAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/ISettlementPakAndSparePartsAppService.cs @@ -1,17 +1,8 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion; -using Win.Sfs.SettleAccount.Entities.SettlementParts; using Win.Sfs.SettleAccount.Entities.SettlementPartss; -using Win.Sfs.SettleAccount.Inventories; -using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { @@ -19,90 +10,75 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { /// - /// IDȡΨһʵ + /// 按ID获取唯一实体 /// /// - /// ʵȫ + /// 返回实体全部属性 /// /// ID - /// ʵDTO + /// 实体DTO Task GetAsync(Guid id); /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб + /// 请求条件 + /// 实体DTO列表 Task> GetListAsync(SettlementPakAndSparePartsRequestDto input); - - /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб + /// 请求条件 + /// 实体DTO列表 Task> GetVersionListAsync(SettlementPakAndSparePartsVersionRequestDto input); - - - ///// - ///// ȡȫʵб + ///// 获取全部实体列表 ///// - ///// ʵDTOб + ///// 实体DTO列表 //Task> GetAllAsync(Guid branchId); - - - - ///// - ///// ʵ + ///// 新增实体 ///// - ///// ʵDTO - ///// ʵDTO - + ///// 新增实体DTO + ///// 实体DTO //Task CreateAsync(SettlementPartCreateDto input); - ///// - ///// ޸ʵ + ///// 修改实体 ///// ///// ID - ///// ޸ʵDTO - ///// ʵDTO + ///// 修改实体DTO + ///// 实体DTO //Task UpdateAsync(Guid id, SettlementPartUpdateDto input); - - - ///// - ///// ɾʵ + ///// 删除实体 ///// ///// ID - ///// + ///// //Task DeleteAsync(Guid id); - /// - /// IDsɾʵб + /// 按IDs删除实体列表 /// /// IDs - /// Ƿִгɹ + /// 是否执行成功 Task DeleteListAsync(List ids); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateDto.cs index e40c3daf..b23a34f9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateDto.cs @@ -1,26 +1,24 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { public class SettlementPakAndSparePartsCreateDto : SettlementPakAndSparePartsCreateOrUpdateDtoBase, IBranch { - + [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] public Guid BranchId { set; get; } - /// ///年度 /// [Display(Name = "年度")] - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 @@ -28,15 +26,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - /// /// 用户代码 /// @@ -44,4 +39,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss public string CustomerCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateOrUpdateDtoBase.cs index 83138a2d..3b7e7ecc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsCreateOrUpdateDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -8,10 +8,9 @@ using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { - public class SettlementPakAndSparePartsCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class SettlementPakAndSparePartsCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - /// /// 工厂 /// @@ -24,13 +23,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss [Display(Name = "车型")] public string Model { set; get; } - - [Display(Name = "结算件代码")] [Required(ErrorMessage = "{0}是必填项")] public string SettlementPartCode { get; set; } - [Display(Name = "结算件描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SettlementPartDesc { get; set; } @@ -41,8 +37,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss [Display(Name = "计量单位")] public string Uom { get; set; } - public bool Enabled { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsDto.cs index d4ea6205..0ebef861 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsDto.cs @@ -1,10 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementPartss @@ -28,14 +27,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPartss [Display(Name = "期间")] public string Period { set; get; } - /// /// 适用功能 /// [Display(Name = "适用功能")] public string ApplicableFunction { get; protected set; } - /// /// 结算件编码 /// @@ -43,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPartss //[Required(ErrorMessage = "{0}是必填项")] public string SettlementPartCode { get; set; } - /// /// 结算件描述 /// @@ -51,77 +47,66 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPartss //[MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SettlementPartDesc { get; set; } - /// /// (Erp散件)零件号 /// [Display(Name = "(Erp散件)零件号")] public string ErpSparePartCode { get; set; } - /// /// (Erp散件)零件名称 /// [Display(Name = "(Erp散件)零件名称")] public string ErpSparePartName { get; set; } - /// /// 零件类型 /// [Display(Name = "零件类型")] public string PartType { set; get; } - /// /// QAD代码 /// [Display(Name = "QAD代码")] public string QADCode { set; get; } - /// /// 供应商代码 /// [Display(Name = "供应商代码")] public string SupplierCode { set; get; } - /// /// 供应商名称 /// [Display(Name = "供应商名称")] public string SupplierName { set; get; } - /// /// 产品类 /// [Display(Name = "产品类")] public string ProductLine { get; internal set; } - /// /// 每车数量 /// [Display(Name = "每车数量")] public decimal PerCarNum { get; internal set; } - /// /// 单价 /// [Display(Name = "单价")] public decimal Price { get; set; } - /// /// 供货比例 /// [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - /// /// 辆份价格 /// @@ -136,6 +121,5 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPartss public string Version { get; set; } public string CustomerCode { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsExportDto.cs index d987a00d..1669d54c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsExportDto.cs @@ -1,38 +1,23 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Core.Filters; -using Magicodes.ExporterAndImporter.Core.Models; -using Magicodes.ExporterAndImporter.Excel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { - + public class SettlementPakAndSparePartsExportDto { - - - ///// ///// 期间 ///// //[ExporterHeader(DisplayName = "期间")] //public string Period { set; get; } - - - ///// ///// 用户代码 ///// //[ExporterHeader(DisplayName = "用户代码")] //public string CustomerCode { get; set; } - /// /// 工厂 /// @@ -45,7 +30,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss [ExporterHeader(DisplayName = "车型")] public string Model { set; get; } - /// /// 版本 /// @@ -53,34 +37,24 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss [ExporterHeader(DisplayName = "版本")] public string Version { set; get; } - - /// /// 车型 /// //[ExporterHeader(DisplayName = "ERP总成物料号")] //public string Model { set; get; } - - [ExporterHeader(DisplayName = "结算件代码")] public string SettlementPartCode { get; set; } - - [ExporterHeader(DisplayName = "结算件描述")] public string SettlementPartDesc { get; set; } - [ExporterHeader(DisplayName = "价格")] public decimal Price { get; set; } - + [ExporterHeader(DisplayName = "计量单位")] public string Uom { get; set; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsRequestDto.cs index 77705146..b17a55a2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsRequestDto.cs @@ -1,8 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -25,14 +24,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss [Display(Name = "期间")] public string Period { set; get; } - /// /// 适用功能 /// [Display(Name = "适用功能")] public string ApplicableFunction { get; protected set; } - /// /// 结算件编码 /// @@ -40,84 +37,72 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss //[Required(ErrorMessage = "{0}是必填项")] public string SettlementPartCode { get; set; } - /// /// 结算件描述 /// [Display(Name = "结算件描述")] public string SettlementPartDesc { get; set; } - /// /// (Erp散件)零件号 /// [Display(Name = "(Erp散件)零件号")] public string ErpSparePartCode { get; set; } - /// /// (Erp散件)零件名称 /// [Display(Name = "(Erp散件)零件名称")] public string ErpSparePartName { get; set; } - /// /// 零件类型 /// [Display(Name = "零件类型")] public string PartType { set; get; } - /// /// QAD代码 /// [Display(Name = "QAD代码")] public string QADCode { set; get; } - /// /// 供应商代码 /// [Display(Name = "供应商代码")] public string SupplierCode { set; get; } - /// /// 供应商名称 /// [Display(Name = "供应商名称")] public string SupplierName { set; get; } - /// /// 产品类 /// [Display(Name = "产品类")] public string ProductLine { get; internal set; } - /// /// 每车数量 /// [Display(Name = "每车数量")] public decimal PerCarNum { get; internal set; } - /// /// 单价 /// [Display(Name = "单价")] public decimal Price { get; set; } - /// /// 供货比例 /// [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - /// /// 辆份价格 /// @@ -137,4 +122,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss public string CustomerCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsUpdateDto.cs index 63f8b45a..686f17dc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsUpdateDto.cs @@ -1,11 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; -using Volo.Abp.ObjectExtending; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { @@ -13,4 +9,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss { public string ConcurrencyStamp { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsVersionDtoBase.cs index a945be0c..f69b0d4b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementPakAndSparePartss/SettlementPakAndSparePartsVersionDtoBase.cs @@ -1,58 +1,52 @@ - + using System; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementPakAndSparePartss -{ +{ /// /// SettlementPartVersion /// -public class SettlementPakAndSparePartsVersionDtoBase : CreateOrUpdateEntityDtoBase + public class SettlementPakAndSparePartsVersionDtoBase : CreateOrUpdateEntityDtoBase { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - + public string CustomerCode { set; get; } } - - public class SettlementPakAndSparePartsVersionDto : AuditedEntityDtoBase, IBranch { public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// public string CustomerCode { set; get; } - public string Factory { set; get; } - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } } public class SettlementPakAndSparePartsVersionCreateDto : SettlementPakAndSparePartsVersionDtoBase @@ -62,43 +56,41 @@ public class SettlementPakAndSparePartsVersionDtoBase : CreateOrUpdateEntityDtoB public class SettlementPakAndSparePartsVersionRequestDto : RequestDtoBase, IBranch { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - public Guid BranchId { get ; set ; } + public string CustomerCode { set; get; } + public Guid BranchId { get; set; } } public class SettlementPakAndSparePartsVersionImportDto { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - + public string CustomerCode { set; get; } } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ISettlementPartAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ISettlementPartAppService.cs index 2a26f8c3..247f6fc1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ISettlementPartAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ISettlementPartAppService.cs @@ -1,15 +1,9 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion; -using Win.Sfs.SettleAccount.Inventories; -using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { @@ -18,110 +12,90 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts { /// - /// 빦 + /// 导入功能 /// - /// ϴļ(ǰѾֻϴһ) + /// 上传的文件(前端已经限制只能上传一个附件) /// Task SettlementPartUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory); - - - /// - /// IDȡΨһʵ + /// 按ID获取唯一实体 /// /// - /// ʵȫ + /// 返回实体全部属性 /// /// ID - /// ʵDTO + /// 实体DTO Task GetAsync(Guid id); /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб - - Task> GetListAsync( SettlementPartRequestDto input); - - + /// 请求条件 + /// 实体DTO列表 + Task> GetListAsync(SettlementPartRequestDto input); /// - /// ɸѡȡʵб + /// 根据筛选条件获取实体列表 /// /// - /// :ɸѡб,,,ҳ + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 /// - /// - /// ʵDTOб + /// 请求条件 + /// 实体DTO列表 Task> GetVersionListAsync(SettlementPartVersionRequestDto input); - - - /// - /// ȡʵ + /// 获取实体总数 /// - /// ʵ + /// 实体总数 Task GetTotalCountAsync(Guid branchId); - ///// - ///// ȡȫʵб + ///// 获取全部实体列表 ///// - ///// ʵDTOб + ///// 实体DTO列表 //Task> GetAllAsync(Guid branchId); - - - - ///// - ///// ʵ + ///// 新增实体 ///// - ///// ʵDTO - ///// ʵDTO - + ///// 新增实体DTO + ///// 实体DTO //Task CreateAsync(SettlementPartCreateDto input); - ///// - ///// ޸ʵ + ///// 修改实体 ///// ///// ID - ///// ޸ʵDTO - ///// ʵDTO + ///// 修改实体DTO + ///// 实体DTO //Task UpdateAsync(Guid id, SettlementPartUpdateDto input); - - - ///// - ///// ɾʵ + ///// 删除实体 ///// ///// ID - ///// + ///// //Task DeleteAsync(Guid id); - /// - /// IDsɾʵб + /// 按IDs删除实体列表 /// /// IDs - /// Ƿִгɹ + /// 是否执行成功 Task DeleteListAsync(List ids); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ImportSettlementPartDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ImportSettlementPartDto.cs index 1316ccb1..6fcb234b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ImportSettlementPartDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/ImportSettlementPartDto.cs @@ -1,13 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com +using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { @@ -18,7 +15,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts /// [ImportProject(Name = SettleAccountModuleName.SettlementPart)] [ExcelImporter(IsLabelingError = true, MaxCount = int.MaxValue)] - public class ImportSettlementPartDto + public class ImportSettlementPartDto { ///// ///// 分支id @@ -42,13 +39,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ParentItemCode { get; set; } - - - [ImporterHeader(Name = "父物料描述")] + [ImporterHeader(Name = "父物料描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ParentItemDesc { get; set; } - [ImporterHeader(Name = "组件")] [Required(ErrorMessage = "{0}是必填项")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] @@ -58,20 +52,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ChildItemDesc { get; set; } - [ImporterHeader(Name = "组件数量")] [Required(ErrorMessage = "{0}是必填项")] - - public decimal Qty { get; set; } - + public decimal Qty { get; set; } [ImporterHeader(Name = "组件计量单位")] [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ChildItemUom { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateDto.cs index e7de77f4..6e8a3a99 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateDto.cs @@ -1,26 +1,24 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { public class SettlementPartCreateDto : SettlementPartCreateOrUpdateDtoBase, IBranch { - + [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] public Guid BranchId { set; get; } - /// ///年度 /// [Display(Name = "年度")] - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 @@ -28,15 +26,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - /// /// 用户代码 /// @@ -44,4 +39,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts public string CustomerCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateOrUpdateDtoBase.cs index a604a0fa..87bb0f19 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartCreateOrUpdateDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -8,10 +8,9 @@ using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { - public class SettlementPartCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class SettlementPartCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - /// /// 工厂 /// @@ -24,13 +23,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "车型")] public string Model { set; get; } - - [Display(Name = "结算件代码")] [Required(ErrorMessage = "{0}是必填项")] public string SettlementPartCode { get; set; } - [Display(Name = "结算件描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SettlementPartDesc { get; set; } @@ -41,8 +37,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "计量单位")] public string Uom { get; set; } - public bool Enabled { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartDto.cs index 5b12243b..87ac927b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartDto.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -19,12 +19,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts public Guid BranchId { get; set; } - /// ///年度 /// [Display(Name = "年度")] - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 @@ -32,7 +31,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// @@ -45,7 +43,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "用户代码")] public string CustomerCode { get; set; } - /// /// 工厂 /// @@ -58,12 +55,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "车型")] public string Model { set; get; } - [Display(Name = "结算件代码")] [Required(ErrorMessage = "{0}是必填项")] public string SettlementPartCode { get; set; } - [Display(Name = "结算件描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SettlementPartDesc { get; set; } @@ -74,8 +69,5 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "计量单位")] public string Uom { get; set; } - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartExportDto.cs index 40c4c3de..135d745c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartExportDto.cs @@ -1,38 +1,23 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Core.Filters; -using Magicodes.ExporterAndImporter.Core.Models; -using Magicodes.ExporterAndImporter.Excel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { - + public class SettlementPartExportDto { - - - ///// ///// 期间 ///// //[ExporterHeader(DisplayName = "期间")] //public string Period { set; get; } - - - ///// ///// 用户代码 ///// //[ExporterHeader(DisplayName = "用户代码")] //public string CustomerCode { get; set; } - /// /// 工厂 /// @@ -45,7 +30,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [ExporterHeader(DisplayName = "车型")] public string Model { set; get; } - /// /// 版本 /// @@ -53,34 +37,24 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [ExporterHeader(DisplayName = "版本")] public string Version { set; get; } - - /// /// 车型 /// //[ExporterHeader(DisplayName = "ERP总成物料号")] //public string Model { set; get; } - - [ExporterHeader(DisplayName = "结算件代码")] public string SettlementPartCode { get; set; } - - [ExporterHeader(DisplayName = "结算件描述")] public string SettlementPartDesc { get; set; } - [ExporterHeader(DisplayName = "价格")] public decimal Price { get; set; } - + [ExporterHeader(DisplayName = "计量单位")] public string Uom { get; set; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartRequestDto.cs index e163b1e5..99b8ab95 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartRequestDto.cs @@ -1,15 +1,13 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { - public class SettlementPartRequestDto : RequestDtoBase,IBranch + public class SettlementPartRequestDto : RequestDtoBase, IBranch { public Guid ParentId { set; get; } public Guid BranchId { get; set; } @@ -22,4 +20,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts public string CustomerCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartUpdateDto.cs index 0519bfc5..d5f77c77 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartUpdateDto.cs @@ -1,16 +1,12 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; -using Volo.Abp.ObjectExtending; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { - public class SettlementPartUpdateDto : SettlementPartCreateOrUpdateDtoBase, IHasConcurrencyStamp + public class SettlementPartUpdateDto : SettlementPartCreateOrUpdateDtoBase, IHasConcurrencyStamp { public string ConcurrencyStamp { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartVersionDtoBase.cs index 1504620e..a4ba282f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/SettlementParts/SettlementPartVersionDtoBase.cs @@ -1,58 +1,52 @@ - + using System; -using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts -{ +{ /// /// SettlementPartVersion /// -public class SettlementPartVersionDtoBase :CreateOrUpdateEntityDtoBase + public class SettlementPartVersionDtoBase : CreateOrUpdateEntityDtoBase { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - + public string CustomerCode { set; get; } } - - public class SettlementPartVersionDto : AuditedEntityDtoBase, IBranch { public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// public string CustomerCode { set; get; } - public string Factory { set; get; } - public Guid BranchId { get ; set; } + public Guid BranchId { get; set; } } public class SettlementPartVersionCreateDto : SettlementPartVersionDtoBase @@ -62,43 +56,41 @@ public class SettlementPartVersionDtoBase :CreateOrUpdateEntityDtoBase public class SettlementPartVersionRequestDto : RequestDtoBase, IBranch { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - public Guid BranchId { get ; set ; } + public string CustomerCode { set; get; } + public Guid BranchId { get; set; } } - public class SettlementPartVersionImportDto + public class SettlementPartVersionImportDto { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// - public string Period { get; set; } + public string Period { get; set; } /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// - public string CustomerCode { set; get; } - + public string CustomerCode { set; get; } } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/CustomerStorageLocationDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/CustomerStorageLocationDtoBase.cs index a2016b5c..8c0b3091 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/CustomerStorageLocationDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/CustomerStorageLocationDtoBase.cs @@ -1,18 +1,12 @@ -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 Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.StorageLocations { - + public class CustomerStorageLocationDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -23,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations /// 客户描述 /// public string CustomerDesc { set; get; } - + /// /// 存储地点 /// @@ -34,8 +28,6 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations } public virtual int State { set; get; } - - } public class CustomerStorageLocationCreateDto : CustomerStorageLocationDtoBase { @@ -46,9 +38,6 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations public class CustomerStorageLocationUpdateDto : CustomerStorageLocationDtoBase { - - - } public class CustomerStorageLocationRequestDto : RequestDtoBase, IBranch @@ -61,7 +50,7 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations /// 客户描述 /// public string CustomerDesc { set; get; } - + /// /// 存储地点 /// @@ -84,7 +73,7 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations /// 客户描述 /// public string CustomerDesc { set; get; } - + /// /// 存储地点 /// @@ -94,20 +83,18 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations } public virtual int State { get; set; } - + public Guid BranchId { get; set; } } public class CustomerStorageLocationImportDto { - /// /// 客户代码 /// [ImporterHeader(Name = "客户代码")] [Required(ErrorMessage = "{0}是必填项")] - public virtual string CustomerCode { set; get; } /// /// 客户描述 @@ -115,7 +102,7 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations [ImporterHeader(Name = "客户描述")] [Required(ErrorMessage = "{0}是必填项")] public virtual string CustomerDesc { set; get; } - + /// /// 存储地点 /// @@ -138,7 +125,6 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations [ExporterHeader(DisplayName = "客户代码")] [Required(ErrorMessage = "{0}是必填项")] - public string CustomerCode { set; get; } /// /// 客户描述 @@ -160,9 +146,6 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations [ExporterHeader(DisplayName = "存储地点类型")] public virtual int State { set; get; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/ICustomerStorageLocationAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/ICustomerStorageLocationAppService.cs index 02e3ee9a..e0618f7c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/ICustomerStorageLocationAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/StorageLocations/ICustomerStorageLocationAppService.cs @@ -1,21 +1,10 @@ -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 Volo.Abp.Application.Services; -using Win.Sfs.Shared; using Win.Sfs.Shared.ApplicationBase; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.StorageLocations { - public interface ICustomerStorageLocationAppService : ICrudAppService public string CustomerSupplierCode { get; set; } - /// /// 供应商代码 /// @@ -30,7 +24,6 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps public string CustomerCode { get; set; } - } public class SupplierItemSetUpCreateDto : SupplierItemSetUpDtoBase { @@ -41,9 +34,6 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps public class SupplierItemSetUpUpdateDto : SupplierItemSetUpDtoBase { - - - } public class SupplierItemSetUpRequestDto : RequestDtoBase, IBranch @@ -57,7 +47,6 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps /// public string CustomerSupplierCode { get; set; } - /// /// 供应商代码 /// @@ -86,7 +75,7 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps public Guid BranchId { get; set; } } - [ImportProject(Name =SettleAccountModuleName.SupplierItemSetUp)] + [ImportProject(Name = SettleAccountModuleName.SupplierItemSetUp)] public class SupplierItemSetUpImportDto { /// @@ -101,21 +90,16 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps [ImporterHeader(Name = "客户供应商代码")] [Required(ErrorMessage = "{0}是必填项")] - - public string CustomerSupplierCode { get; set; } - /// /// 供应商代码 /// [ImporterHeader(Name = "ERP供应商代码")] [Required(ErrorMessage = "{0}是必填项")] - public string ErpSupplierCode { get; set; } - /// /// 供应商代码 /// @@ -123,9 +107,6 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps [Required(ErrorMessage = "{0}是必填项")] public string CustomerCode { get; set; } - - - } public class SupplierItemSetUpExportDto { @@ -141,26 +122,18 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps /// [ExporterHeader(DisplayName = "客户供应商代码")] - - - public string CustomerSupplierCode { get; set; } - /// /// 供应商代码 /// [ExporterHeader(DisplayName = "ERP供应商代码")] - - public string ErpSupplierCode { get; set; } - [ExporterHeader(DisplayName = "客户代码")] - - public string CustomerCode { get; set; } + public string CustomerCode { get; set; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobDto.cs index ad68db97..37e3f6e1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobDto.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; namespace Win.Sfs.SettleAccount.Entities.TaskJobs { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobRequstDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobRequstDto.cs index 688d5095..176fb4e4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobRequstDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/JobRequstDto.cs @@ -1,33 +1,28 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; namespace Win.Sfs.SettleAccount.Entities.TaskJobs { public class JobRequestDto { - - public Guid Id { set; get; } - public long StateId { set; get; } - public string StateName { set; get; } - public string InvocationData { set; get; } - public string Arguments { set; get; } - public DateTime CreatedAt { set; get; } - public DateTime? ExpireAt { set; get; } - public string TaskId { set; get; } + public Guid Id { set; get; } + public long StateId { set; get; } + public string StateName { set; get; } + public string InvocationData { set; get; } + public string Arguments { set; get; } + public DateTime CreatedAt { set; get; } + public DateTime? ExpireAt { set; get; } - - public string Name { set; get; } - public string ActionName { set; get; } - public string Error { set; get; } - public string Creator { set; get; } - public string Email { set; get; } - public string FileName { set; get; } - public string DownFileName { set; get; } - public string ServiceName { set; get; } + public string TaskId { set; get; } + + public string Name { set; get; } + public string ActionName { set; get; } + public string Error { set; get; } + public string Creator { set; get; } + public string Email { set; get; } + public string FileName { set; get; } + public string DownFileName { set; get; } + public string ServiceName { set; get; } public string Type { set; get; } public string Remark { set; get; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobDto.cs index 8c358c76..1f8becd6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobDto.cs @@ -1,13 +1,7 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.TaskJobs { @@ -68,16 +62,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs /// [Display(Name = "上传文件")] public string FileName { get; set; } - + } } - - - - - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobExportDto.cs index 78ee2890..c3ab1c36 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobExportDto.cs @@ -1,13 +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; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.TaskJobs { @@ -63,17 +57,8 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs /// [ExporterHeader(DisplayName = "完成时间")] public DateTime CompleteTime { get; set; } - - - } - - + } } - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobImportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobImportDto.cs index 217f0b23..c88068d3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobImportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobImportDto.cs @@ -1,19 +1,11 @@ -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; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.Controls { - - public class TaskJobImportDto { @@ -79,12 +71,5 @@ namespace Win.Sfs.SettleAccount.Entities.Controls public string ConcurrencyStamp { get; set; } } - - - } - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobRequestDto.cs index 69de0b29..7e67462a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskJobs/TaskJobRequestDto.cs @@ -2,19 +2,12 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.TaskJobs { - - public class TaskJobRequestDto : PagedAndSortedResultRequestDto { @@ -41,16 +34,9 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs public DateTime CompleteTime { get; set; } [Display(Name = "上传文件")] public string FileName { get; set; } - + public virtual List Filters { get; set; } = new List(); } } - - - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs index 9816b795..f7e5e52c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/TaskListDto.cs @@ -1,10 +1,6 @@ -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 Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities { @@ -89,11 +85,8 @@ namespace Win.Sfs.SettleAccount.Entities public ExporterStatus State { set; get; } - - } - /// /// 大众看板出库单 /// @@ -174,8 +167,6 @@ namespace Win.Sfs.SettleAccount.Entities [ImporterHeader(Name = "开票金额")] public decimal Amt { set; get; } - - } /// @@ -239,7 +230,6 @@ namespace Win.Sfs.SettleAccount.Entities } - /// /// 大众备件出库单 /// @@ -300,7 +290,6 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "单据", IsIgnore = true)] public string BillNum { set; get; } - [ExporterHeader(DisplayName = "任务代码", IsIgnore = true)] public Guid TaskId { set; get; } @@ -315,10 +304,8 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "开票金额")] public decimal Amt { set; get; } - } - /// /// 大众备件手工出库单,带条码号 /// @@ -400,7 +387,6 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "单据", IsIgnore = true)] public string BillNum { set; get; } - [ImporterHeader(Name = "任务代码", IsIgnore = true)] [ExporterHeader(DisplayName = "任务代码", IsIgnore = true)] public Guid TaskId { set; get; } @@ -411,10 +397,8 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "开票金额")] public decimal Amt { set; get; } - } - /// /// 红旗数据手工出库单 /// @@ -476,7 +460,6 @@ namespace Win.Sfs.SettleAccount.Entities public decimal Amt { set; get; } } - /// ///一次性寄售销售出库单 /// @@ -520,7 +503,6 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "BillNum", IsIgnore = true)] public string BillNum { set; get; } - [ExporterHeader(DisplayName = "状态")] [ValueMapping("未处理", 0)] [ValueMapping("申请出库", 1)] @@ -630,7 +612,6 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "结算金额")] public decimal Amt { set; get; } - [ImporterHeader(Name = "单据号", IsIgnore = true)] [ExporterHeader(DisplayName = "单据号", IsIgnore = true)] public string BillNum { set; get; } @@ -660,7 +641,7 @@ namespace Win.Sfs.SettleAccount.Entities [ImporterHeader(Name = "结算数量")] [ExporterHeader(DisplayName = "结算数量")] public decimal Qty { set; get; } - + [ImporterHeader(Name = "开票单价")] [ExporterHeader(DisplayName = "开票单价")] @@ -669,17 +650,13 @@ namespace Win.Sfs.SettleAccount.Entities [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; } - } @@ -727,7 +704,6 @@ namespace Win.Sfs.SettleAccount.Entities public class WmsSharePartOutPutDetialTemplateDTO { - [ImporterHeader(Name = "SAP编码")] [ExporterHeader(DisplayName = "SAP编码")] //物料号 @@ -740,9 +716,7 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "物料组(车型)")] //物料组(车型) public string MaterialGroup { set; get; } - - - + [ImporterHeader(Name = "开票数量")] [ExporterHeader(DisplayName = "开票数量")] public decimal Qty { set; get; } @@ -755,10 +729,8 @@ namespace Win.Sfs.SettleAccount.Entities [ExporterHeader(DisplayName = "开票金额")] public decimal Amt { set; get; } - } - public enum ExporterStatus { /// @@ -811,5 +783,3 @@ namespace Win.Sfs.SettleAccount.Entities } - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs index ba7262bc..931aabf4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/IUnHQSettleAppService.cs @@ -1,10 +1,8 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts @@ -43,9 +41,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts Task> GetListAsync(UnHQSettleRequestDto input); - - - /// /// 根据筛选条件获取实体列表 /// @@ -57,7 +52,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts Task> GetVersionListAsync(UnHQSettleVersionRequestDto input); - Task ExportAsync(UnHQSettleRequestDto input); /// @@ -67,10 +61,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts Task GetTotalCountAsync(Guid branchId); - - - - ///// ///// 删除实体 ///// @@ -79,7 +69,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts Task DeleteAsync(Guid id); - /// /// 按IDs删除实体列表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs index b9e5f6e8..454863e2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleCreateDto.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs index 8dcb17f9..56696fbc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDto.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts @@ -43,7 +39,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// public string HQHKanBan { set; get; } - /// /// 物料号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs index c5584c57..a78e46ed 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleDtoBase.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts @@ -43,7 +39,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// public string HQHKanBan { set; get; } - /// /// 物料号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs index dc532b15..83181099 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleExportDto.cs @@ -1,9 +1,5 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts { @@ -51,7 +47,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts [ExporterHeader(DisplayName = "看板号")] public string HQHKanBan { set; get; } - /// /// 物料号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs index ceb4f942..9053ac1b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleImportDto.cs @@ -1,9 +1,5 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts { @@ -51,7 +47,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts [ImporterHeader(Name = "看板号")] public string HQHKanBan { set; get; } - /// /// 物料号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs index 9efa6f6e..65d4419a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleRequestDto.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts @@ -44,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// public string HQHKanBan { set; get; } - /// /// 物料号 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs index 1cba8b01..7f5ef340 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/UnHQSettleAccounts/UnHQSettleVersionDtoBase.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -29,11 +25,8 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// public string CustomerCode { private set; get; } - } - - public class UnHQSettleVersionDto : AuditedEntityDtoBase, IBranch { public string Year { get; set; } @@ -95,6 +88,5 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// public string CustomerCode { private set; get; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/IVWKanBanAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/IVWKanBanAppService.cs index 9323c46f..52213acc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/IVWKanBanAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/IVWKanBanAppService.cs @@ -1,23 +1,16 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.VWKanBanVersion; -using Win.Sfs.Shared.ApplicationBase; - namespace Win.Sfs.SettleAccount.Entities.VWKanBan { public interface IVWKanBanAppService - - { - + { /// /// 导入功能 @@ -27,9 +20,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan Task VWKanBanUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode); - - - /// /// 按ID获取唯一实体 /// @@ -52,9 +42,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan Task> GetListAsync(VWKanBanRequestDto input); - - - /// /// 根据筛选条件获取实体列表 /// @@ -66,7 +53,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan Task> GetVersionListAsync(VWKanBanVersionRequestDto input); - Task ExportAsync(VWKanBanRequestDto input); /// @@ -76,7 +62,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan Task GetTotalCountAsync(Guid branchId); - ///// ///// 获取全部实体列表 ///// @@ -84,20 +69,14 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan //Task> GetAllAsync(Guid branchId); - - - - ///// ///// 新增实体 ///// ///// 新增实体DTO ///// 实体DTO - //Task CreateAsync(SettleAccountCreateDto input); - ///// ///// 修改实体 ///// @@ -107,9 +86,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan //Task UpdateAsync(Guid id, SettleAccountUpdateDto input); - - - ///// ///// 删除实体 ///// @@ -118,7 +94,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan Task DeleteAsync(Guid id); - /// /// 按IDs删除实体列表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanCreateDto.cs index 7ae0eeca..758c8a51 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanCreateDto.cs @@ -1,16 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.SettleAccount.Entities.VWKanBan; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { public class VWKanBanCreateDto : VWKanBanDtoBase, IBranch { - public virtual Guid BranchId { get ; set ; } + public virtual Guid BranchId { get; set; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDto.cs index b54ce9f2..a9d17907 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.VWKanBan @@ -12,7 +6,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// /// 大众看板结算 /// - public class VWKanBanDto: AuditedEntityDtoBase + public class VWKanBanDto : AuditedEntityDtoBase { /// /// 期间 @@ -32,43 +26,42 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// /// 入库关联号 /// - public virtual string Relation { set; get; } + public virtual string Relation { set; get; } /// /// 工厂 /// - public virtual string Factory { set; get; } + public virtual string Factory { set; get; } /// /// 零件号 /// - public virtual string MaterialCode { set; get; } + public virtual string MaterialCode { set; get; } /// /// 零件类型 /// - public virtual string PartType { set; get; } + public virtual string PartType { set; get; } /// /// R3入库时间 /// - public virtual DateTime SettleInputDate { set; get; } - + public virtual DateTime SettleInputDate { set; get; } /// ///供应商编码 /// - public virtual string SupplierCode { get; set; } + public virtual string SupplierCode { get; set; } /// /// 数量 /// - public virtual decimal Qty { get; set; } + public virtual decimal Qty { get; set; } /// /// 批次 /// - public virtual string Batch { get; set; } + public virtual string Batch { get; set; } /// /// 入库结算标识 /// - public virtual string Flag { get; set; } + public virtual string Flag { get; set; } /// /// 结算日期 @@ -78,7 +71,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// /// 结算状态 /// - public virtual string State { get ; set ; } + public virtual string State { get; set; } /// /// 备注 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDtoBase.cs index 43aec274..2be37d6f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanDtoBase.cs @@ -1,14 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared.DomainBase; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.VWKanBan { - public class VWKanBanDtoBase: CreateOrUpdateEntityDtoBase + public class VWKanBanDtoBase : CreateOrUpdateEntityDtoBase { /// @@ -16,8 +11,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// public string Period { set; get; } - - /// ///看板条码号 /// @@ -44,7 +37,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// public virtual DateTime SettleInputDate { set; get; } - /// ///供应商编码 /// @@ -74,13 +66,11 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// public virtual int State { get; set; } - public virtual string Version { get; set; } /// /// 备注 /// public virtual string Remark { get; set; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanExportDto.cs index 77a28a6c..50784516 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanExportDto.cs @@ -1,14 +1,9 @@ -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; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.VWKanBan { - public class VWKanBanExportDto + public class VWKanBanExportDto { /// @@ -55,7 +50,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan [ExporterHeader(DisplayName = "R3入库日期")] public virtual DateTime SettleInputDate { set; get; } - /// ///供应商编码 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImportDto.cs index b5494680..789c6945 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImportDto.cs @@ -1,14 +1,8 @@ -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; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.VWKanBan { - public class VWKanBanImportDto + public class VWKanBanImportDto { ///// @@ -55,7 +49,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan [ImporterHeader(Name = "R3入库日期")] public virtual string SettleInputDate { set; get; } - /// ///供应商编码 /// @@ -91,5 +84,5 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan public virtual string State { get; set; } } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImport_EmpDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImport_EmpDto.cs index e78e38bd..1defe879 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImport_EmpDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanImport_EmpDto.cs @@ -1,9 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.VWKanBan { @@ -54,7 +49,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan [ImporterHeader(Name = "R3入库日期")] public virtual string SettleInputDate { set; get; } - /// ///供应商编码 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanRequestDto.cs index daa012a9..e764f3e6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanRequestDto.cs @@ -1,15 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; +using System; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.VWKanBan { - public class VWKanBanRequestDto: RequestDtoBase + public class VWKanBanRequestDto : RequestDtoBase { /// @@ -48,7 +42,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBan /// public virtual DateTime SettleInputDate { set; get; } - /// ///供应商编码 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanVersionDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanVersionDtoBase.cs index 6c38e202..7c72a021 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanVersionDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBanVersionDtoBase.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.VWKanBanVersion @@ -30,14 +25,11 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBanVersion /// public string CustomerCode { private set; get; } - } - - public class VWKanBanVersionDto : AuditedEntityDtoBase, IBranch { - public string Year { get; set; } + public string Year { get; set; } /// /// 期间 /// @@ -50,8 +42,8 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBanVersion /// /// 客户号 /// - public string CustomerCode { set; get; } - public Guid BranchId { get ; set; } + public string CustomerCode { set; get; } + public Guid BranchId { get; set; } } public class VWKanBanVersionCreateDto : VWKanBanVersionDtoBase @@ -75,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBanVersion /// 客户号 /// public string CustomerCode { private set; get; } - public Guid BranchId { get ; set ; } + public Guid BranchId { get; set; } } public class VWKanBanVersionImportDto @@ -96,8 +88,6 @@ namespace Win.Sfs.SettleAccount.Entities.VWKanBanVersion /// public string CustomerCode { private set; get; } - } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBantUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBantUpdateDto.cs index 03951568..93ea5e94 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBantUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/VWKanBan/VWKanBantUpdateDto.cs @@ -1,16 +1,7 @@ -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.VWKanBan { - public class VWKanBantUpdateDto: VWKanBanDtoBase + public class VWKanBantUpdateDto : VWKanBanDtoBase { - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs index e6b5fbcb..9ce2e1de 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsDetailReportDto.cs @@ -1,15 +1,11 @@ -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 Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput { - public class WmsRequestDetailReportDto: RequestDtoBase + public class WmsRequestDetailReportDto : RequestDtoBase { [Display(Name = "版本")] public string Version { set; get; } @@ -54,33 +50,26 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput [Display(Name = "备注")] public string Remark1 { set; get; } - [ExporterHeader(DisplayName = "状态",IsIgnore =true)] + [ExporterHeader(DisplayName = "状态", IsIgnore = true)] public int State { set; get; } - [ExporterHeader(DisplayName = "账期",IsIgnore =true)] + [ExporterHeader(DisplayName = "账期", IsIgnore = true)] public DateTime AccountDate { set; get; } } - - - public class WmsDetailReportDto + public class WmsDetailReportDto { public WmsDetailReportDto() { - - } - - [Display(Name = "行号")] public int LineNumber { set; get; } [Display(Name = "版本号")] public string Version { set; get; } - [Display(Name = "客户")] public string Client { set; get; } [Display(Name = "出库类型")] @@ -126,15 +115,12 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput public DateTime AccountDate { set; get; } } - - public class WmsDetailDiffReportDto + public class WmsDetailDiffReportDto { public WmsDetailDiffReportDto() { } - - [Display(Name = "版本号")] public string Version { set; get; } @@ -190,8 +176,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput { } - - [Display(Name = "版本号")] public string Version { set; get; } @@ -241,10 +225,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput } - - - - /// /// 有条码业务 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs index 16be3bb9..aa8de75d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/Wms/WmsJitOutPutDetialDto.cs @@ -1,9 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.DtoBase; @@ -15,8 +12,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms { } - - public string Version { set; get; } public string BillNum { set; get; } @@ -25,28 +20,21 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string SumContent { set; get; } - - - } - public class WmsJitOutPutRequestDto: RequestDtoBase + public class WmsJitOutPutRequestDto : RequestDtoBase { public WmsJitOutPutRequestDto() { } - - public string Version { set; get; } public string BillNum { set; get; } public string Creator { set; get; } - - } - public class WmsJitOutPutDetialDto: AuditedEntityDto + public class WmsJitOutPutDetialDto : AuditedEntityDto { [ImporterHeader(Name = "交货单号")] public string WmsBillNum { set; get; } @@ -72,14 +60,12 @@ namespace Win.Sfs.SettleAccount.Entities.Wms [ImporterHeader(Name = "物料组(车型)")] //物料组(车型) public string MaterialGroup { set; get; } - + [ImporterHeader(Name = "结算数量")] public decimal Qty { set; get; } - - } - public class WmsJitOutPutDetialRequestDto: RequestDtoBase + public class WmsJitOutPutDetialRequestDto : RequestDtoBase { [ImporterHeader(Name = "交货单号")] public string WmsBillNum { set; get; } @@ -108,11 +94,9 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string BillNum { set; get; } - - } - public class WmsJitRequestDto + public class WmsJitRequestDto { public DateTime AccountDate { set; get; } @@ -120,20 +104,14 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string Version { set; get; } public List Guids { set; get; } - - } - - - public class WmsKanbanOutPutDto: AuditedEntityDto + public class WmsKanbanOutPutDto : AuditedEntityDto { public WmsKanbanOutPutDto() { } - - public string Version { set; get; } public string BillNum { set; get; } @@ -142,7 +120,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string SumContent { set; get; } - } public class WmsKanbanOutPutRequestDto : RequestDtoBase { @@ -150,23 +127,18 @@ namespace Win.Sfs.SettleAccount.Entities.Wms { } - - public string Version { set; get; } public string BillNum { set; get; } public string Creator { set; get; } - - } - public class WmsKanbanOutPutDetialDto: AuditedEntityDto + public class WmsKanbanOutPutDetialDto : AuditedEntityDto { [ImporterHeader(Name = "交货单号")] public string WmsBillNum { set; get; } - [ImporterHeader(Name = "订单号")] //底盘号 public string Kanban { set; get; } @@ -174,7 +146,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms //物料号 public string MaterialCode { set; get; } - [ImporterHeader(Name = "物料描述")] //物料描述 public string MaterialDesc { set; get; } @@ -186,11 +157,8 @@ namespace Win.Sfs.SettleAccount.Entities.Wms [ImporterHeader(Name = "交货数量")] public decimal Qty { set; get; } - - } - public class WmsOneTimeSaleOutPutDetialRequestDto : RequestDtoBase { [ImporterHeader(Name = "交货单号")] @@ -206,9 +174,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms //物料号 public string MaterialCode { set; get; } - - - [ImporterHeader(Name = "物料描述")] //物料描述 public string MaterialDesc { set; get; } @@ -217,10 +182,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms //物料组(车型) public string MaterialGroup { set; get; } - - - - } public class WmsKanbanOutPutDetialRequestDto : RequestDtoBase @@ -228,7 +189,7 @@ namespace Win.Sfs.SettleAccount.Entities.Wms [ImporterHeader(Name = "交货单号")] public string WmsBillNum { set; get; } - [ImporterHeader(Name = "单号",IsIgnore =true)] + [ImporterHeader(Name = "单号", IsIgnore = true)] public string BillNum { set; get; } [ImporterHeader(Name = "订单号")] //底盘号 @@ -238,9 +199,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms //物料号 public string MaterialCode { set; get; } - - - [ImporterHeader(Name = "物料描述")] //物料描述 public string MaterialDesc { set; get; } @@ -252,10 +210,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms [ImporterHeader(Name = "状态", IsIgnore = true)] public int State { set; get; } - - - - } public class WmsSharePartOutPutDto @@ -269,8 +223,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string Creator { set; get; } - - } public class WmsSharePartOutPutRequestDto : RequestDtoBase { @@ -283,15 +235,12 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string Creator { set; get; } - - } public class WmsSharePartOutPutDetialDto { [ImporterHeader(Name = "交货单号")] public string WmsBillNum { set; get; } - [ImporterHeader(Name = "订单号")] //底盘号 public string SharePart { set; get; } @@ -299,7 +248,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms //物料号 public string MaterialCode { set; get; } - [ImporterHeader(Name = "物料描述")] //物料描述 public string MaterialDesc { set; get; } @@ -311,15 +259,12 @@ namespace Win.Sfs.SettleAccount.Entities.Wms [ImporterHeader(Name = "交货数量")] public decimal Qty { set; get; } - - } public class WmsSharePartOutPutDetialRequestDto : RequestDtoBase { [ImporterHeader(Name = "交货单号")] public string WmsBillNum { set; get; } - [ImporterHeader(Name = "订单号")] //底盘号 public string Kanban { set; get; } @@ -340,11 +285,6 @@ namespace Win.Sfs.SettleAccount.Entities.Wms public string BillNum { set; get; } - - - } - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/ErrorExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/ErrorExportDto.cs index 3c760e82..d56484b7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/ErrorExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/ErrorExportDto.cs @@ -1,13 +1,8 @@ // 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.ExportReports { @@ -39,7 +34,6 @@ namespace Win.Sfs.SettleAccount.ExportReports [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -89,12 +83,8 @@ namespace Win.Sfs.SettleAccount.ExportReports [Display(Name = "备注")] public string Remark { get; set; } - } - - - /// /// 错误信息说明 /// @@ -123,7 +113,6 @@ namespace Win.Sfs.SettleAccount.ExportReports [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -143,7 +132,7 @@ namespace Win.Sfs.SettleAccount.ExportReports /// [Display(Name = "问题模块")] - public string Model { get; set; } + public string Model { get; set; } /// /// 物料号 @@ -173,6 +162,5 @@ namespace Win.Sfs.SettleAccount.ExportReports [Display(Name = "备注")] public string Remark { get; set; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/BTSeqKBDiffDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/BTSeqKBDiffDetailDto.cs index f3e5f50b..84d68877 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/BTSeqKBDiffDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/BTSeqKBDiffDetailDto.cs @@ -1,14 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; -using Volo.Abp.Application.Dtos; using Magicodes.ExporterAndImporter.Core; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.SecondaryExportReports { @@ -16,7 +12,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 二配汇总输出表 /// public class BTSeqKBDiffDetail : EntityDto - { + { /// /// 年度 /// @@ -27,13 +23,13 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 期间 /// [Display(Name = "期间")] - public string Period { set; get; } + public string Period { set; get; } /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } + public string Version { set; get; } /// /// 客户总成物料号 @@ -69,19 +65,17 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "车序数量")] public int SeqQty { get; set; } - /// /// 看板数量 /// [Display(Name = "看板数量")] public int KBQty { get; set; } - /// /// 数量差异 /// [Display(Name = "数量差异")] - public int DiffQty { get; set; } + public int DiffQty { get; set; } /// /// 备注 @@ -90,4 +84,4 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "备注")] public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/InvoicePriceListDiffDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/InvoicePriceListDiffDto.cs index 580129de..77e1c19d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/InvoicePriceListDiffDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/InvoicePriceListDiffDto.cs @@ -1,66 +1,60 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.SettleAccount.ExportReports.SecondaryExportReports { - - public class InvoicePriceListDiffDto - { - - /// - /// 年 - /// - public string Year { set; get; } - /// - /// 期间 - /// - public string Period { set; get; } - /// - /// 版本 - /// - public string Version { set; get; } - /// - /// 状态 - /// - public int State { set; get; } - - /// - /// 工厂 - /// - public string Factory { set; get; } - /// - /// - /// - public string TextCode { set; get; } - /// - /// 物料号 - /// - public string MaterialCode { set; get; } - /// - /// 物料描述 - /// - public string MaterialDesc { set; get; } - public DateTime InputDate { set; get; } - public decimal Qty { set; get; } - public decimal Amt { set; get; } - public string Number { set; get; } - public string Accounting { set; get; } - public DateTime? AccountDate { set; get; } - public DateTime? BeginDate { set; get; } - public DateTime? EndDate { set; get; } - public decimal Price { set; get; } - public int Type { set; get; } - } - public class InvoicePriceListDiffExportDto + public class InvoicePriceListDiffDto { + /// + /// 年 + /// + public string Year { set; get; } + /// + /// 期间 + /// + public string Period { set; get; } + /// + /// 版本 + /// + public string Version { set; get; } + /// + /// 状态 + /// + public int State { set; get; } + + /// + /// 工厂 + /// + public string Factory { set; get; } + /// + /// + /// + public string TextCode { set; get; } + /// + /// 物料号 + /// + public string MaterialCode { set; get; } + /// + /// 物料描述 + /// + public string MaterialDesc { set; get; } + public DateTime InputDate { set; get; } + public decimal Qty { set; get; } + public decimal Amt { set; get; } + public string Number { set; get; } + public string Accounting { set; get; } + public DateTime? AccountDate { set; get; } + public DateTime? BeginDate { set; get; } + public DateTime? EndDate { set; get; } + public decimal Price { set; get; } + public int Type { set; get; } + } + + public class InvoicePriceListDiffExportDto + { - /// /// 版本号 /// @@ -128,10 +122,9 @@ namespace Win.Sfs.SettleAccount.ExportReports.SecondaryExportReports /// /// 状态 /// - [Display(Name ="状态")] + [Display(Name = "状态")] public int State { set; get; } - //public DateTime? BeginDate { set; get; } //public DateTime? EndDate { set; get; } [Display(Name = "价格表价格")] @@ -139,9 +132,5 @@ namespace Win.Sfs.SettleAccount.ExportReports.SecondaryExportReports } - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecActualDistributionDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecActualDistributionDetailDto.cs index 2e1aad83..832fd742 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecActualDistributionDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecActualDistributionDetailDto.cs @@ -1,14 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; -using Volo.Abp.Application.Dtos; using Magicodes.ExporterAndImporter.Core; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.SecondaryExportReports { @@ -16,7 +11,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 实际二配明细输出表 /// public class SecActualDistributionDetailDto : EntityDto - { + { /// /// 年度 /// @@ -27,19 +22,19 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 期间 /// [Display(Name = "期间")] - public string Period { set; get; } + public string Period { set; get; } /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } + public string Version { set; get; } /// /// 客户总成物料号 /// [Display(Name = "客户总成物料号")] - + public string CustomItemCode { get; set; } /// @@ -54,7 +49,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - /// /// ERP总成物料号 /// @@ -89,20 +83,18 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "ERP组件用量")] public decimal ErpSubItemQty { get; set; } - ///// ///// ERP组件物料号每个总成用量 ///// //[Display(Name = "ERP组件实际用量")] //public decimal ErpSubItemActualQty { get; set; } - /// /// 客户组件物料号 /// [Display(Name = "客户组件物料号")] - public string CustomSubItemCode { get; set; } + public string CustomSubItemCode { get; set; } /// /// 零件属性 @@ -111,8 +103,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports public string MaterialProperty { get; set; } - - /// /// 供应商代码 /// @@ -127,7 +117,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "供应商描述")] public string SupplierDesc { get; set; } - ///// ///// 供货比例 ///// @@ -135,7 +124,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports //[Display(Name = "供货比例")] //public string SupplyProportion { get; set; } - /// /// ERP组件暂估类 /// @@ -143,7 +131,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "ERP组件暂估类")] public string ErpSubItemEstimationType { get; set; } - /// /// 零件单价 /// @@ -158,7 +145,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "零件数量(回款)")] public decimal CustomSubItemSumQty { get; set; } - /// /// 金额(不含税) /// @@ -166,14 +152,12 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "金额(不含税)")] public decimal SumPriceNoTax { get; set; } - /// /// 金额(含税) /// [Display(Name = "金额(含税)")] public decimal SumPriceWithTax { set; get; } - /// /// 价格或零件号变动情况 /// @@ -181,7 +165,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "价格或零件号变动情况")] public string HasChanged { get; set; } = "否"; - /// /// 二配采购员 /// @@ -189,7 +172,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "二配采购员")] public string Buyer { get; set; } - /// /// 备注 /// @@ -197,4 +179,4 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "备注")] public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecCumulativeSummaryDiffExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecCumulativeSummaryDiffExportDto.cs index e62ee79c..ffa8e65b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecCumulativeSummaryDiffExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecCumulativeSummaryDiffExportDto.cs @@ -1,14 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Volo.Abp.Application.Dtos; -using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.SecondaryExportReports { @@ -16,18 +10,18 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 二配汇总输出表 /// public class SecCumulativeSummaryDiffExportDto : EntityDto - { + { /// /// 年度 /// [Display(Name = "年度")] public string Year { set; get; } - + /// /// 客户总成物料号 /// [Display(Name = "客户总成物料号")] - + public string CustomItemCode { get; set; } ///// @@ -78,7 +72,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 供应商代码 /// [Display(Name = "供应商代码")] - public string SupplierCode { set; get; } + public string SupplierCode { set; get; } /// @@ -92,7 +86,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// [Display(Name = "1月数量差异")] - public decimal JanDiffQty { get; set; } + public decimal JanDiffQty { get; set; } /// @@ -100,7 +94,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// [Display(Name = "1月金额差异")] - public decimal JanDiffAmount { get; set; } + public decimal JanDiffAmount { get; set; } /// /// 2月数量差异 @@ -284,4 +278,4 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "本年累计金额差异")] public decimal YearDiffAmount { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSettlementAssemblyPartDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSettlementAssemblyPartDto.cs index 3e2d9a22..5d825a83 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSettlementAssemblyPartDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSettlementAssemblyPartDto.cs @@ -1,14 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; -using Volo.Abp.Application.Dtos; using Magicodes.ExporterAndImporter.Core; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.SecondaryExportReports { @@ -16,7 +11,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 实体DTO /// public class SecSettlementAssemblyPartDto : EntityDto - { + { /// /// 年度 /// @@ -27,37 +22,34 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 期间 /// [Display(Name = "期间")] - public string Period { set; get; } + public string Period { set; get; } /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } + public string Version { set; get; } /// /// 客户总成物料号 /// [Display(Name = "客户总成物料号")] - + public string CustomItemCode { get; set; } /// /// 客户总成物料号描述 /// - [IEIgnoreAttribute] + [IEIgnoreAttribute] [Display(Name = "客户总成描述")] public string CustomItemDesc { get; set; } - /// /// 客户总成物料号下线数量 /// [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - - /// /// ERP总成物料号 /// @@ -83,16 +75,14 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// ERP组件物料号描述 /// [Display(Name = "ERP组件描述")] - public string ErpSubItemDesc { get; set; } - + public string ErpSubItemDesc { get; set; } /// /// ERP组件暂估类 /// [Display(Name = "ERP组件暂估类")] - public string ErpSubItemEstimationType { get; set; } - + public string ErpSubItemEstimationType { get; set; } /// /// 客户组件物料号 @@ -114,7 +104,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "每个总成用量")] public decimal ErpSubItemQty { set; get; } - /// /// 供应商代码 /// @@ -122,4 +111,4 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "供应商代码")] public string SupplierCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecStandardDistributionDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecStandardDistributionDetailDto.cs index 94eacc07..52f1e48e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecStandardDistributionDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecStandardDistributionDetailDto.cs @@ -1,14 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Volo.Abp.Application.Dtos; -using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.SecondaryExportReports { @@ -16,7 +10,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 标准二配明细输出表 /// public class SecStandardDistributionDetailDto : EntityDto - { + { /// /// 年度 /// @@ -27,19 +21,19 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 期间 /// [Display(Name = "期间")] - public string Period { set; get; } + public string Period { set; get; } /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } + public string Version { set; get; } /// /// 客户总成物料号 /// [Display(Name = "客户总成物料号")] - + public string CustomItemCode { get; set; } /// @@ -54,7 +48,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - ///// ///// ERP总成物料号 ///// @@ -89,20 +82,18 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "ERP组件用量")] public decimal ErpSubItemQty { get; set; } - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "ERP组件实际用量")] public decimal ErpSubItemActualQty { get; set; } - /// /// 客户组件物料号 /// [Display(Name = "客户组件物料号")] - public string CustomSubItemCode { get; set; } + public string CustomSubItemCode { get; set; } /// /// 零件属性 @@ -111,8 +102,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports public string MaterialProperty { get; set; } - - /// /// 供应商代码 /// @@ -127,7 +116,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "供应商描述")] public string SupplierDesc { get; set; } - /// /// 供货比例 /// @@ -135,7 +123,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - /// /// ERP组件暂估类 /// @@ -143,7 +130,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "ERP组件暂估类")] public string ErpSubItemEstimationType { get; set; } - /// /// 零件单价 /// @@ -158,7 +144,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "零件数量(回款)")] public decimal CustomSubItemSumQty { get; set; } - /// /// 金额(不含税) /// @@ -166,14 +151,12 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "金额(不含税)")] public decimal SumPriceNoTax { get; set; } - /// /// 金额(含税) /// [Display(Name = "金额(含税)")] public decimal SumPriceWithTax { set; get; } - /// /// 价格或零件号变动情况 /// @@ -181,7 +164,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "价格或零件号变动情况")] public string HasChanged { get; set; } = "否"; - /// /// 二配采购员 /// @@ -189,7 +171,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "二配采购员")] public string Buyer { get; set; } - /// /// 备注 /// @@ -197,4 +178,4 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "备注")] public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSummaryOutPutDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSummaryOutPutDto.cs index 2660d48d..3b3bb60a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSummaryOutPutDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ExportReports/SecondaryExportReports/SecSummaryOutPutDto.cs @@ -1,14 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; -using Volo.Abp.Application.Dtos; using Magicodes.ExporterAndImporter.Core; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.SettleAccount.SecondaryExportReports { @@ -16,7 +11,7 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 二配汇总输出表 /// public class SecSummaryOutPutDto : EntityDto - { + { /// /// 年度 /// @@ -27,19 +22,19 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports /// 期间 /// [Display(Name = "期间")] - public string Period { set; get; } + public string Period { set; get; } /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } + public string Version { set; get; } /// /// 客户总成物料号 /// [Display(Name = "客户总成物料号")] - + public string CustomItemCode { get; set; } /// @@ -55,15 +50,12 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - ///// ///// ERP总成物料号描述 ///// //[Display(Name = "ERP总成物料号描述")] //public string ErpParentItemDesc { get; set; } - - /// /// 客户组件物料号 /// @@ -90,15 +82,12 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "组件标准用量")] public decimal ErpSubItemQty { get; set; } - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "组件实际用量")] public decimal ErpSubItemActualQty { get; set; } - - ///// ///// 物料属性 ///// @@ -106,8 +95,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports //public string MaterialProperty { get; set; } - - /// /// 供应商代码 /// @@ -122,7 +109,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "供应商描述")] public string SupplierDesc { get; set; } - /// /// 供货比例 /// @@ -130,7 +116,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - ///// ///// ERP组件暂估类 ///// @@ -138,7 +123,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports //[Display(Name = "ERP组件暂估类")] //public string ErpSubItemEstimationType { get; set; } - /// /// 零件单价 /// @@ -153,7 +137,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "零件数量(回款)")] public decimal CustomSubItemSumQty { get; set; } - /// /// 金额(不含税) /// @@ -161,14 +144,12 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "金额(不含税)")] public decimal SumPriceNoTax { get; set; } - /// /// 金额(含税) /// [Display(Name = "金额(含税)")] public decimal SumPriceWithTax { set; get; } - /// /// 价格或零件号变动情况 /// @@ -176,7 +157,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "价格或零件号变动情况")] public string HasChanged { get; set; } = "否"; - /// /// 二配采购员 /// @@ -184,7 +164,6 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "二配采购员")] public string Buyer { get; set; } - /// /// 备注 /// @@ -192,4 +171,4 @@ namespace Win.Sfs.SettleAccount.SecondaryExportReports [Display(Name = "备注")] public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/BlobDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/BlobDto.cs index d0271151..859a030b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/BlobDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/BlobDto.cs @@ -1,11 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Entities; namespace Win.Sfs.BaseData.ImportExcelCommon.ExcelFiles.Dto diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/GetBlobRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/GetBlobRequestDto.cs index 2f8eb63c..39312b69 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/GetBlobRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/GetBlobRequestDto.cs @@ -1,12 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.BaseData.ImportExcelCommon.ExcelFiles.Dto { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/SaveBlobInputDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/SaveBlobInputDto.cs index 6b459368..a41aaa21 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/SaveBlobInputDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/Dto/SaveBlobInputDto.cs @@ -1,12 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.BaseData.ImportExcelCommon.ExcelFiles.Dto { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/IFileAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/IFileAppService.cs index 3e7af719..654e8a56 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/IFileAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelFiles/IFileAppService.cs @@ -1,10 +1,6 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon.ExcelFiles.Dto; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelImportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelImportDto.cs index e1f631e3..1384fb36 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelImportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ExcelImportDto.cs @@ -1,11 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Entities; namespace Win.Sfs.BaseData.ImportExcelCommon diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/GetExcelImportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/GetExcelImportRequestDto.cs index 686e6a11..af03d628 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/GetExcelImportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/GetExcelImportRequestDto.cs @@ -1,12 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.BaseData.ImportExcelCommon { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IExcelImportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IExcelImportAppService.cs index c44764e3..286a5ed3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IExcelImportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IExcelImportAppService.cs @@ -1,10 +1,6 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecBTSummaryExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecBTSummaryExportImporter.cs index 54a5418b..56a6a784 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecBTSummaryExportImporter.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecBTSummaryExportImporter.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Win.Sfs.BaseData.ImportExcelCommon; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecSummaryExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecSummaryExportImporter.cs index a77e5e22..40957f52 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecSummaryExportImporter.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/ISecSummaryExportImporter.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.ImportExcelCommon { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipBTExportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipBTExportAppService.cs index 80a9db5e..8008f45e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipBTExportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipBTExportAppService.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipExportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipExportAppService.cs index f1f998b7..9b40974e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipExportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/IZipExportAppService.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/SaveExcelImportInputDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/SaveExcelImportInputDto.cs index caa688c1..4d8b6b23 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/SaveExcelImportInputDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/ImportExcelCommon/SaveExcelImportInputDto.cs @@ -1,12 +1,7 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.BaseData.ImportExcelCommon { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs index 9b33161e..2327dbb1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissionDefinitionProvider.cs @@ -1,4 +1,4 @@ -using SettleAccount.Localization; +using SettleAccount.Localization; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; @@ -54,7 +54,6 @@ namespace Win.Sfs.SettleAccount scrapClaims.AddChild(SettleAccountPermissions.ScrapClaims.Update, L("Update")); scrapClaims.AddChild(SettleAccountPermissions.ScrapClaims.Delete, L("Delete")); - //大众备件 var sparePart = myGroup.AddPermission(SettleAccountPermissions.SparePart.Default, L("SparePart")); sparePart.AddChild(SettleAccountPermissions.SparePart.Create, L("Create")); @@ -79,7 +78,6 @@ namespace Win.Sfs.SettleAccount wmshq.AddChild(SettleAccountPermissions.WMSHQ.Update, L("Update")); wmshq.AddChild(SettleAccountPermissions.WMSHQ.Delete, L("Delete")); - #endregion #region 天合 @@ -88,15 +86,11 @@ namespace Win.Sfs.SettleAccount boms.AddChild(SettleAccountPermissions.Boms.Update, L("Update")); boms.AddChild(SettleAccountPermissions.Boms.Delete, L("Delete")); - - - var priceLists = myGroup.AddPermission(SettleAccountPermissions.PriceLists.Default, L("PriceLists")); priceLists.AddChild(SettleAccountPermissions.PriceLists.Create, L("Create")); priceLists.AddChild(SettleAccountPermissions.PriceLists.Update, L("Update")); priceLists.AddChild(SettleAccountPermissions.PriceLists.Delete, L("Delete")); - //var settlementParts = myGroup.AddPermission(SettleAccountPermissions.SettlementParts.Default, L("SettlementParts")); //settlementParts.AddChild(SettleAccountPermissions.SettlementParts.Create, L("Create")); //settlementParts.AddChild(SettleAccountPermissions.SettlementParts.Update, L("Update")); @@ -117,10 +111,6 @@ namespace Win.Sfs.SettleAccount //itemInvoicePrices.AddChild(SettleAccountPermissions.ItemInvoicePrices.Update, L("Update")); //itemInvoicePrices.AddChild(SettleAccountPermissions.ItemInvoicePrices.Delete, L("Delete")); - - - - var CodeSettings = myGroup.AddPermission(SettleAccountPermissions.CodeSettings.Default, L("CodeSettings")); CodeSettings.AddChild(SettleAccountPermissions.CodeSettings.Create, L("Create")); CodeSettings.AddChild(SettleAccountPermissions.CodeSettings.Update, L("Update")); @@ -141,8 +131,6 @@ namespace Win.Sfs.SettleAccount //FISs.AddChild(SettleAccountPermissions.FISs.Update, L("Update")); //FISs.AddChild(SettleAccountPermissions.FISs.Delete, L("Delete")); - - //var MaterialRelationships = myGroup.AddPermission(SettleAccountPermissions.MaterialRelationships.Default, L("MaterialRelationships")); //MaterialRelationships.AddChild(SettleAccountPermissions.MaterialRelationships.Create, L("Create")); //MaterialRelationships.AddChild(SettleAccountPermissions.MaterialRelationships.Update, L("Update")); @@ -173,24 +161,19 @@ namespace Win.Sfs.SettleAccount //SupplierItemSetUps.AddChild(SettleAccountPermissions.SupplierItemSetUps.Update, L("Update")); //SupplierItemSetUps.AddChild(SettleAccountPermissions.SupplierItemSetUps.Delete, L("Delete")); - //var ImportColumnMaps = myGroup.AddPermission(SettleAccountPermissions.ImportColumnMaps.Default, L("ImportColumnMaps")); //ImportColumnMaps.AddChild(SettleAccountPermissions.ImportColumnMaps.Create, L("Create")); //ImportColumnMaps.AddChild(SettleAccountPermissions.ImportColumnMaps.Update, L("Update")); //ImportColumnMaps.AddChild(SettleAccountPermissions.ImportColumnMaps.Delete, L("Delete")); - var Reports = myGroup.AddPermission(SettleAccountPermissions.Reports.Default, L("Reports")); Reports.AddChild(SettleAccountPermissions.Reports.Create, L("Create")); Reports.AddChild(SettleAccountPermissions.Reports.Update, L("Update")); Reports.AddChild(SettleAccountPermissions.Reports.Delete, L("Delete")); #endregion - #region 车轮相关 - - //var EstimatedInventoryDetails = myGroup.AddPermission(SettleAccountPermissions.EstimatedInventoryDetails.Default, L("EstimatedInventoryDetails")); //EstimatedInventoryDetails.AddChild(SettleAccountPermissions.EstimatedInventoryDetails.Create, L("Create")); //EstimatedInventoryDetails.AddChild(SettleAccountPermissions.EstimatedInventoryDetails.Update, L("Update")); @@ -206,8 +189,6 @@ namespace Win.Sfs.SettleAccount //Factorys.AddChild(SettleAccountPermissions.Factorys.Update, L("Update")); //Factorys.AddChild(SettleAccountPermissions.Factorys.Delete, L("Delete")); - - //var InventoryDetails = myGroup.AddPermission(SettleAccountPermissions.InventoryDetails.Default, L("InventoryDetails")); //InventoryDetails.AddChild(SettleAccountPermissions.InventoryDetails.Create, L("Create")); //InventoryDetails.AddChild(SettleAccountPermissions.InventoryDetails.Update, L("Update")); @@ -218,8 +199,6 @@ namespace Win.Sfs.SettleAccount //InvoiceSettledDiffs.AddChild(SettleAccountPermissions.InvoiceSettledDiffs.Update, L("Update")); //InvoiceSettledDiffs.AddChild(SettleAccountPermissions.InvoiceSettledDiffs.Delete, L("Delete")); - - //var EstimatedStockDiffReports = myGroup.AddPermission(SettleAccountPermissions.EstimatedStockDiffReports.Default, L("EstimatedStockDiffReports")); //EstimatedStockDiffReports.AddChild(SettleAccountPermissions.EstimatedStockDiffReports.Create, L("Create")); //EstimatedStockDiffReports.AddChild(SettleAccountPermissions.EstimatedStockDiffReports.Update, L("Update")); @@ -245,7 +224,6 @@ namespace Win.Sfs.SettleAccount //SendUnsettledDiffReports.AddChild(SettleAccountPermissions.SendUnsettledDiffReports.Update, L("Update")); //SendUnsettledDiffReports.AddChild(SettleAccountPermissions.SendUnsettledDiffReports.Delete, L("Delete")); - //var SecondaryReports = myGroup.AddPermission(SettleAccountPermissions.SecondaryReports.Default, L("SecondaryReports")); //SecondaryReports.AddChild(SettleAccountPermissions.SecondaryReports.Create, L("Create")); //SecondaryReports.AddChild(SettleAccountPermissions.SecondaryReports.Update, L("Update")); @@ -266,8 +244,6 @@ namespace Win.Sfs.SettleAccount //SecondaryPriceRatios.AddChild(SettleAccountPermissions.SecondaryPriceRatios.Update, L("Update")); //SecondaryPriceRatios.AddChild(SettleAccountPermissions.SecondaryPriceRatios.Delete, L("Delete")); - - //var BTNotConsignReports = myGroup.AddPermission(SettleAccountPermissions.BTNotConsignReports.Default, L("BTNotConsignReports")); //BTNotConsignReports.AddChild(SettleAccountPermissions.BTNotConsignReports.Create, L("Create")); //BTNotConsignReports.AddChild(SettleAccountPermissions.BTNotConsignReports.Update, L("Update")); @@ -283,7 +259,6 @@ namespace Win.Sfs.SettleAccount //JFNotConsignReports.AddChild(SettleAccountPermissions.JFNotConsignReports.Update, L("Update")); //JFNotConsignReports.AddChild(SettleAccountPermissions.JFNotConsignReports.Delete, L("Delete")); - //var BTCarConsigns = myGroup.AddPermission(SettleAccountPermissions.BTCarConsigns.Default, L("BTCarConsigns")); //BTCarConsigns.AddChild(SettleAccountPermissions.BTCarConsigns.Create, L("Create")); //BTCarConsigns.AddChild(SettleAccountPermissions.BTCarConsigns.Update, L("Update")); @@ -357,6 +332,5 @@ namespace Win.Sfs.SettleAccount return LocalizableString.Create(name); } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs index caad5186..8a4e4025 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Permissions/SettleAccountPermissions.cs @@ -1,12 +1,11 @@ -using Volo.Abp.Reflection; +using Volo.Abp.Reflection; namespace Win.Sfs.SettleAccount { public class SettleAccountPermissions { - - public const string GroupName = "SettleAccount"; - + + public const string GroupName = "SettleAccount"; public const string CreateStr = "Create"; public const string UpdateStr = "Update"; @@ -148,7 +147,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - /// /// 结算件 /// @@ -189,10 +187,8 @@ namespace Win.Sfs.SettleAccount public const string Create = Default + "." + "Create"; public const string Update = Default + "." + "Update"; public const string Delete = Default + "." + "Delete"; - - } - + } //public static class ItemInvoicePrices @@ -204,8 +200,6 @@ namespace Win.Sfs.SettleAccount //} - - public static class PriceLists { @@ -213,14 +207,8 @@ namespace Win.Sfs.SettleAccount public const string Create = Default + "." + "Create"; public const string Update = Default + "." + "Update"; public const string Delete = Default + "." + "Delete"; - - } - - - - - + } public static class CodeSettings { @@ -256,7 +244,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - public static class Factorys { public const string Default = GroupName + "." + nameof(Factorys); @@ -265,7 +252,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - //public static class FISs //{ // public const string Default = GroupName + "." + nameof(FISs); @@ -274,7 +260,6 @@ namespace Win.Sfs.SettleAccount // public const string Delete = Default + "." + DeleteStr; //} - public static class InventoryDetails { public const string Default = GroupName + "." + nameof(InventoryDetails); @@ -283,8 +268,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - //public static class MaterialRelationships //{ // public const string Default = GroupName + "." + nameof(MaterialRelationships); @@ -293,8 +276,6 @@ namespace Win.Sfs.SettleAccount // public const string Delete = Default + "." + DeleteStr; //} - - public static class Materials { public const string Default = GroupName + "." + nameof(Materials); @@ -303,8 +284,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - //public static class Prebatchs //{ // public const string Default = GroupName + "." + nameof(Prebatchs); @@ -313,10 +292,6 @@ namespace Win.Sfs.SettleAccount // public const string Delete = Default + "." + DeleteStr; //} - - - - public static class SettleAccounts { public const string Default = GroupName + "." + nameof(SettleAccounts); @@ -325,8 +300,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - public static class CustomerStorageLocations { public const string Default = GroupName + "." + nameof(CustomerStorageLocations); @@ -343,9 +316,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - - public static class Reports { public const string Default = GroupName + "." + nameof(Reports); @@ -354,22 +324,14 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - - public static string[] GetAll() { return ReflectionHelper.GetPublicConstantsRecursively(typeof(SettleAccountPermissions)); } #endregion - - - - #region 车轮项目 - public static class InvoiceSettledDiffVersions { @@ -389,7 +351,6 @@ namespace Win.Sfs.SettleAccount } - public static class EstimatedInventoryDetails { public const string Default = GroupName + "." + nameof(EstimatedInventoryDetails); @@ -421,8 +382,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - public static class SecondaryPriceRatios { public const string Default = GroupName + "." + nameof(SecondaryPriceRatios); @@ -431,8 +390,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - public static class EstimatedStockDiffReports { public const string Default = GroupName + "." + nameof(EstimatedStockDiffReports); @@ -441,7 +398,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - public static class StockUnsettledDiffReports { public const string Default = GroupName + "." + nameof(StockUnsettledDiffReports); @@ -450,7 +406,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - public static class StockSettledDiffReports { public const string Default = GroupName + "." + nameof(StockSettledDiffReports); @@ -459,7 +414,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - public static class StockFisDiffReports { public const string Default = GroupName + "." + nameof(StockFisDiffReports); @@ -476,8 +430,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - public static class SendUnsettledDiffReports { public const string Default = GroupName + "." + nameof(SendUnsettledDiffReports); @@ -486,8 +438,6 @@ namespace Win.Sfs.SettleAccount public const string Delete = Default + "." + DeleteStr; } - - //public static class HQConsigns //{ // public const string Default = GroupName + "." + nameof(HQConsigns); @@ -496,7 +446,6 @@ namespace Win.Sfs.SettleAccount // public const string Delete = Default + "." + DeleteStr; //} - //public static class HQSpecConsigns //{ // public const string Default = GroupName + "." + nameof(HQSpecConsigns); @@ -590,7 +539,6 @@ namespace Win.Sfs.SettleAccount // public const string Delete = Default + "." + DeleteStr; //} - //public static class HQNotConsignReports //{ // public const string Default = GroupName + "." + nameof(HQNotConsignReports); @@ -608,4 +556,4 @@ namespace Win.Sfs.SettleAccount #endregion } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateDto.cs index a6aa2d5c..c102de79 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,13 +25,12 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateOrUpdateDtoBase.cs index 70f1a9d7..174863b9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportCreateOrUpdateDtoBase.cs @@ -1,18 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.BTNotConsignReports { /// /// 新增和更新DTO /// - public class BTNotConsignReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class BTNotConsignReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { /// /// 统计时间起 @@ -21,7 +19,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "统计时间起")] public DateTime BeginTime { get; set; } - /// /// 统计时间止 /// @@ -41,7 +38,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "客户名称")] public string CustomName { get; set; } - /// /// 状态 /// @@ -55,18 +51,16 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// [Display(Name = "备注")] public string Remark { get; set; } - /// /// 明细表 /// [Display(Name = "明细表")] public virtual List BTNotConsignReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailDto.cs index 8d4c2faa..9df86825 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,7 +60,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - [Display(Name = "订货看板编号")] public string OrderKBCode { get; set; } @@ -88,6 +82,5 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "状态")] public int State { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailExportDto.cs index 6b6e613c..dcb26ce6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailExportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -15,7 +12,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports /// public class BTNotConsignReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -24,7 +20,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - ///// ///// 年度 ///// @@ -37,14 +32,12 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports //[Display(Name = "期间")] //public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -52,8 +45,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - [Display(Name = "订货看板编号")] public string OrderKBCode { get; set; } @@ -76,6 +67,5 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "状态")] public int state { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailRequestDto.cs index daa6cd45..b134aedf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.BTNotConsignReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDto.cs index 2bc9edea..d4dc5808 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports /// public class BTNotConsignReportDto : SettleAccountReportTimeDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List BTNotConsignReportDetails { get; set; } + public virtual List BTNotConsignReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportRequestDto.cs index df0f26fe..dba52036 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportStatisticRequestDto.cs index 5aa067a6..a4680e8c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportStatisticRequestDto.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -26,4 +23,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "统计时间止")] public DateTime EndTime { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportUpdateDto.cs index 0d73074d..126376fa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/BTNotConsignReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.BTNotConsignReports +namespace Win.Sfs.SettleAccount.BTNotConsignReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/IBTNotConsignReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/IBTNotConsignReportAppService.cs index a32cddfd..b450e3ea 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/IBTNotConsignReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTNotConsignReports/IBTNotConsignReportAppService.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; -using Win.Sfs.SettleAccount.StockUnsettledDiffReports; using Win.Sfs.Shared.ApplicationBase; - namespace Win.Sfs.SettleAccount.BTNotConsignReports { public interface IBTNotConsignReportAppService : @@ -20,8 +17,7 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports Task GetReportAsync(); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateDto.cs index 78fe3e23..253c9647 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,13 +25,12 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateOrUpdateDtoBase.cs index 32507f5a..c76d1088 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportCreateOrUpdateDtoBase.cs @@ -1,22 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { /// /// 新增和更新DTO /// - public class BTSeqKBDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class BTSeqKBDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - - /// /// 年度 /// @@ -29,14 +25,12 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - ///// ///// 地点 ///// @@ -52,8 +46,7 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -81,4 +73,4 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "明细表")] public virtual List BTSeqKBDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailDto.cs index f92f6ac7..24993ffe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,8 +60,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - /// /// 日期 /// @@ -80,7 +73,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "看板物料号")] public string MaterialCode { get; set; } - /// /// 车序数量 /// @@ -88,8 +80,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = " 车序数量")] public decimal SeqQty { get; set; } - - /// /// 看板数量 /// @@ -103,6 +93,5 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "数量差异")] public decimal DiffQty { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailExportDto.cs index 254c67d1..3768b8e1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailExportDto.cs @@ -1,13 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { @@ -16,7 +13,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports /// public class BTSeqKBDiffReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -25,7 +21,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - ///// ///// 年度 ///// @@ -38,14 +33,12 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports //[Display(Name = "期间")] //public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -53,7 +46,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - /// /// 日期 /// @@ -74,7 +66,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports //[Display(Name = "看板物料描述")] //public string MaterialDesc { get; set; } - /// /// 车序数量 /// @@ -82,8 +73,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = " 车序数量")] public decimal SeqQty { get; set; } - - /// /// 看板数量 /// @@ -97,6 +86,5 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [Display(Name = "数量差异")] public string DiffQty { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailRequestDto.cs index 0d27ce68..af9354c5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDto.cs index af5ad488..ca890dd5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports /// public class BTSeqKBDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List BTSeqKBDiffReportDetails { get; set; } + public virtual List BTSeqKBDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportRequestDto.cs index 59353061..ef3eeb23 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportStatisticRequestDto.cs index cbec431c..b6663b53 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportStatisticRequestDto.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -11,7 +6,7 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// 查询条件 DTO /// public class BTSeqKBDiffReportStatisticRequestDto : StatisticRequestDtoBase - { + { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportUpdateDto.cs index 242493c9..1ac66810 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports +namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/IBTSeqKBDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/IBTSeqKBDiffReportAppService.cs index c11a1736..4ca6e527 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/IBTSeqKBDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTSeqKBDiffReports/IBTSeqKBDiffReportAppService.cs @@ -1,11 +1,9 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.StockUnsettledDiffReports; using Win.Sfs.Shared.ApplicationBase; - namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { public interface IBTSeqKBDiffReportAppService : @@ -20,8 +18,7 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports Task GetReportAsync(BTSeqKBDiffReportStatisticRequestDto input); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailDto.cs index 0c3b9f5b..e776cbbe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailDto.cs @@ -1,12 +1,11 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports { @@ -21,8 +20,7 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] - public Guid BranchId { get; set; } - + public Guid BranchId { get; set; } /// /// 单据ID @@ -38,7 +36,6 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -54,13 +51,11 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } - + public string Version { set; get; } /// /// 物品Code @@ -75,40 +70,32 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Display(Name = "物品描述")] public string ItemDesc { get; set; } - - /// /// 客户代码 /// [IEIgnoreAttribute] [Display(Name = "客户代码")] - public string CustomCode { get; set; } - - + public string CustomCode { get; set; } /// /// 暂估类 /// [Display(Name = "暂估类")] - public string EstimationType { get; set; } - - + public string EstimationType { get; set; } /// /// Fis未结数量 /// [Display(Name = "Fis未结数量")] - public decimal FisUnSettledQty { set; get; } + public decimal FisUnSettledQty { set; get; } /// /// 现有库存数量 /// [Display(Name = "现有库存数量")] - public decimal StockQty { set; get; } - - + public decimal StockQty { set; get; } /// /// 差异数量 @@ -116,4 +103,4 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailExportDto.cs index b1698377..3a2c1cb8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailExportDto.cs @@ -1,13 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports { @@ -16,7 +12,6 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// public class BTStockUnsettledDiffReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -25,7 +20,6 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -40,15 +34,12 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports //[IEIgnoreAttribute] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - /// /// 客户代码 /// @@ -68,8 +59,7 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// 物品描述 /// [Display(Name = "物品描述")] - public string ItemDesc { get; set; } - + public string ItemDesc { get; set; } ///// ///// 暂估类 @@ -82,15 +72,13 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// Fis未结数量 /// [Display(Name = "Fis未结数量")] - public decimal FisUnSettledQty { set; get; } + public decimal FisUnSettledQty { set; get; } /// /// 现有库存数量 /// [Display(Name = "现有库存数量")] - public decimal StockQty { set; get; } - - + public decimal StockQty { set; get; } /// /// 差异数量 @@ -98,4 +86,4 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailRequestDto.cs index d3d22877..83aa0081 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports @@ -11,7 +9,6 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// public class BTStockUnsettledDiffReportDetailRequestDto : BranchRequestDtoBase { - /// /// 主表Id @@ -21,8 +18,5 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports public Guid ParentId { get; set; } - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDto.cs index fd54d7eb..94ee382c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// public class BTStockUnsettledDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List BTStockUnsettledDiffReportDetails { get; set; } + public virtual List BTStockUnsettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportRequestDto.cs index 97b290b7..63df68e7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportStatisticRequestDto.cs index 4f9b1d08..7046540d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportStatisticRequestDto.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports @@ -13,6 +8,5 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports public class BTStockUnsettledDiffReportStatisticRequestDto : StatisticRequestDtoBase { - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/IBTStockUnsettledDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/IBTStockUnsettledDiffReportAppService.cs index b7a058a7..045b5523 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/IBTStockUnsettledDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/BTStockUnsettledDiffReports/IBTStockUnsettledDiffReportAppService.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; - -using Win.Sfs.Shared.ApplicationBase; +using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports { @@ -20,8 +18,7 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports Task GetReportAsync(BTStockUnsettledDiffReportStatisticRequestDto input); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateDto.cs index ad084e4a..92e29ea0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,9 +25,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// @@ -39,10 +32,5 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Required(ErrorMessage = "{0}是必填项")] public EnumDocumentType DocumentType { get; set; } - - - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateOrUpdateDtoBase.cs index d0cf6d6b..db19ac94 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportCreateOrUpdateDtoBase.cs @@ -1,21 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { /// /// 新增和更新DTO /// - public class EstimatedStockDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class EstimatedStockDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - /// /// 年度 /// @@ -28,16 +25,12 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - - /// /// 客户编码 /// @@ -48,8 +41,7 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -64,7 +56,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -77,4 +68,4 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "明细表")] public virtual List EstimatedStockDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailDto.cs index 8cffa279..982de95e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { @@ -20,8 +19,7 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] - public Guid BranchId { get; set; } - + public Guid BranchId { get; set; } /// /// 单据ID @@ -49,17 +47,12 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - - - /// /// 物品Code /// @@ -80,14 +73,12 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "暂估类")] public string EstimationType { get; set; } - /// /// 暂估类描述 /// [Display(Name = "暂估类描述")] - public string EstimationTypeDesc { get; set; } - + public string EstimationTypeDesc { get; set; } /// /// 暂估数量 @@ -101,25 +92,22 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "现有库存数量")] public decimal StockQty { set; get; } - /// /// 自制件拆分数量 /// [Display(Name = "自制件拆分数量")] public decimal FgQty { set; get; } - /// /// 发出未结拆分数量 /// [Display(Name = "发出未结拆分数量")] public decimal UnSettledQty { set; get; } - /// /// 差异数量 /// [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailExportDto.cs index d81316e4..275a284a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailExportDto.cs @@ -1,13 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { @@ -16,7 +11,7 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports /// public class EstimatedStockDiffReportDetailExportDto : EntityDto { - + /// /// 单据流水号 /// @@ -37,7 +32,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// @@ -45,10 +39,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "版本")] public string Version { set; get; } - - - - /// /// 物品Code /// @@ -74,7 +64,7 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports /// [Display(Name = "暂估类描述")] - public string EstimationTypeDesc { get; set; } + public string EstimationTypeDesc { get; set; } /// /// 暂估数量 @@ -88,25 +78,22 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "现有库存数量")] public decimal StockQty { set; get; } - /// /// 自制件拆分数量 /// [Display(Name = "自制件拆分数量")] public decimal FgQty { set; get; } - /// /// 发出未结拆分数量 /// [Display(Name = "发出未结拆分数量")] public decimal UnSettledQty { set; get; } - /// /// 差异数量 /// [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailRequestDto.cs index 01f5ddd8..3df56a0a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDto.cs index c3b1c4cb..5f0d7cb1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports /// public class EstimatedStockDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List EstimatedStockDiffReportDetails { get; set; } + public virtual List EstimatedStockDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportRequestDto.cs index 4a2d5c9f..1ced91bc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportRequestDto.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports @@ -24,14 +21,12 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户编码 /// @@ -46,4 +41,4 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports public string CustomName { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportStatisticRequestDto.cs index 3585915e..fb4e2792 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportStatisticRequestDto.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports @@ -13,6 +8,5 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports public class EstimatedStockDiffReportStatisticRequestDto : StatisticRequestDtoBase { - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportUpdateDto.cs index 8d41cc85..3552b587 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports +namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { /// /// 更新DTO @@ -6,4 +6,4 @@ public class EstimatedStockDiffReportUpdateDto : EstimatedStockDiffReportCreateOrUpdateDtoBase { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportAppService.cs index ccf351b9..cb901e00 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportAppService.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; - + using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports @@ -18,10 +16,8 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports , IHasDetailEntityAppService { - Task GetReportAsync(EstimatedStockDiffReportStatisticRequestDto input); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateDto.cs index a5b77d0e..2f79d06e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQNotConsignReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,13 +25,12 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateOrUpdateDtoBase.cs index 8e002ea3..5b62604d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportCreateOrUpdateDtoBase.cs @@ -1,18 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.HQNotConsignReports { /// /// 新增和更新DTO /// - public class HQNotConsignReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class HQNotConsignReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { /// /// 统计时间起 @@ -21,7 +19,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "统计时间起")] public DateTime BeginTime { get; set; } - /// /// 统计时间止 /// @@ -41,7 +38,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "客户名称")] public string CustomName { get; set; } - /// /// 状态 /// @@ -55,18 +51,16 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// [Display(Name = "备注")] public string Remark { get; set; } - /// /// 明细表 /// [Display(Name = "明细表")] public virtual List HQNotConsignReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailDto.cs index a11021b1..af7a5e4d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQNotConsignReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,7 +60,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - [Display(Name = "订货看板编号")] public string OrderKBCode { get; set; } @@ -88,6 +82,5 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "状态")] public int State { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailExportDto.cs index f2060539..c22ecdfe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailExportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQNotConsignReports { @@ -15,7 +12,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports /// public class HQNotConsignReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -24,7 +20,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - ///// ///// 年度 ///// @@ -37,14 +32,12 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports //[Display(Name = "期间")] //public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -52,8 +45,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - [Display(Name = "订货看板编号")] public string OrderKBCode { get; set; } @@ -76,6 +67,5 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "状态")] public int state { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailRequestDto.cs index 74e9c9c6..fe41609f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.HQNotConsignReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDto.cs index 299299d0..be5b99f7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.HQNotConsignReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports /// public class HQNotConsignReportDto : SettleAccountReportTimeDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List HQNotConsignReportDetails { get; set; } + public virtual List HQNotConsignReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportRequestDto.cs index 56af7f1b..16d2f39a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportStatisticRequestDto.cs index 7a4742c0..72671d1d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportStatisticRequestDto.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -26,4 +23,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "统计时间止")] public DateTime EndTime { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportUpdateDto.cs index 13533dac..7b4bce10 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/HQNotConsignReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.HQNotConsignReports +namespace Win.Sfs.SettleAccount.HQNotConsignReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/IHQNotConsignReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/IHQNotConsignReportAppService.cs index 8700172e..bf89067b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/IHQNotConsignReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQNotConsignReports/IHQNotConsignReportAppService.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; -using Win.Sfs.SettleAccount.StockUnsettledDiffReports; using Win.Sfs.Shared.ApplicationBase; - namespace Win.Sfs.SettleAccount.HQNotConsignReports { public interface IHQNotConsignReportAppService : @@ -20,8 +17,7 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports Task GetReportAsync(); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateDto.cs index 30aefa91..9faaad0b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,13 +25,12 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateOrUpdateDtoBase.cs index 9f1e6d91..335e2897 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportCreateOrUpdateDtoBase.cs @@ -1,18 +1,16 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { /// /// 新增和更新DTO /// - public class HQSPNotConsignReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class HQSPNotConsignReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { /// /// 统计时间起 @@ -21,7 +19,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "统计时间起")] public DateTime BeginTime { get; set; } - /// /// 统计时间止 /// @@ -41,7 +38,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "客户名称")] public string CustomName { get; set; } - /// /// 状态 /// @@ -55,18 +51,16 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// [Display(Name = "备注")] public string Remark { get; set; } - /// /// 明细表 /// [Display(Name = "明细表")] public virtual List HQSPNotConsignReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailDto.cs index 3e477a31..b78ed781 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,7 +60,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - [Display(Name = "订货看板编号")] public string OrderKBCode { get; set; } @@ -88,6 +82,5 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "状态")] public int State { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailExportDto.cs index eaa84763..84d98ef5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailExportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { @@ -15,7 +12,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports /// public class HQSPNotConsignReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -24,7 +20,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - ///// ///// 年度 ///// @@ -37,14 +32,12 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports //[Display(Name = "期间")] //public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -52,8 +45,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - [Display(Name = "订货看板编号")] public string OrderKBCode { get; set; } @@ -76,6 +67,5 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "状态")] public int state { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailRequestDto.cs index c223dcca..8f9c1b6a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDto.cs index 3fe55fd1..8b82916c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports /// public class HQSPNotConsignReportDto : SettleAccountReportTimeDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List HQSPNotConsignReportDetails { get; set; } + public virtual List HQSPNotConsignReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportRequestDto.cs index 4950568d..29e46bd3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportStatisticRequestDto.cs index 5b76c6dc..43e9854c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportStatisticRequestDto.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -26,4 +23,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "统计时间止")] public DateTime EndTime { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportUpdateDto.cs index 25881623..72bca73b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/HQSPNotConsignReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.HQSPNotConsignReports +namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/IHQSPNotConsignReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/IHQSPNotConsignReportAppService.cs index 5300ffc3..2e9b67bd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/IHQSPNotConsignReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/HQSPNotConsignReports/IHQSPNotConsignReportAppService.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; -using Win.Sfs.SettleAccount.StockUnsettledDiffReports; using Win.Sfs.Shared.ApplicationBase; - namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { public interface IHQSPNotConsignReportAppService : @@ -20,8 +17,7 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports Task GetReportAsync(); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs index 659aba97..7dbc369c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/ReportRequestDto/ReportRequestDto.cs @@ -1,22 +1,13 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto { - - public class HQKanbanRequestDto { public string Version { set; get; } public string MaterialCode { set; get; } public string Begin { set; get; } public string End { set; get; } - - + public string MaterialGroup { set; get; } public string SapCode { set; get; } @@ -26,25 +17,17 @@ namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto public string Kanban { set; get; } - - public string State { set; get; } - public string IsContainVersion { set; get; } - - - - - } public class BaseRequestDto { public string Version { set; get; } - public string MaterialCode { set; get; } - public string Begin { set; get; } + public string MaterialCode { set; get; } + public string Begin { set; get; } public string End { set; get; } public string Cp7Begin { set; get; } public string Cp7End { set; get; } @@ -56,15 +39,15 @@ namespace Win.Sfs.SettleAccount.Reports.ReportRequestDto } public class BaseKanbanReqestDto { - public string KanBan {set;get;} - public string SapMaterialCode {set;get;} - public string Version {set;get;} - public string CustomerCode {set;get;} - public string CustomerPartCode {set;get;} - public string EstimateTypeDesc {set;get;} - public string State {set;get;} - public string Begin {set;get;} - public string End { set; get; } + public string KanBan { set; get; } + public string SapMaterialCode { set; get; } + public string Version { set; get; } + public string CustomerCode { set; get; } + public string CustomerPartCode { set; get; } + public string EstimateTypeDesc { set; get; } + public string State { set; get; } + public string Begin { set; get; } + public string End { set; get; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseDto.cs index cdbc95c8..d8d9bc20 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseDto.cs @@ -1,11 +1,4 @@ -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.DomainBase; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Entities.SecMatch { @@ -142,9 +135,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch } - - - public class SecMatchDto { //[Display(Name = "序号")] @@ -286,11 +276,8 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [ExporterHeader(DisplayName = "回款数量")] public decimal BackNumber { set; get; } - } - - //public class SecMatchBaseDto //{ diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseOutPutDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseOutPutDto.cs index a6382ba8..4d1d06c6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseOutPutDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseOutPutDto.cs @@ -1,10 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.SettleAccount.Entities.SecMatch; -using Win.Sfs.SettleAccount.SecondaryExportReports; namespace Win.Sfs.SettleAccount.Entities.SecMatch { @@ -15,7 +9,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch /// public string Company { get; } - /// /// 报送清单单位 /// @@ -36,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch /// public string Time { get; } - /// /// 详表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseRequestDto.cs index 8ffcc8d9..81ea276e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseRequestDto.cs @@ -1,18 +1,12 @@ -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.Entities.SecMatch { - - public class SecMatchBaseRequestDto: RequestDtoBase + + public class SecMatchBaseRequestDto : RequestDtoBase { - + /// /// 版本 /// @@ -69,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch /// 供应商名称 /// [Display(Name = "供应商名称")] - public string SupplierName { get; set; } + public string SupplierName { get; set; } /// /// BOM用量 /// @@ -128,7 +122,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch /// 是否量差 /// [Display(Name = "是否量差")] - public bool IsDiffNumber { set; get; } + public bool IsDiffNumber { set; get; } /// /// 差异金额 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseSupplierOutPutDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseSupplierOutPutDto.cs index 4b3f0e27..2ae415c5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseSupplierOutPutDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchBaseSupplierOutPutDto.cs @@ -1,8 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.SettleAccount.Entities.SecMatch; namespace Win.Sfs.SettleAccount.Reports.SecMatch @@ -14,7 +10,6 @@ namespace Win.Sfs.SettleAccount.Reports.SecMatch /// public string Company { get; } - /// /// 报送清单单位 /// @@ -44,7 +39,6 @@ namespace Win.Sfs.SettleAccount.Reports.SecMatch public decimal SumTaxAmount { get; } - /// /// 详表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchSummaryOutPutDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchSummaryOutPutDto.cs index c618131d..9bd5c2c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchSummaryOutPutDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecMatch/SecMatchSummaryOutPutDto.cs @@ -1,8 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.SettleAccount.Entities.SecMatch; namespace Win.Sfs.SettleAccount.Reports.SecMatch @@ -19,7 +15,6 @@ namespace Win.Sfs.SettleAccount.Reports.SecMatch /// public string Company { get; } - /// /// 报送清单单位 /// @@ -30,7 +25,6 @@ namespace Win.Sfs.SettleAccount.Reports.SecMatch /// public string Version { get; } - /// /// 制单时间 /// @@ -45,12 +39,10 @@ namespace Win.Sfs.SettleAccount.Reports.SecMatch public decimal SumAUDIQ5 { get; } - public decimal SumAmount { get; } public decimal SumTaxAmount { get; } - /// /// 详表 /// @@ -71,7 +63,7 @@ namespace Win.Sfs.SettleAccount.Reports.SecMatch ReportCompany = reportCompany; Version = version; Time = time; - SumBORANF = sumBORAN; + SumBORANF = sumBORAN; SumAUDIB9 = sumAUDIB9; SumAUDIQ5 = sumAUDIQ5; SumAmount = sumAmount; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/ISecondaryActuralAdjustmentReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/ISecondaryActuralAdjustmentReportAppService.cs index b670e9c1..5c465da5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/ISecondaryActuralAdjustmentReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/ISecondaryActuralAdjustmentReportAppService.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; - -using Win.Sfs.Shared.ApplicationBase; +using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { @@ -21,4 +19,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateDto.cs index 60681b90..9271a6b1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,15 +25,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateOrUpdateDtoBase.cs index 1c7f125a..600c90c8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportCreateOrUpdateDtoBase.cs @@ -1,22 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { /// /// 新增和更新DTO /// - public class SecondaryActuralAdjustmentReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class SecondaryActuralAdjustmentReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - - /// /// 年度 /// @@ -29,14 +25,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - ///// ///// 地点 ///// @@ -52,8 +46,7 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -81,4 +73,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "明细表")] public virtual List SecondaryActuralAdjustmentReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailDto.cs index 39649ce1..74769e38 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "期间")] public string Month { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户总成物料号 /// @@ -65,16 +60,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public string CustomItemCode { get; set; } - - /// /// 客户总成物料号下线数量 /// [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - - /// /// 客户组件物料号 /// @@ -95,22 +86,18 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "客户组件描述")] public string CustomSubItemDesc { get; set; } - - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "E组件用量")] public decimal ErpSubItemQty { get; set; } - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "组件实际用量")] public decimal ErpSubItemActualQty { get; set; } - /// /// 供应商代码 /// @@ -125,7 +112,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "供应商描述")] public string SupplierDesc { get; set; } - /// /// 供货比例 /// @@ -133,7 +119,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - /// /// 零件单价 /// @@ -148,7 +133,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "零件数量(回款)")] public decimal CustomSubItemSumQty { get; set; } - /// /// 金额(不含税) /// @@ -156,14 +140,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "金额(不含税)")] public decimal SumPriceNoTax { get; set; } - /// /// 金额(含税) /// [Display(Name = "金额(含税)")] public decimal SumPriceWithTax { set; get; } - /// /// 价格或零件号变动情况 /// @@ -171,7 +153,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "价格或零件号变动情况")] public string HasChanged { get; set; } = "否"; - /// /// 二配采购员 /// @@ -180,4 +161,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public string Buyer { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailExportDto.cs index 11f1984e..c9e979b4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailExportDto.cs @@ -1,12 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { @@ -15,7 +11,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports /// public class SecondaryActuralAdjustmentReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -24,7 +19,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -37,14 +31,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "期间")] public string Month { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户总成物料号 /// @@ -52,16 +44,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public string CustomItemCode { get; set; } - - /// /// 客户总成物料号下线数量 /// [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - - /// /// 客户组件物料号 /// @@ -82,22 +70,18 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports //[Display(Name = "客户组件描述")] //public string CustomSubItemDesc { get; set; } - - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "组件标准用量")] public decimal ErpSubItemQty { get; set; } - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "组件实际用量")] public decimal ErpSubItemActualQty { get; set; } - /// /// 供应商代码 /// @@ -112,7 +96,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "供应商描述")] public string SupplierDesc { get; set; } - /// /// 供货比例 /// @@ -120,7 +103,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - /// /// 零件单价 /// @@ -135,7 +117,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "零件数量(回款)")] public decimal CustomSubItemSumQty { get; set; } - /// /// 金额(不含税) /// @@ -143,14 +124,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "金额(不含税)")] public decimal SumPriceNoTax { get; set; } - /// /// 金额(含税) /// [Display(Name = "金额(含税)")] public decimal SumPriceWithTax { set; get; } - /// /// 价格或零件号变动情况 /// @@ -158,7 +137,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "价格或零件号变动情况")] public string HasChanged { get; set; } = "否"; - /// /// 二配采购员 /// @@ -167,4 +145,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public string Buyer { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailRequestDto.cs index fb716d27..95e57f9c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDto.cs index 2c9ea4fa..d2496a47 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports /// public class SecondaryActuralAdjustmentReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List SecondaryActuralAdjustmentReportDetails { get; set; } + public virtual List SecondaryActuralAdjustmentReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportRequestDto.cs index d590a62d..20eface2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportUpdateDto.cs index a2db5531..974171b0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports +namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralBTDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralBTDto.cs index 387d01f0..e7023d9b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralBTDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralBTDto.cs @@ -1,8 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.SettleAccount.SecondaryExportReports; namespace Win.Sfs.SettleAccount.Reports.SecondaryActuralAdjustmentReports diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralDto.cs index b8da7142..7f9c3f4c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralDto.cs @@ -1,10 +1,5 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports; -using Win.Sfs.SettleAccount.SecondaryExportReports; namespace Win.Sfs.SettleAccount.Reports.SecondaryActuralDiffReports.DTO { @@ -50,12 +45,12 @@ namespace Win.Sfs.SettleAccount.Reports.SecondaryActuralDiffReports.DTO /// public List SecSummaryOutPutList { get; } - public SecondaryActuralDto(string company, - string companydode, + public SecondaryActuralDto(string company, + string companydode, string reportCompany, - string version, + string version, string supplier, - string time, + string time, string supplierOfCode, List secSumamaryOutPutList) { Company = company; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportAppService.cs index 98bf5e0b..8ba53eb0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportAppService.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.SecondaryExportReports; using Win.Sfs.Shared.ApplicationBase; @@ -28,17 +27,14 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports Task> GetActualAssemblyPartListAsync(StatisticRequestDtoBase input); - Task> GetActualDistributionDetailListAsync(StatisticRequestDtoBase input); Task> GetActualDistributionSumListAsync(StatisticRequestDtoBase input); Task GetActualadjustmentSumReportAsync(StatisticRequestDtoBase input); - Task GetSecondaryActuralDiffReportAsync(StatisticRequestDtoBase input); - Task ExportReportAsync(Guid id); Task GetSecondaryCumulativeActuralDiffReportAsync(StatisticRequestDtoBase input); @@ -47,4 +43,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports Task SaveBTExcelImporTemplate(StatisticRequestDtoBase input); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateDto.cs index ebc81283..a9a1d67d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,15 +25,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateOrUpdateDtoBase.cs index 8c6998a9..3b33545b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportCreateOrUpdateDtoBase.cs @@ -1,22 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { /// /// 新增和更新DTO /// - public class SecondaryActuralDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class SecondaryActuralDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - - /// /// 年度 /// @@ -29,14 +25,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - ///// ///// 地点 ///// @@ -52,8 +46,7 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -81,4 +73,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "明细表")] public virtual List SecondaryActuralDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailDto.cs index 6ed708f1..25de9a7a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,8 +60,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - /// /// 客户总成物料号 /// @@ -74,7 +67,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public string CustomItemCode { get; set; } - ///// ///// ERP组件物料号 ///// @@ -88,7 +80,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports //[Display(Name = "客户总成物料号描述")] //public string CustomItemDesc { get; set; } - /// /// ERP总成下线数量 /// @@ -96,8 +87,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = " ERP总成下线数量")] public decimal ParentItemOfflineQty { get; set; } - - /// /// 客户组件物料号 /// @@ -117,17 +106,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "供应商代码")] public string SupplierCode { set; get; } - /// /// 供应商描述 /// [Display(Name = "供应商描述")] public string SupplierDesc { set; get; } - - - - /// /// 标准零件数量(回款) /// @@ -135,7 +119,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "标准零件数量(回款)")] public decimal StaPaymentPartyQty { get; set; } - /// /// 实际零件数量(回款) /// @@ -143,7 +126,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "实际零件数量(回款)")] public decimal ActPaymentPartyQty { get; set; } - /// /// 数量差异 /// @@ -151,8 +133,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "数量差异")] public decimal DiffQty { get; set; } - - /// /// 标准金额(不含税) /// @@ -160,7 +140,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "标准金额(不含税)")] public decimal StdNoTaxAmount { get; set; } - /// /// 实际金额(不含税) /// @@ -175,6 +154,5 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "金额差异")] public decimal DiffAmount { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailExportDto.cs index 0f7462ef..67574a66 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailExportDto.cs @@ -1,13 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { @@ -16,7 +11,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports /// public class SecondaryActuralDiffReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -25,7 +19,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -40,14 +33,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -55,8 +46,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - /// /// 客户总成物料号 /// @@ -70,7 +59,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports //[Display(Name = "客户总成描述")] //public string CustomItemDesc { get; set; } - ///// ///// ERP总成下线数量 ///// @@ -78,8 +66,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports //[Display(Name = " ERP总成下线数量")] //public decimal ParentItemOfflineQty { get; set; } - - /// /// 客户组件物料号 /// @@ -87,7 +73,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public string CustomSubItemCode { get; set; } - /// /// ERP组件物料号 /// @@ -107,7 +92,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "供应商代码")] public string SupplierCode { set; get; } - /// /// 供应商描述 /// @@ -121,7 +105,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "标准零件数量(回款)")] public decimal StaPaymentPartyQty { get; set; } - /// /// 实际零件数量(回款) /// @@ -129,7 +112,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "实际零件数量(回款)")] public decimal ActPaymentPartyQty { get; set; } - /// /// 数量差异 /// @@ -137,8 +119,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "数量差异")] public decimal DiffQty { get; set; } - - /// /// 标准金额(不含税) /// @@ -146,7 +126,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "标准金额(不含税)")] public decimal StdNoTaxAmount { get; set; } - /// /// 实际金额(不含税) /// @@ -161,6 +140,5 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports [Display(Name = "金额差异")] public decimal DiffAmount { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailRequestDto.cs index 62e63b0e..257f49b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDto.cs index 76eace6f..15e47f29 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports /// public class SecondaryActuralDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List SecondaryActuralDiffReportDetails { get; set; } + public virtual List SecondaryActuralDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportRequestDto.cs index 57d7cb3a..896fc61f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportUpdateDto.cs index dc505575..c7022506 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports +namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/DiffUnsetttleReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/DiffUnsetttleReportDto.cs index edbe9684..fbd45e7f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/DiffUnsetttleReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/DiffUnsetttleReportDto.cs @@ -1,9 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports { @@ -16,12 +11,10 @@ namespace Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports [ExporterHeader(DisplayName = "1月期末差异")] public string Jan { set; get; } - [ExporterHeader(DisplayName = "1月与上期期末对比")] public string JanDiff { set; get; } - - [ExporterHeader(DisplayName = "2月期末差异")] + [ExporterHeader(DisplayName = "2月期末差异")] public string Feb { set; get; } [ExporterHeader(DisplayName = "2月与上期期末对比")] @@ -32,12 +25,12 @@ namespace Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports [ExporterHeader(DisplayName = "3月与上期期末对比")] public string MarDiff { set; get; } - [ExporterHeader(DisplayName = "4月期末差异")] + [ExporterHeader(DisplayName = "4月期末差异")] public string Apr { set; get; } [ExporterHeader(DisplayName = "4月与上期期末对比")] public string AprDiff { set; get; } - [ExporterHeader(DisplayName = "5月期末差异")] + [ExporterHeader(DisplayName = "5月期末差异")] public string May { set; get; } [ExporterHeader(DisplayName = "5月与上期期末对比")] public string MayDiff { set; get; } @@ -46,37 +39,33 @@ namespace Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports [ExporterHeader(DisplayName = "6月与上期期末对比")] public string JunDiff { set; get; } - [ExporterHeader(DisplayName = "7月期末差异")] + [ExporterHeader(DisplayName = "7月期末差异")] public string Jul { set; get; } [ExporterHeader(DisplayName = "7月与上期期末对比")] public string JulDiff { set; get; } - [ExporterHeader(DisplayName = "8月期末差异")] + [ExporterHeader(DisplayName = "8月期末差异")] public string Aug { set; get; } [ExporterHeader(DisplayName = "8月与上期期末对比")] public string AugDiff { set; get; } - [ExporterHeader(DisplayName = "9月期末差异")] + [ExporterHeader(DisplayName = "9月期末差异")] public string Sep { set; get; } [ExporterHeader(DisplayName = "9月与上期期末对比")] public string SepDiff { set; get; } - [ExporterHeader(DisplayName = "10月期末差异")] + [ExporterHeader(DisplayName = "10月期末差异")] public string Oct { set; get; } [ExporterHeader(DisplayName = "10月与上期期末对比")] public string OctDiff { set; get; } - [ExporterHeader(DisplayName = "11月期末差异")] + [ExporterHeader(DisplayName = "11月期末差异")] public string Nov { set; get; } [ExporterHeader(DisplayName = "11月与上期期末对比")] public string NovDiff { set; get; } - [ExporterHeader(DisplayName = "12月期末差异")] + [ExporterHeader(DisplayName = "12月期末差异")] public string Dec { set; get; } - - - - - [ExporterHeader(DisplayName = "12月与上期期末对比")] + [ExporterHeader(DisplayName = "12月与上期期末对比")] public string DecDiff { set; get; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/ISendUnsettledDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/ISendUnsettledDiffReportAppService.cs index c86724af..72c141fc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/ISendUnsettledDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/ISendUnsettledDiffReportAppService.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; - -using Win.Sfs.Shared.ApplicationBase; +using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { @@ -21,8 +18,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports Task GetReportAsync(SendUnsettledDiffReportStatisticRequestDto input); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateDto.cs index 463442cb..ee3f2832 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,9 +25,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// @@ -40,4 +33,4 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateOrUpdateDtoBase.cs index 21e9ac1e..63faa769 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportCreateOrUpdateDtoBase.cs @@ -1,19 +1,17 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { /// /// 新增和更新DTO /// - public class SendUnsettledDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase - { + public class SendUnsettledDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + { /// /// 统计时间起 /// @@ -21,7 +19,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "统计时间起")] public DateTime BeginTime { get; set; } - /// /// 统计时间止 /// @@ -53,8 +50,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -69,7 +65,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -82,4 +77,4 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "明细表")] public virtual List SendUnsettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailDto.cs index 791c91f8..855b76d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailDto.cs @@ -1,13 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Volo.Abp.Domain.Entities; using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports @@ -23,8 +20,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] - public Guid BranchId { get; set; } - + public Guid BranchId { get; set; } /// /// 单据ID @@ -40,7 +36,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -53,14 +48,12 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 结算状态 /// @@ -68,20 +61,17 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public EnumSettleStatus Status { get; set; } - /// /// 订单号 /// [Display(Name = "订单号")] public string OrderBillNum { get; set; } - - /// /// KENEN号 /// [Display(Name = "KENEN号")] - public string KENNCode { get; set; } + public string KENNCode { get; set; } /// /// 客户物料号 @@ -101,48 +91,44 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// [Display(Name = "车型")] - public string Model { get; set; } + public string Model { get; set; } /// /// 数量 /// [Display(Name = "数量")] - public decimal Qty { get; set; } - + public decimal Qty { get; set; } /// /// CP5上线时间 /// [Display(Name = "CP5上线时间")] - public DateTime CP5Time { get; set; } + public DateTime CP5Time { get; set; } /// /// Fis年度 /// [Display(Name = "Fis年度")] - public string FISYear { set; get; } - + public string FISYear { set; get; } /// /// Kao号 /// [Display(Name = "Kao号")] - public string Extend1 { set; get; } - + public string Extend1 { set; get; } /// /// 顺序号 /// [Display(Name = "顺序号")] - public string SequenceNumber { set; get; } + public string SequenceNumber { set; get; } /// /// 底盘号 /// [Display(Name = "底盘号")] - public string ChassisNumber { set; get; } - + public string ChassisNumber { set; get; } /// /// 底盘号 @@ -155,7 +141,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// [Display(Name = "结算数量")] - public decimal SettledQty { get; set; } + public decimal SettledQty { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailExportDto.cs index c60c60c3..0932105a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailExportDto.cs @@ -1,15 +1,11 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; using Win.Sfs.Shared.Enums.SettleAccount; -using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { @@ -17,7 +13,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// 实体DTO /// public class SendUnsettledDiffReportDetailExportDto : EntityDto - { + { /// /// 单据流水号 /// @@ -45,14 +41,12 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "版本")] public string Version { set; get; } - /// /// 结算状态 /// [Display(Name = "结算状态")] - - public EnumSettleStatus Status { get; set; } + public EnumSettleStatus Status { get; set; } /// /// 订单号 @@ -60,8 +54,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "订单号")] public string OrderBillNum { get; set; } - - /// /// KENEN号 /// @@ -115,14 +107,12 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "Fis年度")] public string FISYear { set; get; } - /// /// Kao号 /// [Display(Name = "扩展1")] public string Extend1 { set; get; } - /// /// 顺序号 /// @@ -135,13 +125,11 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "底盘号")] public string ChassisNumber { set; get; } - /// /// 底盘号 /// [Display(Name = "底盘号(短码)")] public string ChassisNumber2 { set; get; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailRequestDto.cs index 3773583c..817e0b6b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports @@ -11,7 +9,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public class SendUnsettledDiffReportDetailRequestDto : BranchRequestDtoBase { - /// /// 主键ID @@ -22,4 +19,4 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDto.cs index 5c46ffa3..c39a603e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { @@ -33,6 +30,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// 明细表 /// [Display(Name = "明细表")] - public virtual List SendUnsettledDiffReportDetails { get; set; } + public virtual List SendUnsettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportRequestDto.cs index f976357e..23cc051e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportRequestDto.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports @@ -13,4 +9,4 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportStatisticRequestDto.cs index 53a0623a..4f0f7cab 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportStatisticRequestDto.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports @@ -27,7 +24,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "统计时间止")] public DateTime EndTime { get; set; } - /// /// 统计时间起 /// @@ -43,4 +39,4 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports public string EndVersion { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportUpdateDto.cs index 35990686..f40cac50 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports +namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportDtoBase.cs index 34825115..315edb16 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -15,7 +15,7 @@ namespace Win.Sfs.SettleAccount /// Full audited entity DTO base /// /// TKey - public abstract class SettleAccountReportDtoBase : AuditedEntityDto, IRemark + public abstract class SettleAccountReportDtoBase : AuditedEntityDto, IRemark { [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] @@ -34,16 +34,12 @@ namespace Win.Sfs.SettleAccount [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - - ///// ///// 地点 ///// @@ -75,7 +71,6 @@ namespace Win.Sfs.SettleAccount [Required(ErrorMessage = "{0}是必填项")] public EnumDocumentType DocumentType { get; set; } - /// /// 状态 /// @@ -89,14 +84,12 @@ namespace Win.Sfs.SettleAccount [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// [Display(Name = "备注")] public string Remark { get; set; } - /// /// 统计人名称 /// @@ -104,4 +97,4 @@ namespace Win.Sfs.SettleAccount public string CreatorName { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportTimeDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportTimeDtoBase.cs index 54fa1aa1..a6725987 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportTimeDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/SettleAccountReportTimeDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -15,7 +15,7 @@ namespace Win.Sfs.SettleAccount /// Full audited entity DTO base /// /// TKey - public abstract class SettleAccountReportTimeDtoBase : AuditedEntityDto, IRemark + public abstract class SettleAccountReportTimeDtoBase : AuditedEntityDto, IRemark { [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] @@ -29,7 +29,6 @@ namespace Win.Sfs.SettleAccount [Display(Name = "统计时间起")] public DateTime BeginTime { get; set; } - /// /// 统计时间止 /// @@ -37,7 +36,6 @@ namespace Win.Sfs.SettleAccount [Display(Name = "统计时间止")] public DateTime EndTime { get; set; } - /// /// 客户编码 /// @@ -64,7 +62,6 @@ namespace Win.Sfs.SettleAccount [Required(ErrorMessage = "{0}是必填项")] public EnumDocumentType DocumentType { get; set; } - /// /// 状态 /// @@ -78,7 +75,6 @@ namespace Win.Sfs.SettleAccount [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -86,4 +82,4 @@ namespace Win.Sfs.SettleAccount public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/IStockFisDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/IStockFisDiffReportAppService.cs index 2b9fad01..b75931a7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/IStockFisDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/IStockFisDiffReportAppService.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; - + using Win.Sfs.Shared.ApplicationBase; using Win.Sfs.Shared.DtoBase.SettleAccount; @@ -21,8 +20,7 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports Task GetReportAsync(StatisticRequestDtoBase input); Task GetBtReportAsync(StatisticRequestDtoBase input); - Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateDto.cs index 4222ef4e..d29daac9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockFisDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,15 +25,12 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateOrUpdateDtoBase.cs index ffc41051..6e85167d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportCreateOrUpdateDtoBase.cs @@ -1,22 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.StockFisDiffReports { /// /// 新增和更新DTO /// - public class StockFisDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class StockFisDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - - /// /// 年度 /// @@ -29,14 +25,12 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - ///// ///// 地点 ///// @@ -52,8 +46,7 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -81,4 +73,4 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "明细表")] public virtual List StockFisDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailDto.cs index ff9fb4f5..2347bc86 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockFisDiffReports { @@ -20,8 +19,7 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] - public Guid BranchId { get; set; } - + public Guid BranchId { get; set; } /// /// 单据ID @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,8 +60,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - /// /// 物品Code /// @@ -80,30 +73,24 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "物品描述")] public string ItemDesc { get; set; } - - /// /// 暂估类 /// [Display(Name = "暂估类")] - public string EstimationType { get; set; } - - - + public string EstimationType { get; set; } /// /// Fis数量 /// [Display(Name = "FIS/看板数量")] - public decimal FisQty { set; get; } + public decimal FisQty { set; get; } /// /// ERP客户库位数量 /// [Display(Name = "库存入库数量")] - public decimal StockQty { set; get; } - + public decimal StockQty { set; get; } /// /// 差异数量 @@ -111,4 +98,4 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailExportDto.cs index b1595e48..c060dd15 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailExportDto.cs @@ -1,13 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockFisDiffReports { @@ -15,7 +11,7 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// FIS发运数据对比输出表明细描述 /// public class StockFisDiffReportDetailExportDto : EntityDto - { + { /// /// 单据流水号 @@ -24,7 +20,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -39,14 +34,12 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports //[IEIgnoreAttribute] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -59,7 +52,7 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// 物品Code /// [Display(Name = "物料号")] - + public string ItemCode { get; set; } /// @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "物品描述")] public string ItemDesc { get; set; } - ///// ///// 暂估类 ///// @@ -80,14 +72,13 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// Fis数量 /// [Display(Name = "数量")] - public decimal FisQty { set; get; } + public decimal FisQty { set; get; } /// /// ERP客户库位入库数量 /// [Display(Name = "ERP入库数量")] - public decimal StockQty { set; get; } - + public decimal StockQty { set; get; } /// /// 差异数量 @@ -95,4 +86,4 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailRequestDto.cs index 253100ca..c773dbdf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.StockFisDiffReports @@ -19,7 +17,5 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports public Guid ParentId { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDto.cs index 7a29fd33..6c26894f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.StockFisDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// public class StockFisDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List StockFisDiffReportDetails { get; set; } + public virtual List StockFisDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportRequestDto.cs index 2e3f8bdd..90995bcb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportUpdateDto.cs index 489af5e1..4d53d97f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockFisDiffReports/StockFisDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.StockFisDiffReports +namespace Win.Sfs.SettleAccount.StockFisDiffReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/IStockSettledDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/IStockSettledDiffReportAppService.cs index f0571c21..20d57a24 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/IStockSettledDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/IStockSettledDiffReportAppService.cs @@ -1,8 +1,7 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; - + using Win.Sfs.Shared.ApplicationBase; using Win.Sfs.Shared.DtoBase.SettleAccount; @@ -22,9 +21,7 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports Task ExportReportAsync(Guid id); - Task GetUserAsync(Guid id); - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateDto.cs index 2248fce5..56f18f9a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockSettledDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,15 +25,12 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateOrUpdateDtoBase.cs index b22194ec..f9391257 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportCreateOrUpdateDtoBase.cs @@ -1,22 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.StockSettledDiffReports { /// /// 新增和更新DTO /// - public class StockSettledDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class StockSettledDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - - /// /// 年度 /// @@ -29,14 +25,12 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - ///// ///// 地点 ///// @@ -52,8 +46,7 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -81,4 +73,4 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "明细表")] public virtual List StockSettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailDto.cs index d78922be..c9fb260e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailDto.cs @@ -1,11 +1,10 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockSettledDiffReports { @@ -22,7 +21,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports public Guid BranchId { get; set; } - /// /// 单据ID /// @@ -37,7 +35,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -50,14 +47,12 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -65,10 +60,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "客户代码")] public string CustomCode { get; set; } - - - - /// /// R3客户物料号 /// @@ -80,18 +71,14 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports /// 物品描述 /// [Display(Name = "物品描述")] - public string ItemDesc { get; set; } - + public string ItemDesc { get; set; } /// /// 暂估类 /// [Display(Name = "暂估类")] - public string EstimationType { get; set; } - - - + public string EstimationType { get; set; } /// /// R3结算数量 @@ -105,11 +92,10 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "ERP出库数量")] public decimal StockQty { set; get; } - /// /// 差异数量 /// [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailExportDto.cs index a86c81c7..69faf00b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailExportDto.cs @@ -1,13 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockSettledDiffReports { @@ -23,7 +19,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -38,14 +33,12 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports //[IEIgnoreAttribute] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - /// /// 客户代码 /// @@ -54,7 +47,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [IEIgnoreAttribute] public string CustomCode { get; set; } - /// /// R3客户物料号 /// @@ -66,8 +58,7 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports /// 物品描述 /// [Display(Name = "物品描述")] - public string ItemDesc { get; set; } - + public string ItemDesc { get; set; } ///// ///// 暂估类 @@ -76,9 +67,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports //[Display(Name = "暂估类")] //public string EstimationType { get; set; } - - - /// /// R3结算数量 /// @@ -91,11 +79,10 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports [Display(Name = "ERP出库数量")] public decimal StockQty { set; get; } - /// /// 差异数量 /// [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailRequestDto.cs index b79ab60c..9fe8d061 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.StockSettledDiffReports @@ -19,4 +17,4 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports public Guid ParentId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDto.cs index 9b975f46..2d40a2fc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.StockSettledDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports /// public class StockSettledDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List StockSettledDiffReportDetails { get; set; } + public virtual List StockSettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportRequestDto.cs index 353e6337..0b330c9c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportUpdateDto.cs index 829e1e97..37418005 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockSettledDiffReports/StockSettledDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.StockSettledDiffReports +namespace Win.Sfs.SettleAccount.StockSettledDiffReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/IStockUnsettledDiffReportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/IStockUnsettledDiffReportAppService.cs index a9ceb650..094b1030 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/IStockUnsettledDiffReportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/IStockUnsettledDiffReportAppService.cs @@ -1,10 +1,8 @@ -using System; -using System.Collections.Generic; +using System; using System.Threading.Tasks; using Volo.Abp.Application.Services; - -using Win.Sfs.Shared.ApplicationBase; +using Win.Sfs.Shared.ApplicationBase; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { @@ -25,4 +23,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports Task ExportReportAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateDto.cs index 167a76c2..af3af904 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateDto.cs @@ -1,9 +1,6 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -21,7 +18,6 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports public Guid BranchId { get; set; } - /// /// 单据流水号 /// @@ -29,15 +25,12 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - - - /// /// 单据类型 /// [Display(Name = "单据类型")] [Required(ErrorMessage = "{0}是必填项")] - public EnumDocumentType DocumentType { get; set; } + public EnumDocumentType DocumentType { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateOrUpdateDtoBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateOrUpdateDtoBase.cs index ec7748eb..60a1c71e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateOrUpdateDtoBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportCreateOrUpdateDtoBase.cs @@ -1,22 +1,18 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Volo.Abp.ObjectExtending; +using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { /// /// 新增和更新DTO /// - public class StockUnsettledDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase + public class StockUnsettledDiffReportCreateOrUpdateDtoBase : CreateOrUpdateEntityDtoBase { - - /// /// 年度 /// @@ -29,14 +25,12 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - ///// ///// 地点 ///// @@ -52,8 +46,7 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// 客户名称 /// [Display(Name = "客户名称")] - public string CustomName { get; set; } - + public string CustomName { get; set; } /// /// 状态 @@ -68,7 +61,6 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - /// /// 备注 /// @@ -81,4 +73,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "明细表")] public virtual List StockUnsettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailDto.cs index a8e91d7d..cb5a2b0c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailDto.cs @@ -1,12 +1,11 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { @@ -21,8 +20,7 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "分支Id")] [Required(ErrorMessage = "{0}是必填项")] - public Guid BranchId { get; set; } - + public Guid BranchId { get; set; } /// /// 单据ID @@ -38,7 +36,6 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -54,13 +51,11 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] - public string Version { set; get; } - + public string Version { set; get; } /// /// 物品Code @@ -75,40 +70,32 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "物品描述")] public string ItemDesc { get; set; } - - /// /// 客户代码 /// [IEIgnoreAttribute] [Display(Name = "客户代码")] - public string CustomCode { get; set; } - - + public string CustomCode { get; set; } /// /// 暂估类 /// [Display(Name = "暂估类")] - public string EstimationType { get; set; } - - + public string EstimationType { get; set; } /// /// Fis未结数量 /// [Display(Name = "未结数量")] - public decimal FisUnSettledQty { set; get; } + public decimal FisUnSettledQty { set; get; } /// /// 现有库存数量 /// [Display(Name = "现有库存数量")] - public decimal StockQty { set; get; } - - + public decimal StockQty { set; get; } /// /// 差异数量 @@ -116,4 +103,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailExportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailExportDto.cs index 922bf64b..96054c9c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailExportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailExportDto.cs @@ -1,13 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using Magicodes.ExporterAndImporter.Core; -using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { @@ -16,7 +12,6 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// public class StockUnsettledDiffReportDetailExportDto : EntityDto { - /// /// 单据流水号 @@ -25,7 +20,6 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Required(ErrorMessage = "{0}是必填项")] public string DocumentNumber { get; set; } - /// /// 年度 /// @@ -40,15 +34,12 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports //[IEIgnoreAttribute] public string Period { set; get; } - /// /// 版本 /// [Display(Name = "版本")] public string Version { set; get; } - - /// /// 客户代码 /// @@ -68,8 +59,7 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// 物品描述 /// [Display(Name = "物品描述")] - public string ItemDesc { get; set; } - + public string ItemDesc { get; set; } ///// ///// 暂估类 @@ -82,15 +72,13 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// Fis未结数量 /// [Display(Name = "未结数量")] - public decimal FisUnSettledQty { set; get; } + public decimal FisUnSettledQty { set; get; } /// /// 现有库存数量 /// [Display(Name = "现有库存数量")] - public decimal StockQty { set; get; } - - + public decimal StockQty { set; get; } /// /// 差异数量 @@ -98,4 +86,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports [Display(Name = "差异数量")] public decimal DiffQty { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailRequestDto.cs index 7f5cea2a..e9364685 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetailRequestDto.cs @@ -1,7 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -11,7 +9,6 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// public class StockUnsettledDiffReportDetailRequestDto : BranchRequestDtoBase { - /// /// 主表Id @@ -21,8 +18,5 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports public Guid ParentId { get; set; } - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDto.cs index 98a31d98..77d6d830 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDto.cs @@ -1,12 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { @@ -15,12 +12,11 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// public class StockUnsettledDiffReportDto : SettleAccountReportDtoBase { - /// /// 明细表 /// [Display(Name = "明细表")] - public virtual List StockUnsettledDiffReportDetails { get; set; } + public virtual List StockUnsettledDiffReportDetails { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportRequestDto.cs index edc931df..f5e62dc6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportRequestDto.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared; using Win.Sfs.Shared.DtoBase; @@ -20,4 +19,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports public Guid BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportStatisticRequestDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportStatisticRequestDto.cs index b890b7ff..1d592b1a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportStatisticRequestDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportStatisticRequestDto.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; using Win.Sfs.Shared.DtoBase.SettleAccount; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports @@ -13,6 +8,5 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports public class StockUnsettledDiffReportStatisticRequestDto : StatisticRequestDtoBase { - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportUpdateDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportUpdateDto.cs index 03d92864..d3e46181 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportUpdateDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportUpdateDto.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports +namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { /// /// 更新DTO @@ -7,4 +7,4 @@ { } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/SettleAccountApplicationContractsModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/SettleAccountApplicationContractsModule.cs index 00b6a662..cec727e1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/SettleAccountApplicationContractsModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/SettleAccountApplicationContractsModule.cs @@ -1,7 +1,7 @@ -using Volo.Abp.Application; -using Volo.Abp.Modularity; +using Volo.Abp.Application; using Volo.Abp.Authorization; - +using Volo.Abp.Modularity; + namespace Win.Sfs.SettleAccount { [DependsOn( diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs index f61e4032..3586374c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/ADJ_SERVICE.cs @@ -1,18 +1,12 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Linq; using System.Linq.Dynamic.Core; -using System.Text; using System.Threading.Tasks; -using DocumentFormat.OpenXml.Bibliography; -using DocumentFormat.OpenXml.Office2010.Excel; -using DocumentFormat.OpenXml.Wordprocessing; using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore.Query.SqlExpressions; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using Volo.Abp; @@ -23,312 +17,304 @@ using Win.Sfs.SettleAccount.Bases.DomainServices; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.Entities.BQ.Managers; -using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -using static System.Runtime.CompilerServices.RuntimeHelpers; -namespace Win.Sfs.SettleAccount.Bases; -/// -/// 发票明细调整表 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class ADJ_SERVICE : BASE_SERVICE +namespace Win.Sfs.SettleAccount.Bases { - protected readonly INormalEfCoreRepository _repository; - protected readonly BaseDomainService _baseDomainService; - protected readonly INormalEfCoreRepository _invRepository; - protected readonly INormalEfCoreRepository _relRepository; - protected readonly INormalEfCoreRepository _bbacRepository; - protected readonly INormalEfCoreRepository _pubRepository; - protected readonly INormalEfCoreRepository _hbpoRepository; - protected readonly INormalEfCoreRepository _priceRepository; - protected readonly INormalEfCoreRepository _pricebjRepository; - - - public ADJ_SERVICE( - INormalEfCoreRepository repository, - BaseDomainService baseDomainService, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager, - INormalEfCoreRepository invRepository, - INormalEfCoreRepository relRepository, - INormalEfCoreRepository bbacRepository, - INormalEfCoreRepository pubRepository, - INormalEfCoreRepository hbpoRepository, - INormalEfCoreRepository priceRepository, - INormalEfCoreRepository pricebjRepository - - ) - : base(excelImportService, snowflakeIdGenerator, commonManager) - { - _relRepository = relRepository; - _invRepository = invRepository; - _repository = repository; - _baseDomainService = baseDomainService; - _bbacRepository = bbacRepository; - _pubRepository = pubRepository; - _hbpoRepository = hbpoRepository; - _priceRepository = priceRepository; - _pricebjRepository = pricebjRepository; - } /// - ///查询明细 + /// 发票明细调整表 /// - /// 明细查询条件 - /// - [HttpPost] - - public virtual async Task> DetailQueryAsync(PUB_ADJ_DETAIL_REQ_DTO input) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class ADJ_SERVICE : BASE_SERVICE { + protected readonly INormalEfCoreRepository _repository; + protected readonly BaseDomainService _baseDomainService; + protected readonly INormalEfCoreRepository _invRepository; + protected readonly INormalEfCoreRepository _relRepository; + protected readonly INormalEfCoreRepository _bbacRepository; + protected readonly INormalEfCoreRepository _pubRepository; + protected readonly INormalEfCoreRepository _hbpoRepository; + protected readonly INormalEfCoreRepository _priceRepository; + protected readonly INormalEfCoreRepository _pricebjRepository; - var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); - var dtos = ObjectMapper.Map, List>(entitys); - return new PagedResultDto(totalCount, dtos); - } + public ADJ_SERVICE( + INormalEfCoreRepository repository, + BaseDomainService baseDomainService, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager, + INormalEfCoreRepository invRepository, + INormalEfCoreRepository relRepository, + INormalEfCoreRepository bbacRepository, + INormalEfCoreRepository pubRepository, + INormalEfCoreRepository hbpoRepository, + INormalEfCoreRepository priceRepository, + INormalEfCoreRepository pricebjRepository - /// - /// 导入文件 - /// - /// - /// - /// - [HttpPost] - [DisableRequestSizeLimit] - public async Task ExcelImport([FromForm] IFormFileCollection files) - { - List errorList = new List(); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - if (result.Count == 0) - { - throw new BusinessException("8989", "导入数据记录为0条"); - } - var relation = _relRepository.ToList(); - var invs = result.Select(p => p.OldInvBillNum).ToList();//所有发票号 - var deletels = _repository.Where(p => invs.Contains(p.OldInvBillNum)).ToList();//所有关联发票号的调整表 - var invlist = _invRepository.Where(p => invs.Contains(p.InvbillNum)).ToList();//所有发票 - var dlists = deletels.Where(p => string.IsNullOrEmpty(p.InvBillNum)).ToList();//所有新发票号不为空的调整记录 - foreach (var itm in dlists) + ) + : base(excelImportService, snowflakeIdGenerator, commonManager) { - errorList.Add(new ErrorExportDto() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}记录已经被重新开票,新发票号为:{itm.InvBillNum}" }); + _relRepository = relRepository; + _invRepository = invRepository; + _repository = repository; + _baseDomainService = baseDomainService; + _bbacRepository = bbacRepository; + _pubRepository = pubRepository; + _hbpoRepository = hbpoRepository; + _priceRepository = priceRepository; + _pricebjRepository = pricebjRepository; } - //var first = deletels.FirstOrDefault(); - //if (!string.IsNullOrEmpty(first.InvBillNum)) - //{ - // throw new BusinessException("8989", $"调整记录已经生成新发票号:{first.InvBillNum}"); - //} - var entityList = ObjectMapper.Map, List>(result); - var codelist = entityList.Select(p => p.LU).ToList(); - var errors = await _baseDomainService.CheckBase(codelist, new BASE_CONF() { IsRelationShip = true }); - foreach (var itm in errors) + /// + ///查询明细 + /// + /// 明细查询条件 + /// + [HttpPost] + + public virtual async Task> DetailQueryAsync(PUB_ADJ_DETAIL_REQ_DTO input) { - errorList.Add( - new ErrorExportDto() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); + + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entitys); + return new PagedResultDto(totalCount, dtos); } - var errorEntitylist = await _baseDomainService.CheckPriceList(entityList,"1040"); - if (errorEntitylist.Count > 0) + + /// + /// 导入文件 + /// + /// + /// + /// + [HttpPost] + [DisableRequestSizeLimit] + public async Task ExcelImport([FromForm] IFormFileCollection files) { - foreach (var itm in errorEntitylist) + List errorList = new List(); + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + if (result.Count == 0) { - errorList.Add(new ErrorExportDto() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}不存在价格单记录" }); + throw new BusinessException("8989", "导入数据记录为0条"); } + var relation = _relRepository.ToList(); + var invs = result.Select(p => p.OldInvBillNum).ToList();//所有发票号 + var deletels = _repository.Where(p => invs.Contains(p.OldInvBillNum)).ToList();//所有关联发票号的调整表 + var invlist = _invRepository.Where(p => invs.Contains(p.InvbillNum)).ToList();//所有发票 + var dlists = deletels.Where(p => string.IsNullOrEmpty(p.InvBillNum)).ToList();//所有新发票号不为空的调整记录 + foreach (var itm in dlists) + { + errorList.Add(new ErrorExportDto() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}记录已经被重新开票,新发票号为:{itm.InvBillNum}" }); + } + //var first = deletels.FirstOrDefault(); + //if (!string.IsNullOrEmpty(first.InvBillNum)) + //{ + // throw new BusinessException("8989", $"调整记录已经生成新发票号:{first.InvBillNum}"); + //} + var entityList = ObjectMapper.Map, List>(result); + var codelist = entityList.Select(p => p.LU).ToList(); + var errors = await _baseDomainService.CheckBase(codelist, new BASE_CONF() { IsRelationShip = true }).ConfigureAwait(false); + foreach (var itm in errors) + { + errorList.Add( + new ErrorExportDto() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); + } + var errorEntitylist = await _baseDomainService.CheckPriceList(entityList, "1040").ConfigureAwait(false); + if (errorEntitylist.Count > 0) + { + foreach (var itm in errorEntitylist) + { + errorList.Add(new ErrorExportDto() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}不存在价格单记录" }); + } + } + var query = from itm in entityList + join itm1 in invlist + on itm.InvBillNum equals itm1.InvbillNum + join itm2 in relation on itm.LU equals itm2.SettleMaterialCode + select new PUB_ADJ_DETAIL( + id: GuidGenerator.Create(), + keyCode: itm.PN + itm.LU, + version: itm.Version, + settleBillNum: itm.SettleBillNum, + lU: itm2.ErpMaterialCode, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + extend1: string.Empty, + price: 0, + invGroupNum: itm1.InvGroupNum, + settleDate: itm.SettleDate, + businessType: itm1.BusinessType, + groupNum: itm.GroupNum, + oldinv: itm.InvBillNum, + inv: string.Empty, + partcode: itm.PartCode + ); + await _repository.DbContext.BulkDeleteAsync(deletels).ConfigureAwait(false);//删除发票下所有调整明细 + await _repository.DbContext.BulkInsertAsync(query.ToList()).ConfigureAwait(false); + return ApplicationConsts.SuccessStr; } - var query = from itm in entityList - join itm1 in invlist - on itm.InvBillNum equals itm1.InvbillNum - join itm2 in relation on itm.LU equals itm2.SettleMaterialCode - select new PUB_ADJ_DETAIL( - id: GuidGenerator.Create(), - keyCode: itm.PN + itm.LU, - version: itm.Version, - settleBillNum: itm.SettleBillNum, - lU: itm2.ErpMaterialCode, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - extend1: string.Empty, - price: 0, - invGroupNum: itm1.InvGroupNum, - settleDate: itm.SettleDate, - businessType: itm1.BusinessType, - groupNum: itm.GroupNum, - oldinv: itm.InvBillNum, - inv: string.Empty, - partcode: itm.PartCode - ); - await _repository.DbContext.BulkDeleteAsync(deletels);//删除发票下所有调整明细 - await _repository.DbContext.BulkInsertAsync(query.ToList()); - return ApplicationConsts.SuccessStr; - } - - - /// - /// 导入文件 - /// - /// - /// - /// - [HttpPost] - [DisableRequestSizeLimit] - public async Task CheckImport(List p_list) - { - if (p_list.Count == 0) - { - throw new UserFriendlyException($"导入数据为空","400"); - } - foreach (var itm in p_list) - { - itm.KeyCode = itm.PN + itm.LU.Replace(" ", "").Trim(); - } - var pnlist = p_list.Select(p => p.PN).Distinct().ToList(); - int flag = 0; - var keylist = p_list.Select(p => p.KeyCode).Distinct(); - List errorList = new List(); - //var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); - - var first = p_list.FirstOrDefault(); - var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); - if (first != null) + /// + /// 导入文件 + /// + /// + /// + /// + [HttpPost] + [DisableRequestSizeLimit] + public async Task CheckImport(List p_list) { - - string keyname = string.Empty; - List adjlist = new List(); - - switch (inv.BusinessType) + if (p_list.Count == 0) + { + throw new UserFriendlyException($"导入数据为空", "400"); + } + foreach (var itm in p_list) { - case EnumBusinessType.MaiDanJianHBPO: - break; - case EnumBusinessType.MaiDanJianBBAC: + itm.KeyCode = itm.PN + itm.LU.Replace(" ", "").Trim(); + } + var pnlist = p_list.Select(p => p.PN).Distinct().ToList(); + int flag = 0; + var keylist = p_list.Select(p => p.KeyCode).Distinct(); + List errorList = new List(); + //var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); - break; - case EnumBusinessType.ZhiGongJianBBAC: - //var errors1 = _pubRepository.Where(p => pnlist.Contains(p.PN)).ToList(); - //foreach (var p in errors1) - //{ - // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在{p.PN}数据,不能导入调整表" }); - //} - break; - case EnumBusinessType.ZhiGongJianHBPO: - //var errors2 = _pubRepository.Where(p => pnlist.Contains(p.PN)).ToList(); - //foreach (var p in errors2) - //{ - // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" }); - //} - break; - case EnumBusinessType.BeiJian: - flag = 1; - //var errors3 = _pubRepository.Where(p => pnlist.Contains(p.PN)).ToList(); - //foreach (var p in errors3) - //{ - // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在交付识别号{p.PN}数据,不能导入调整表" }); - //} - break; - case EnumBusinessType.JisBBAC: - var errors4 = _bbacRepository.Where(p => keylist.Contains(p.KeyCode)); - foreach (var p in errors4) - { - errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在生产码{p.PN}结算零件{p.PartCode},不能导入调整表" }); - } - break; - case EnumBusinessType.JisHBPO: - //var errors5 = _hbpoRepository.Where(p => keylist.Contains(p.KeyCode)); - //foreach (var p in errors5) - //{ - // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在生产码{p.PN}结算零件{p.PartCode},不能导入调整表" }); - //} - break; - case EnumBusinessType.YinDuJian: - //var errors6 = _pubRepository.Where(p => pnlist.Contains(p.PN)); - //foreach (var p in errors6) - //{ - // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" }); - //} - break; + var first = p_list.FirstOrDefault(); + var inv = _invRepository.Where(p => p.InvbillNum == first.InvBillNum).FirstOrDefault(); - } - } + if (first != null) + { + string keyname = string.Empty; + List adjlist = new List(); + switch (inv.BusinessType) + { + case EnumBusinessType.MaiDanJianHBPO: + break; + case EnumBusinessType.MaiDanJianBBAC: + break; + case EnumBusinessType.ZhiGongJianBBAC: + //var errors1 = _pubRepository.Where(p => pnlist.Contains(p.PN)).ToList(); + //foreach (var p in errors1) + //{ + // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在{p.PN}数据,不能导入调整表" }); + //} + break; + case EnumBusinessType.ZhiGongJianHBPO: + //var errors2 = _pubRepository.Where(p => pnlist.Contains(p.PN)).ToList(); + //foreach (var p in errors2) + //{ + // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" }); + //} + break; + case EnumBusinessType.BeiJian: + flag = 1; + //var errors3 = _pubRepository.Where(p => pnlist.Contains(p.PN)).ToList(); + //foreach (var p in errors3) + //{ + // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在交付识别号{p.PN}数据,不能导入调整表" }); + //} + break; + case EnumBusinessType.JisBBAC: + var errors4 = _bbacRepository.Where(p => keylist.Contains(p.KeyCode)); + foreach (var p in errors4) + { + errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在生产码{p.PN}结算零件{p.PartCode},不能导入调整表" }); + } + break; + case EnumBusinessType.JisHBPO: + //var errors5 = _hbpoRepository.Where(p => keylist.Contains(p.KeyCode)); + //foreach (var p in errors5) + //{ + // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在生产码{p.PN}结算零件{p.PartCode},不能导入调整表" }); + //} + break; + case EnumBusinessType.YinDuJian: + //var errors6 = _pubRepository.Where(p => pnlist.Contains(p.PN)); + //foreach (var p in errors6) + //{ + // errorList.Add(new ERR_EXP_DTO() { Message = $"不能结算数据中存在发货单{p.PN}数据,不能导入调整表" }); + //} + break; + } + } - var entityList = ObjectMapper.Map, List>(p_list); - var codelist = entityList.Select(p => p.LU).ToList(); - var errors = await _baseDomainService.CheckBase(codelist, new BASE_CONF() { IsRelationShip = true }); - foreach (var itm in errors) - { - errorList.Add( - new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); - } - var errorEntitylist = await _baseDomainService.CheckPriceList(entityList,inv.Site); - if (errorEntitylist.Count > 0) - { - foreach (var itm in errorEntitylist) + var entityList = ObjectMapper.Map, List>(p_list); + var codelist = entityList.Select(p => p.LU).ToList(); + var errors = await _baseDomainService.CheckBase(codelist, new BASE_CONF() { IsRelationShip = true }).ConfigureAwait(false); + foreach (var itm in errors) { - errorList.Add(new ERR_EXP_DTO() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}不存在价格单记录" }); + errorList.Add( + new ERR_EXP_DTO() { ItemCode = $"{itm}", Message = $"[客户零件关系表]不存在客户零件号{itm}" }); } - } - if (errorList.Count > 0) - { - return await ExportErrorReportAsync(errorList) ; - } - List ls = new List(); - if (flag == 1) - { - var pricebjlist = _pricebjRepository.ToList(); - + var errorEntitylist = await _baseDomainService.CheckPriceList(entityList, inv.Site).ConfigureAwait(false); + if (errorEntitylist.Count > 0) + { + foreach (var itm in errorEntitylist) + { + errorList.Add(new ERR_EXP_DTO() { ItemCode = $"{itm.LU}", Message = $"客户零件号{itm.LU}标识号{itm.PN}下线日期{itm.SettleDate}不存在价格单记录" }); + } + } + if (errorList.Count > 0) + { + return await ExportErrorReportAsync(errorList).ConfigureAwait(false); + } + List ls = new List(); + if (flag == 1) + { + var pricebjlist = _pricebjRepository.ToList(); - var inner = from d in p_list - join p in pricebjlist on d.LU equals p.LU - where - d.SettleDate >= p.BeginDate && d.SettleDate <= p.EndDate - select - new PUB_ADJ_DETAIL_DTO() - { - InvBillNum = d.InvBillNum, - SettleDate = d.SettleDate, - LU = d.LU, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - KeyCode = d.KeyCode, - Price = p.Price, - }; + var inner = from d in p_list + join p in pricebjlist on d.LU equals p.LU + where + d.SettleDate >= p.BeginDate && d.SettleDate <= p.EndDate + select + new PUB_ADJ_DETAIL_DTO() + { + InvBillNum = d.InvBillNum, + SettleDate = d.SettleDate, + LU = d.LU, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + KeyCode = d.KeyCode, + Price = p.Price, + }; - ls = inner.ToList(); - } - else - { - var pricelist = _priceRepository.ToList(); + ls = inner.ToList(); + } + else + { + var pricelist = _priceRepository.ToList(); - var inner = from d in p_list - join p in pricelist on d.LU equals p.LU - where - d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode== inv.Site - select new PUB_ADJ_DETAIL_DTO() - { - InvBillNum = d.InvBillNum, - SettleDate = d.SettleDate, - LU = d.LU, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - KeyCode = d.KeyCode, - Price = p.Price, - }; - ls = inner.ToList(); + var inner = from d in p_list + join p in pricelist on d.LU equals p.LU + where + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode == inv.Site + select new PUB_ADJ_DETAIL_DTO() + { + InvBillNum = d.InvBillNum, + SettleDate = d.SettleDate, + LU = d.LU, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + KeyCode = d.KeyCode, + Price = p.Price, + }; + ls = inner.ToList(); + } + return "OK"; } - return "OK" ; - } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs index 2955da47..00c38ec2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BASE_SERVICE.cs @@ -1,13 +1,9 @@ -using Shouldly; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Shouldly; using Volo.Abp.Application.Services; -using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; @@ -17,11 +13,9 @@ using Win.Sfs.SettleAccount.ExportReports; namespace Win.Sfs.SettleAccount.Bases { - - public abstract class BASE_SERVICE: ApplicationService, ITransientDependency + public abstract class BASE_SERVICE : ApplicationService, ITransientDependency { - protected readonly IExcelImportAppService _excelImportService; @@ -32,7 +26,7 @@ namespace Win.Sfs.SettleAccount.Bases protected BASE_SERVICE() { } protected BASE_SERVICE( - + IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager) @@ -42,7 +36,6 @@ namespace Win.Sfs.SettleAccount.Bases _commonManager = commonManager; } - /// /// 输出报错信息 /// @@ -65,7 +58,7 @@ namespace Win.Sfs.SettleAccount.Bases //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(errorList); + var result = await _exportImporter.ExcelExporter(errorList).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -76,7 +69,7 @@ namespace Win.Sfs.SettleAccount.Bases Name = fileName, Content = result } - ); + ).ConfigureAwait(false); return fileName; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs index fc538ad2..7d2eb6cd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/BA_SERVICE.cs @@ -1,49 +1,29 @@ -using CodeArts.Db.Lts; -using DocumentFormat.OpenXml.Bibliography; -using DocumentFormat.OpenXml.Drawing.Charts; -using DocumentFormat.OpenXml.Wordprocessing; -using EFCore.BulkExtensions; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SignalR; -using NPOI.SS.Formula.Functions; -using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; using SettleAccount.Bases; using SettleAccount.Domain.BQ; -using SettleAccount.Job.Services; -using SettleAccount.Job.Services.Report; using Shouldly; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.LinqAsync; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using TaskJob.EventArgs; -using TaskJob.Services; using Volo.Abp; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases.DomainServices; using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.Migrations; using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; @@ -60,16 +40,15 @@ namespace Win.Sfs.SettleAccount.Bases protected readonly INormalEfCoreRepository _adjRepository; protected readonly HBPO_CAN_SA_MNG _hbpoMng; protected readonly BBAC_CAN_SA_MNG _bbacMng; - protected readonly PUB_CAN_SA_MNG _pubMng; + protected readonly PUB_CAN_SA_MNG _pubMng; protected readonly INV_MNG _invMng; private readonly TaskJobService _service; private readonly BaseDomainService _baseservice; - protected BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, - + INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, @@ -105,7 +84,7 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task GenerateInvoice(List p_invs) { - var issucess=await _invMng.SetForwardState(p_invs, SettleBillState.商务已审核); + var issucess = await _invMng.SetForwardState(p_invs, SettleBillState.商务已审核).ConfigureAwait(false); if (issucess == true) { return new JsonResult(new { Code = 200, Message = "审核成功" }); @@ -121,7 +100,7 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task ReissueInvoice([FromBody] string input) { - return new JsonResult(new { Code = 200, Message = "重开成功" }); + return new JsonResult(new { Code = 200, Message = "重开成功" }); } /// /// 主表查询 @@ -132,8 +111,8 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("mainquery")] public virtual async Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input) { - var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); foreach (var itm in dtos) { @@ -150,54 +129,24 @@ namespace Win.Sfs.SettleAccount.Bases public virtual async Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input) { INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO(); - var materialList =await _baseservice.GetMaterialList(); - var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); + var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); + var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var mdtos = ObjectMapper.Map, List>(m); - var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var sdtos = ObjectMapper.Map, List>(s); if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) { - var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var AMap = ObjectMapper.Map, List>(A); var wquery = from itm in AMap - join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum - join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - from tm in temp.DefaultIfEmpty() - select - new INVOICE_WAIT_DETAIL_BBAC_DTO() - { - - PartDesc = tm == null ? string.Empty : itm.PartDesc, - InvDate = itm1.CreationTime, - RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, - Version = itm.Version, - InvbillNum = itm.InvbillNum, - InvGroupNum = itm.InvGroupNum, - LU = itm.LU, - PartCode = itm.PartCode, - PRICE = itm.PRICE, - Qty = itm.Qty, - Amt = itm.Amt, - BussiessType = itm.BussiessType, - Extend1 = itm.Extend1, - BeginDate = itm.BeginDate, - EndDate = itm.EndDate, - }; - entity.INVOICE_WAIT_DETAIL_BBAC = wquery.ToList(); - } - else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) - { - var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - var BMap = ObjectMapper.Map, List>(B); - - var wquery = from itm in BMap join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp - from tm in temp.DefaultIfEmpty() - select - new INVOICE_WAIT_DETAIL_BJ_DTO() + from tm in temp.DefaultIfEmpty() + select + new INVOICE_WAIT_DETAIL_BBAC_DTO() { + PartDesc = tm == null ? string.Empty : itm.PartDesc, InvDate = itm1.CreationTime, RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, @@ -214,35 +163,65 @@ namespace Win.Sfs.SettleAccount.Bases BeginDate = itm.BeginDate, EndDate = itm.EndDate, }; + entity.INVOICE_WAIT_DETAIL_BBAC = wquery.ToList(); + } + else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) + { + var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); + var BMap = ObjectMapper.Map, List>(B); + + var wquery = from itm in BMap + join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum + join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp + from tm in temp.DefaultIfEmpty() + select + new INVOICE_WAIT_DETAIL_BJ_DTO() + { + PartDesc = tm == null ? string.Empty : itm.PartDesc, + InvDate = itm1.CreationTime, + RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, + Version = itm.Version, + InvbillNum = itm.InvbillNum, + InvGroupNum = itm.InvGroupNum, + LU = itm.LU, + PartCode = itm.PartCode, + PRICE = itm.PRICE, + Qty = itm.Qty, + Amt = itm.Amt, + BussiessType = itm.BussiessType, + Extend1 = itm.Extend1, + BeginDate = itm.BeginDate, + EndDate = itm.EndDate, + }; entity.INVOICE_WAIT_DETAIL_BJ = wquery.ToList(); } else { - var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var wdtos = ObjectMapper.Map, List>(w); var wquery = from itm in wdtos join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum join itm2 in materialList on itm.LU equals itm2.SettleMaterialCode into temp from tm in temp.DefaultIfEmpty() - select - new INVOICE_WAIT_DETAIL_DTO() - { - PartDesc = tm == null ? string.Empty : itm.PartDesc, - InvDate = itm1.CreationTime, - RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, - Version = itm.Version, - InvbillNum = itm.InvbillNum, - InvGroupNum = itm.InvGroupNum, - LU = itm.LU, - PartCode = itm.PartCode, - PRICE = itm.PRICE, - Qty = itm.Qty, - Amt = itm.Amt, - BussiessType = itm.BussiessType, - // Extend1 = itm.Extend1, - BeginDate = itm.BeginDate, - EndDate = itm.EndDate, - }; + select + new INVOICE_WAIT_DETAIL_DTO() + { + PartDesc = tm == null ? string.Empty : itm.PartDesc, + InvDate = itm1.CreationTime, + RealInvbillNum = string.IsNullOrEmpty(itm1.RealnvBillNum) ? string.Empty : itm1.RealnvBillNum, + Version = itm.Version, + InvbillNum = itm.InvbillNum, + InvGroupNum = itm.InvGroupNum, + LU = itm.LU, + PartCode = itm.PartCode, + PRICE = itm.PRICE, + Qty = itm.Qty, + Amt = itm.Amt, + BussiessType = itm.BussiessType, + // Extend1 = itm.Extend1, + BeginDate = itm.BeginDate, + EndDate = itm.EndDate, + }; entity.INVOICE_WAIT_DETAIL = wdtos; } var notquery = from itm in sdtos @@ -270,7 +249,7 @@ namespace Win.Sfs.SettleAccount.Bases InvGroupNum = itm.InvGroupNum, SettleGroupNum = itm.SettleGroupNum }; - var adjs = await _adjRepository.GetListByFilterAsync(input.Filters); + var adjs = await _adjRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); var adjdtos = ObjectMapper.Map, List>(adjs); var adjQuery = from itm in adjdtos join itm1 in invs on itm.InvBillNum equals itm1.InvbillNum @@ -302,7 +281,7 @@ namespace Win.Sfs.SettleAccount.Bases { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); foreach (var itm in dtoDetails) { @@ -315,10 +294,10 @@ namespace Win.Sfs.SettleAccount.Bases switch (input.FileType) { case 0: - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -330,7 +309,7 @@ namespace Win.Sfs.SettleAccount.Bases Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } /// @@ -341,7 +320,7 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task RejectAsync([FromBody] string p_invGroupNum) { - bool issuc= await _invMng.Reject(p_invGroupNum); + bool issuc = await _invMng.Reject(p_invGroupNum).ConfigureAwait(false); if (issuc == true) { return new JsonResult(new { Code = 200, Message = "退回成功" }); @@ -352,45 +331,45 @@ namespace Win.Sfs.SettleAccount.Bases public virtual async Task ReceivedAsync(List p_ins) { - bool issuc = await _invMng.ReceivedAsync(p_ins); + bool issuc = await _invMng.ReceivedAsync(p_ins).ConfigureAwait(false); if (issuc == true) { return new JsonResult(new { Code = 200, Message = "收票成功" }); } - + return new JsonResult(new { Code = 400, Message = "收票失败" }); } protected virtual async Task> GetMapGroupAsync(INVOICE_GRP_REQ_DTO input) { - var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var mdtos = ObjectMapper.Map, List>(m); return mdtos; } protected virtual async Task> GetDetailAsync(INVOICE_GRP_REQ_DTO input) { - var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var wdtos = ObjectMapper.Map, List>(w); return wdtos; } protected virtual async Task> GetNotDetailAsync(INVOICE_GRP_REQ_DTO input) { - var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var sdtos = ObjectMapper.Map, List>(s); return sdtos; } - protected virtual async Task> GetNotDetailAsync( string p_invbillNum) + protected virtual async Task> GetNotDetailAsync(string p_invbillNum) { List filters = new List(); filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - return await _sRepository.GetListByFilterAsync(filters); + return await _sRepository.GetListByFilterAsync(filters).ConfigureAwait(false); } protected virtual async Task> GetAjdmentDetail(INVOICE_GRP_REQ_DTO input) { - var s = await _adjRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var s = await _adjRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var sdtos = ObjectMapper.Map, List>(s); return sdtos; } @@ -399,7 +378,7 @@ namespace Win.Sfs.SettleAccount.Bases List filters = new List(); filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - var s = await _adjRepository.GetListByFilterAsync(filters); + var s = await _adjRepository.GetListByFilterAsync(filters).ConfigureAwait(false); var sdtos = ObjectMapper.Map, List>(s); return sdtos; } @@ -408,7 +387,7 @@ namespace Win.Sfs.SettleAccount.Bases List filters = new List(); filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - var m = await _mRepository.GetListByFilterAsync(filters); + var m = await _mRepository.GetListByFilterAsync(filters).ConfigureAwait(false); var mdtos = ObjectMapper.Map, List>(m); return mdtos; } @@ -421,8 +400,8 @@ namespace Win.Sfs.SettleAccount.Bases { List filters = new List(); filters.Add(new FilterCondition("InvBillNum", p_invbillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - var ls = await _repository.GetListByFilterAsync(filters); - if (ls != null && ls.Count() > 0) + var ls = await _repository.GetListByFilterAsync(filters).ConfigureAwait(false); + if (ls != null && ls.Count > 0) { return ls.FirstOrDefault(); @@ -430,16 +409,16 @@ namespace Win.Sfs.SettleAccount.Bases return null; } - /// - /// hbpo、jit、备件等 - /// - /// 可结算明细列表 - /// 版本号 - /// 发票分组 - /// 原发票号 - protected async Task ReissueSecInvoice(List p_list, List p_adjlist,List p_tmplist, int p_version, string p_parentInvBillNum) where TDetail : SA_CAN_BASE + /// + /// hbpo、jit、备件等 + /// + /// 可结算明细列表 + /// 版本号 + /// 发票分组 + /// 原发票号 + protected async Task ReissueSecInvoice(List p_list, List p_adjlist, List p_tmplist, int p_version, string p_parentInvBillNum) where TDetail : SA_CAN_BASE { - var flag=await _invMng.ReissueSecInvoice(p_list,p_adjlist, p_tmplist, p_parentInvBillNum, p_version); + var flag = await _invMng.ReissueSecInvoice(p_list, p_adjlist, p_tmplist, p_parentInvBillNum, p_version).ConfigureAwait(false); if (flag) { return true; @@ -447,7 +426,6 @@ namespace Win.Sfs.SettleAccount.Bases throw new BusinessException("8989", "生成失败,请检查调发票整表和旧发票内容"); - } [UnitOfWork(false)] /// @@ -460,14 +438,14 @@ namespace Win.Sfs.SettleAccount.Bases /// 要作废的发票号 /// /// - protected async Task ReissueFirstInvoice(List p_list,List p_adjlist, List dtos, int p_version, string p_parentInvBillNum) where TDetail : SA_CAN_BASE + protected async Task ReissueFirstInvoice(List p_list, List p_adjlist, List dtos, int p_version, string p_parentInvBillNum) where TDetail : SA_CAN_BASE { - var flag = await _invMng.ReissueFirstInvoice(p_list,p_adjlist,dtos, p_parentInvBillNum, p_version); - if (flag==true) + var flag = await _invMng.ReissueFirstInvoice(p_list, p_adjlist, dtos, p_parentInvBillNum, p_version).ConfigureAwait(false); + if (flag == true) { return true; } - throw new BusinessException("8989", "生成失败,请检查调整表和旧发票内容"); + throw new BusinessException("8989", "生成失败,请检查调整表和旧发票内容"); } [UnitOfWork(false)] /// @@ -479,15 +457,14 @@ namespace Win.Sfs.SettleAccount.Bases /// 原发票号 protected async Task> ReissueSecInvoiceExtend(List p_list, List p_adjlist, List p_tmplist, int p_version, string p_parentInvBillNum) where TDetail : SA_CAN_BASE { - var ls = await _invMng.ReissueSecInvoiceExtend(p_list, p_adjlist, p_tmplist, p_parentInvBillNum, p_version); - if (ls.Count>0) + var ls = await _invMng.ReissueSecInvoiceExtend(p_list, p_adjlist, p_tmplist, p_parentInvBillNum, p_version).ConfigureAwait(false); + if (ls.Count > 0) { return ls; } throw new BusinessException("8989", "生成失败,请检查调发票整表和旧发票内容"); - } [UnitOfWork(false)] /// @@ -502,8 +479,8 @@ namespace Win.Sfs.SettleAccount.Bases /// protected async Task> ReissueFirstInvoiceExtend(List p_list, List p_adjlist, List dtos, int p_version, string p_parentInvBillNum) where TDetail : SA_CAN_BASE { - var ls = await _invMng.ReissueFirstInvoiceExtend(p_list, p_adjlist, dtos, p_parentInvBillNum, p_version); - if (ls.Count>0) + var ls = await _invMng.ReissueFirstInvoiceExtend(p_list, p_adjlist, dtos, p_parentInvBillNum, p_version).ConfigureAwait(false); + if (ls.Count > 0) { return ls; } @@ -511,9 +488,6 @@ namespace Win.Sfs.SettleAccount.Bases } - - - /// /// 检查是否有重复 /// @@ -533,7 +507,6 @@ namespace Win.Sfs.SettleAccount.Bases return errors; } - /// /// 校验规则 /// @@ -542,14 +515,14 @@ namespace Win.Sfs.SettleAccount.Bases /// protected async Task> CheckInvoiceGenerationRules(List dto1s, List p_pricelist, EnumBusinessType p_businessType) where T : SA_CAN_BASE { - var first= dto1s.FirstOrDefault(); + var first = dto1s.FirstOrDefault(); var usepriceList = p_pricelist.Where(p => p.ClientCode == first.Site && p.IsCancel == false).ToList(); - var errorlist= _baseservice.CheckPriceListContinuity(usepriceList); - + var errorlist = _baseservice.CheckPriceListContinuity(usepriceList); + var inner = from d in dto1s join p in p_pricelist on d.LU equals p.LU where - d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && d.Site==p.ClientCode && p.IsCancel==false + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && d.Site == p.ClientCode && p.IsCancel == false select d; var left = from d in dto1s join p in inner on new { d.LU, d.PN } equals new { p.LU, p.PN } @@ -597,8 +570,6 @@ namespace Win.Sfs.SettleAccount.Bases errorList.Add(new ERR_EXP_DTO() { ItemCode = error.LU, CustomCode = $"{name}", Message = $"LU:{error.LU},价格表开始日期:{error.BeginTime}价格表结束日期:{error.EndTime}在用价格时间段有交集或价格时间不连续!" }); } - - foreach (var error in left) { errorList.Add(new ERR_EXP_DTO() { ItemCode = error.LU, CustomCode = $"{name}", Message = $"LU:{error.LU}{keyname}:{error.PN},下线日期:{error.SettleDate}没有对应区间销售价格表!" }); @@ -606,5 +577,5 @@ namespace Win.Sfs.SettleAccount.Bases return errorList; } } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs index 78d11d5b..6143dcf2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CAN_SA_SERVICE.cs @@ -1,50 +1,35 @@ -using AutoMapper; -using DocumentFormat.OpenXml.Vml.Office; -using EFCore.BulkExtensions; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using NUglify.JavaScript.Syntax; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using Shouldly; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; -using Volo.Abp.ObjectMapping; -using Volo.Abp.TenantManagement.EntityFrameworkCore; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases.DomainServices; using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; -using Win.Sfs.SettleAccount.Entities.BQ; -using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; -using static Win.Sfs.SettleAccount.SettleAccountPermissions; namespace Win.Sfs.SettleAccount.Bases { public abstract class CAN_SA_SERVICE : BASE_SERVICE where TEntity : SA_CAN_BASE_MAIN - where TEntityDetail:SA_CAN_BASE + where TEntityDetail : SA_CAN_BASE where TEntityDto : class, IEntityDto, new() where TEntityDetailDto : class, IEntityDto, new() where TRequestMainInput : RequestInputBase @@ -53,7 +38,7 @@ namespace Win.Sfs.SettleAccount.Bases { protected readonly INormalEfCoreRepository _repository; protected readonly INormalEfCoreRepository _detailRepository; - private readonly IExcelImportAppService _excelImportService; + private readonly IExcelImportAppService _excelImportService; protected readonly INV_MNG _invmng; private readonly BaseDomainService _baseservice; protected CAN_SA_SERVICE( @@ -83,16 +68,12 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("detailquery")] public virtual async Task> DetailQueryAsync(TRequestDetailInput input) { - var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters); + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); } - - - - /// /// 导出 @@ -106,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Bases IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute()?.Name ?? typeof(TEntityDetailExportDto).Name; @@ -116,10 +97,10 @@ namespace Win.Sfs.SettleAccount.Bases switch (input.FileType) { case 0: - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -131,7 +112,7 @@ namespace Win.Sfs.SettleAccount.Bases Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } ///// @@ -156,8 +137,8 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("mainquery")] public virtual async Task> MainQueryAsync(TRequestMainInput input) { - var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); } @@ -169,7 +150,7 @@ namespace Win.Sfs.SettleAccount.Bases /// 版本号 /// 发票分组 /// 原发票号 - protected async Task SecInvoice(List p_list,List p_adjlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum,EnumBusinessType businessType) where TDetail : SA_CAN_BASE + protected async Task SecInvoice(List p_list, List p_adjlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE { List invlist = new List(); @@ -177,28 +158,28 @@ namespace Win.Sfs.SettleAccount.Bases switch (businessType) { case EnumBusinessType.MaiDanJianHBPO: - invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType, false); + invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType, false).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianBBAC: - invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType, false); + invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType, false).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false);//重开可以变多张发票 + invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.ZhiGongJianHBPO: - invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false);//重开可以变多张发票 + invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.BeiJian: - invlist = await _invmng.BJInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false); + invlist = await _invmng.BJInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - invlist = await _invmng.SecInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType); + invlist = await _invmng.SecInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType).ConfigureAwait(false); break; case EnumBusinessType.JisHBPO: - invlist = await _invmng.SecInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType); + invlist = await _invmng.SecInvoice(p_list, p_adjlist, dtos, p_version, p_InvGroupNum, string.Empty, businessType).ConfigureAwait(false); break; case EnumBusinessType.YinDuJian: - invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false);//重开可以变多张发票 + invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, p_InvGroupNum, string.Empty, businessType, false).ConfigureAwait(false);//重开可以变多张发票 break; } //var ls= await _invmng.SecInvoice(p_list,p_adjlist,p_tmplist,p_version, p_InvGroupNum, p_parentInvBillNum, businessType); @@ -220,34 +201,34 @@ namespace Win.Sfs.SettleAccount.Bases /// /// /// - protected async Task FirstInvoice(List p_list,List p_adjlist ,List dtos, List p_notlist, int p_version, string p_invGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE + protected async Task FirstInvoice(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_invGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE { List invlist = new List(); switch (businessType) { case EnumBusinessType.MaiDanJianHBPO: - invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true); + invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianBBAC: - invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true); + invlist = await _invmng.MakeInvoice(p_list, p_adjlist, dtos, p_version, p_invGroupNum, string.Empty, businessType, true).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true);//重开可以变多张发票 + invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.ZhiGongJianHBPO: - invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true);//重开可以变多张发票 + invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.BeiJian: - invlist = await _invmng.BJInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true); + invlist = await _invmng.BJInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - invlist = await _invmng.FirstInvoice(p_list, p_adjlist, dtos,p_notlist , p_version, p_invGroupNum, string.Empty, businessType);//重开可以变多张发票 + invlist = await _invmng.FirstInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.JisHBPO: - invlist = await _invmng.FirstInvoice(p_list, p_adjlist, dtos,p_notlist, p_version, p_invGroupNum, string.Empty, businessType);//重开可以变多张发票 + invlist = await _invmng.FirstInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.YinDuJian: - invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true);//重开可以变多张发票 + invlist = await _invmng.JITInvoice(p_list, p_adjlist, dtos, p_notlist, p_version, p_invGroupNum, string.Empty, businessType, true).ConfigureAwait(false);//重开可以变多张发票 break; } if (invlist.Count > 0) @@ -263,7 +244,7 @@ namespace Win.Sfs.SettleAccount.Bases /// /// /// - protected async Task> CheckInvoiceGenerationRules(List dto1s,string p_site, List p_pricelist,EnumBusinessType p_businessType) where T : SA_CAN_BASE + protected async Task> CheckInvoiceGenerationRules(List dto1s, string p_site, List p_pricelist, EnumBusinessType p_businessType) where T : SA_CAN_BASE { //var maxDate = p_pricelist.Max(p => p.Date); @@ -272,12 +253,12 @@ namespace Win.Sfs.SettleAccount.Bases var usepriceList = p_pricelist.Where(p => p.ClientCode == first.Site && p.IsCancel == false).ToList(); var errorlist = _baseservice.CheckPriceListContinuity(usepriceList); - var prices = p_pricelist.Where(p =>p.ClientCode==p_site && p.IsCancel == false).ToList(); + var prices = p_pricelist.Where(p => p.ClientCode == p_site && p.IsCancel == false).ToList(); var inner = from d in dto1s join p in prices on d.LU equals p.LU where - d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode==d.Site && p.IsCancel == false + d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode == d.Site && p.IsCancel == false select d; var ls = inner.ToList(); var left = from d in dto1s @@ -287,8 +268,7 @@ namespace Win.Sfs.SettleAccount.Bases where tm == null select d; - - List errorList = new List (); + List errorList = new List(); string name = string.Empty; string keyname = string.Empty; switch (p_businessType) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs index a60609ab..08a22bc9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/CurdBaseAppService.cs @@ -1,14 +1,14 @@ -using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Shouldly; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Reflection; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Entities; @@ -41,7 +41,7 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost("import-template")] public virtual async Task ImportTemplateAsync() { - await Task.CompletedTask; + await Task.CompletedTask.ConfigureAwait(false); return new Microsoft.AspNetCore.Mvc.OkResult(); } @@ -52,7 +52,7 @@ namespace Win.Sfs.SettleAccount.Bases [Route("Import")] public virtual async Task ImportAsync([FromForm] IFormFileCollection files, string version) { - await Task.CompletedTask; + await Task.CompletedTask.ConfigureAwait(false); return ApplicationConsts.SuccessStr; } @@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Bases IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); var classDisplayName = typeof(TExportDto).GetCustomAttribute()?.Name ?? typeof(TExportDto).Name; @@ -76,10 +76,10 @@ namespace Win.Sfs.SettleAccount.Bases switch (input.FileType) { case 0: - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -91,7 +91,7 @@ namespace Win.Sfs.SettleAccount.Bases Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } #endregion @@ -115,8 +115,8 @@ namespace Win.Sfs.SettleAccount.Bases [Route("list")] public virtual async Task> GetListAsync(TRequestInput input) { - var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); } @@ -126,9 +126,9 @@ namespace Win.Sfs.SettleAccount.Bases /// [HttpDelete] [Route("{id}")] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -136,9 +136,9 @@ namespace Win.Sfs.SettleAccount.Bases /// [HttpPost] [Route("delete")] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } #endregion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs index 6e15b771..db6f306b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/NOT_SA_SERVICE.cs @@ -1,27 +1,18 @@ -using AutoMapper; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Reflection; +using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Mvc; using SettleAccount.Bases; using Shouldly; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; -using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.ExcelImporter; -using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Bases @@ -37,12 +28,12 @@ namespace Win.Sfs.SettleAccount.Bases IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, - + INormalEfCoreRepository detailRepository ) : base(excelImportService, snowflakeIdGenerator, commonManager) { - _detailRepository=detailRepository; + _detailRepository = detailRepository; } /// @@ -54,8 +45,8 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("detailquery")] public virtual async Task> DetailQueryAsync(TRequestDetailInput input) { - var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters); + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); } @@ -70,7 +61,7 @@ namespace Win.Sfs.SettleAccount.Bases { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute()?.Name ?? typeof(TEntityDetailExportDto).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; @@ -79,10 +70,10 @@ namespace Win.Sfs.SettleAccount.Bases switch (input.FileType) { case 0: - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -94,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Bases Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } /// @@ -105,19 +96,9 @@ namespace Win.Sfs.SettleAccount.Bases [HttpPost] public virtual async Task GenerateSettlementOrder(TRequestDetailInput input) { - return new JsonResult(new { Code = 200, Message = "生成成功" }); + return new JsonResult(new { Code = 200, Message = "生成成功" }); } - - } - - - + } - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs index 0b9861c3..6cdf9052 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Bases/PD_SERVICE.cs @@ -1,39 +1,22 @@ -using AutoMapper; -using DocumentFormat.OpenXml.Bibliography; -using DocumentFormat.OpenXml.Drawing.Charts; -using DocumentFormat.OpenXml.Office2010.Excel; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using NPOI.HPSF; -using NPOI.OpenXmlFormats.Spreadsheet; -using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; using SettleAccount.Bases; using Shouldly; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using TaskJob.EventArgs; -using TaskJob.Services; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ; -using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -using Win.Sfs.SettleAccount.Entities.BQ.Vmi; -using Win.Sfs.SettleAccount.ExcelImporter; -using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Bases @@ -51,18 +34,15 @@ namespace Win.Sfs.SettleAccount.Bases protected readonly INormalEfCoreRepository _repository; protected readonly INormalEfCoreRepository _detailRepository; - protected readonly INormalEfCoreRepository _bbacSecRepository; protected readonly INormalEfCoreRepository _hbpoSecRepository; protected readonly INormalEfCoreRepository _pubSecRepository; - - public PD_SERVICE( INormalEfCoreRepository bbacSecRepository, INormalEfCoreRepository hbpoSecRepository, - INormalEfCoreRepository pubSecRepository, + INormalEfCoreRepository pubSecRepository, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, @@ -71,15 +51,14 @@ namespace Win.Sfs.SettleAccount.Bases INormalEfCoreRepository detailRepository ) : base(excelImportService, snowflakeIdGenerator, commonManager) { - _vimservice = vimservice; + _vimservice = vimservice; _repository = repository; _detailRepository = detailRepository; - _bbacSecRepository=bbacSecRepository; - _pubSecRepository=pubSecRepository; - _hbpoSecRepository=hbpoSecRepository; + _bbacSecRepository = bbacSecRepository; + _pubSecRepository = pubSecRepository; + _hbpoSecRepository = hbpoSecRepository; } - /// /// 查询明细 /// @@ -89,9 +68,9 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("detailquery")] public virtual async Task> DetailQueryAsync(TRequestDetailInput input) { - - var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters); + + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _detailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); @@ -107,7 +86,7 @@ namespace Win.Sfs.SettleAccount.Bases { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); var classDisplayName = typeof(TEntityDetailExportDto).GetCustomAttribute()?.Name ?? typeof(TEntityDetailExportDto).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; @@ -116,10 +95,10 @@ namespace Win.Sfs.SettleAccount.Bases switch (input.FileType) { case 0: - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -131,7 +110,7 @@ namespace Win.Sfs.SettleAccount.Bases Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } [HttpPost] @@ -149,8 +128,8 @@ namespace Win.Sfs.SettleAccount.Bases //[Route("mainquery")] public virtual async Task> MainQueryAsync(TRequestMainInput input) { - var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); return new PagedResultDto(totalCount, dtos); } @@ -166,25 +145,13 @@ namespace Win.Sfs.SettleAccount.Bases } protected virtual async Task GetMainAsync([FromBody] string billNum) { - return await _repository.Where(p=>p.InvGroupNum == billNum).FirstOrDefaultAsync(); + return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync().ConfigureAwait(false); } protected virtual async Task> GetDetailAsync([FromBody] string billNum) { - return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync(); + return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false); } - - - - - - - - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs index dfac17d6..34c02f83 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/ApplicationConsts.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.SettleAccount.Constant { @@ -14,8 +10,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string DefaultExportFileName = "导出文件"; - - /// /// 标准结算总成散件明细输出表 /// @@ -31,7 +25,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string Sec_StandSumFileName = "标准二配汇总统计表"; - /// /// 实际结算总成散件明细输出表 /// @@ -47,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string Sec_ActualSumFileName = "实际二配汇总统计表"; - /// /// 实际调整后输出表 /// @@ -63,27 +55,21 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string Sec_AddUpDiffFileName = "二配累计差异统计表"; - /// /// 二配结算打印版 /// public const string Sec_DistributionFileName = "二配结算打印输出表"; - - /// /// FIS发出未结算输出表 /// public const string SendUnsettledDiffReportFileName = "FIS发出未结算统计表"; - - /// /// 暂估对比输出表 /// public const string EstimatedStockDiffReportFileName = "暂估对比统计表"; - /// /// FIS未结数量与期末库存对比输出表 /// @@ -94,19 +80,16 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string StockSettledDiffReportFileName = "结算数据对比统计表"; - /// /// FIS发运数据对比输出表 /// public const string StockFisDiffReportFileName = "发运数据对比统计表"; - /// /// 校验错误信息汇总表 /// public const string CheckErroFileName = "校验错误信息汇总表"; - /// /// Success /// @@ -127,13 +110,11 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string Doc_Bill_Header_FUD = "FUD"; - /// /// 暂估对比输出表 /// public const string Doc_Bill_Header_ESD = "ESD"; - /// /// FIS未结数量与期末库存对比输出表 /// @@ -144,7 +125,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string Doc_Bill_Header_SSD = "SSD"; - /// /// FIS发运数据对比输出表 /// @@ -160,7 +140,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string Doc_Bill_Header_Sec_AD = "SAD"; - /// /// 文件后缀 /// @@ -201,7 +180,7 @@ namespace Win.Sfs.SettleAccount.Constant /// /// 解放结算信息 /// - public const string Sec_JFCarConsignFileName = "解放结算信息"; + public const string Sec_JFCarConsignFileName = "解放结算信息"; /// /// 解放看板信息 @@ -213,7 +192,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string BT_CarSeqKBDiffReportFileName = "轿车车序与看板差异输出表"; - /// /// 解放车序与看板差异输出表 /// @@ -229,7 +207,6 @@ namespace Win.Sfs.SettleAccount.Constant /// public const string HQ_NotConsignReportFileName = "红旗发出未结算统计表"; - /// /// 轿车发出未结算统计表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/CommonMethod.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/CommonMethod.cs index 4181e94b..30942868 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/CommonMethod.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Constant/CommonMethod.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; namespace Win.Sfs.SettleAccount.Constant { @@ -19,7 +15,6 @@ namespace Win.Sfs.SettleAccount.Constant return $"{header}_{DateTime.Now.ToString("yyyyMMdd")}_{num}"; } - /// /// 获得导出文件名称 /// @@ -32,8 +27,6 @@ namespace Win.Sfs.SettleAccount.Constant return $"{fileName}_{version}{fileExtension}"; } - - /// /// 获得导出文件名称 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs index f11c3acb..96a94d89 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_BA_SERVICE.cs @@ -1,23 +1,13 @@ -using DocumentFormat.OpenXml.Drawing.Charts; -using DocumentFormat.OpenXml.Spreadsheet; -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.EntityFrameworkCore; -using NetTaste; -using NPOI.HPSF; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; -using System.Security.Policy; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.Application.Services; -using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -30,7 +20,6 @@ using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -41,13 +30,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class BBAC_BA_SERVICE : BA_SERVICE { - + private readonly INormalEfCoreRepository _priceRepository; private readonly ADJ_SERVICE _adjservice; public BBAC_BA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, - + INormalEfCoreRepository repository, INormalEfCoreRepository wRepository, INormalEfCoreRepository sRepository, @@ -81,8 +70,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _adjservice = adjservice; } - - /// /// 发票重开 /// @@ -90,16 +77,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public override async Task ReissueInvoice([FromBody] string p_invbillnum) { - + var version = int.Parse(DateTime.Now.ToString("yyyymm")); - - var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum); - var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum); + var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); + + var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { - throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!","400"); + throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不在请检查!", "400"); } version = settle.Version; if (inv != null) @@ -112,9 +99,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{p_invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!", "400"); } - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 + var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync().ConfigureAwait(false);//调整表明细 + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -145,22 +132,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.Where(p=>p.IsCancel==false).ToList();//价格单 + var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 - // priceList.GroupBy(p => new { p.BeginTime, p.EndTime }).Select(p => p.First()); + // priceList.GroupBy(p => new { p.BeginTime, p.EndTime }).Select(p => p.First()); - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - if (errorList.Count() > 0) + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode,Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && d.Site==p.ClientCode && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && d.Site == p.ClientCode && p.IsCancel == false && p.ClientCode == inv.Site//客户零件号 select new TEMP_CAN_SA_DETAIL { Id = d.Id, @@ -188,11 +174,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - await ReissueFirstInvoice(bbaclist, adjlist, dtos, version, p_invbillnum); + await ReissueFirstInvoice(bbaclist, adjlist, dtos, version, p_invbillnum).ConfigureAwait(false); } else//二次开票 { - await ReissueSecInvoice(bbaclist, adjlist, dtos, version, p_invbillnum); + await ReissueSecInvoice(bbaclist, adjlist, dtos, version, p_invbillnum).ConfigureAwait(false); } } } @@ -205,7 +191,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return new JsonResult(new { Code = 200, Message = "重开成功" }); + return new JsonResult(new { Code = 200, Message = "重开成功" }); } [HttpPost] @@ -215,12 +201,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - public virtual async Task ReissueInvoiceExtend(List p_list) + public virtual async Task ReissueInvoiceExtend(List p_list) { - var errorlist = await CheckRepeat(p_list);//是否录入数据重复 + var errorlist = await CheckRepeat(p_list).ConfigureAwait(false);//是否录入数据重复 if (errorlist.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); } var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) @@ -229,111 +215,111 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; - var version=int.Parse(DateTime.Now.ToString("yyyymm")); - var inv= await GetInvoiceGroupByInvBillNum(invbillnum); - var settle =await _bbacMng.GetMainAsync(inv.InvGroupNum); - if(settle==null) + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); + var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不粗拿在在请检查!", "400"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) { - throw new UserFriendlyException( $"选择发票:{invbillnum}对应的可结算单不粗拿在在请检查!", "400"); + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); } - version=settle.Version; - if (inv != null) + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) { - if (inv.InvoiceState == InvoiceBillState.报废) - { - throw new UserFriendlyException( $"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); - } - if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!", "400"); + } + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//发票对应结算零件 + // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count > 0) + { + foreach (var itm in adjlist) { - throw new UserFriendlyException( $"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!", "400"); + bbaclist.Add(new BBAC_CAN_SA_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + category: itm.BusinessType, + isReturn: itm.Qty > 0 ? false : true, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + contactid: itm.Extend1,//生产号 + invbillnum: string.Empty, + partcode: itm.PartCode + )); } - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//发票对应结算零件 - // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) - { - foreach (var itm in adjlist) + } + var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); + //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 + var priceList = _priceRepository.Where(p => p.ClientCode == inv.Site && p.IsCancel == false).ToList();//价格单 + //var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + //if (errorList.Count() > 0) + //{ + //return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + //} + var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in dto1s + join p in priceList on d.LU equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode == inv.Site && p.IsCancel == false//客户零件号 + select new TEMP_CAN_SA_DETAIL { - bbaclist.Add(new BBAC_CAN_SA_DETAIL( - guid: itm.Id, - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvGroupNum, - settleBillNum: itm.SettleBillNum, - lU: itm.LU, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - price: itm.Price, - category: itm.BusinessType, - isReturn: itm.Qty > 0 ? false : true, - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, - contactid: itm.Extend1,//生产号 - invbillnum:string.Empty, - partcode:itm.PartCode - )); - } + Id = d.Id, + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = d.ContractDocID, + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode + + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 + { + await ReissueFirstInvoice(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); } - var entitys = bbaclist;//合并库存调整单和就发票可结算明细数据 - var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); - //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.Where(p => p.ClientCode == inv.Site && p.IsCancel == false).ToList();//价格单 - //var errorList =await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - //if (errorList.Count() > 0) - //{ - //return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); - //} - var dto1s = ObjectMapper.Map, List>(entitys); - var q = from d in dto1s - join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.ClientCode==inv.Site && p.IsCancel==false//客户零件号 - select new TEMP_CAN_SA_DETAIL - { - Id=d.Id, - SettleBillNum = d.SettleBillNum, - Site = d.Site, - Version = d.Version, - Price = p.Price, - BillNum = d.BillNum, - SettleDate = d.SettleDate, - InvGroupNum = d.InvGroupNum, - LU = d.LU, - MaterialDesc = d.MaterialDesc, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - Amt = Math.Round(d.Qty * p.Price, 2), - ContractDocID = d.ContractDocID, - BeginDate = p.BeginTime, - EndDate = p.EndTime, - PartCode= d.PartCode - - }; - var dtos = q.ToList(); - if (dtos != null && dtos.Count > 0) + else//二次开票 { - if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 - { - await ReissueFirstInvoice(bbaclist,adjlist,dtos,version, invbillnum); - } - else//二次开票 - { - await ReissueSecInvoice(bbaclist,adjlist,dtos,version, invbillnum); - } + await ReissueSecInvoice(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); } } - else - { - throw new UserFriendlyException( $"不存发票号为:{invbillnum}发票", "400"); - } + } + else + { + throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); + } //} //else //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return new JsonResult(new { Code = 200, Message = "重开成功" }); ; + return new JsonResult(new { Code = 200, Message = "重开成功" }); ; } [HttpPost] @@ -346,15 +332,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public virtual async Task ReissueInvoiceList(List p_list) { - var result =await _adjservice.CheckImport(p_list); - if(result != "OK") + var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); + if (result != "OK") { - return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName =result }); + return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); } var invBilllist = new List(); - var adjlist=ObjectMapper.Map, List>(p_list); - if (adjlist == null && adjlist.Count==0) + var adjlist = ObjectMapper.Map, List>(p_list); + if (adjlist == null && adjlist.Count == 0) { throw new UserFriendlyException($"调整表无数据!", "400"); } @@ -363,17 +349,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var mappingList = await GetMapGroupAsync(invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ - var version = int.Parse(DateTime.Now.ToString("yyyymm")); - //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); - var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum); + var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); - if (settle == null) - { - throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); - } - version = settle.Version; + if (settle == null) + { + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); + } + version = settle.Version; if (inv != null) { if (inv.InvoiceState == InvoiceBillState.报废) @@ -384,9 +370,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -450,14 +436,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); invBilllist.AddRange(ls); - + } else//二次开票 { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); invBilllist.AddRange(ls); } @@ -468,9 +454,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } } - var als= invBilllist.Where(p => string.IsNullOrEmpty(p.PartCode)).ToList(); - var invlist=invBilllist.OrderBy(p => p.PartCode).ToList(); - return new JsonResult(new { Code = 200, Data= invlist }); + var als = invBilllist.Where(p => string.IsNullOrEmpty(p.PartCode)).ToList(); + var invlist = invBilllist.OrderBy(p => p.PartCode).ToList(); + return new JsonResult(new { Code = 200, Data = invlist }); } @@ -497,9 +483,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); - var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum); + var settle = await _bbacMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { @@ -516,8 +502,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var bbaclist = await _bbacMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -577,7 +563,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); if (ls.Count > 0) { @@ -587,7 +573,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var invBill = new INVOICE_REPEAT_DTO(); var invls = ls.Where(p => p.InvbillNum == itm).ToList(); var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); - var tax = inv.Tax==0?0.13m:inv.Tax;//税率 + var tax = inv.Tax == 0 ? 0.13m : inv.Tax;//税率 var amt = entitylist.Sum(p => p.Amt);//税前 var taxamt = amt + Math.Round(amt * tax, 2);//税后 var realamt = Math.Round(amt * tax, 2);//税额 @@ -603,7 +589,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else//二次开票 { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) @@ -611,7 +597,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var invBill = new INVOICE_REPEAT_DTO(); var invls = ls.Where(p => p.InvbillNum == itm).ToList(); var entitylist = entities.Where(p => p.InvbillNum == itm).ToList(); - var tax = inv.Tax==0?0.13m:inv.Tax;//税率 + var tax = inv.Tax == 0 ? 0.13m : inv.Tax;//税率 var amt = entitylist.Sum(p => p.Amt);//税前 var taxamt = amt + Math.Round(amt * tax, 2);//税后 var realamt = Math.Round(amt * tax, 2);//税额 @@ -637,19 +623,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //} return new JsonResult(new { Code = 200, Data = invBilllist }); - - } - - - - - - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs index 50358f32..b0354e8f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_CAN_SA_SERVICE.cs @@ -1,38 +1,24 @@ -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Mvc; -using NPOI.SS.Formula.Functions; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Finance; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; -using SettleAccount.Domain.BQ; using System; using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.ObjectMapping; +using LinqToDB; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; +using Volo.Abp.Uow; +using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.SettleAccount.Bases.DomainServices; +using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; -using Win.Sfs.Shared.RepositoryBase; -using System.Text.Json; -using Newtonsoft.Json; -using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.ExportReports; -using Microsoft.EntityFrameworkCore.Migrations; -using Win.Abp.Snowflakes; -using Win.Sfs.SettleAccount.CommonManagers; -using Volo.Abp; using Win.Sfs.SettleAccount.Entities.BQ.Temp; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Bases.DomainServices; -using LinqToDB; +using Win.Sfs.SettleAccount.Entities.Prices; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -70,52 +56,49 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BBAC_CAN_SA_MNG bbacMng, BaseDomainService baseservice ) - : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng,baseservice) + : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) { _notRepository = notRepository; _bbacMng = bbacMng; _priceRepository = priceRepository; } - /// /// 生成发票 /// /// /// - [UnitOfWork(false)] + [UnitOfWork(false)] [HttpPost] - - public async Task GenerateInvoice([FromBody] string invbillNum) + + public async Task GenerateInvoice([FromBody] string invbillNum) { - var main =await _bbacMng.GetMainAsync(invbillNum); + var main = await _bbacMng.GetMainAsync(invbillNum).ConfigureAwait(false); if (main != null) { if (main.State != SettleBillState.未结状态) { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } - var entitys = await _bbacMng.GetDetalListAsync(invbillNum);//可结算 + var entitys = await _bbacMng.GetDetalListAsync(invbillNum).ConfigureAwait(false);//可结算 var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); //价格单 - var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 - if (errorList.Count() > 0) + var errorList = await CheckInvoiceGenerationRules(entitys, main.Site, priceList, main.BusinessType).ConfigureAwait(false);//校验生成规则 + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } - if (await _bbacMng.SetForwardState(main, SettleBillState.已开票)) - { + if (await _bbacMng.SetForwardState(main, SettleBillState.已开票).ConfigureAwait(false)) + { var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - - - var notQuery =await _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToListAsync(); + var notQuery = await _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToListAsync().ConfigureAwait(false); var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode ==main.Site + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == main.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, @@ -158,14 +141,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ SettleDate = p.SettleDate, GroupNum = p.GroupNum, ContractDocID = string.Empty, - PartCode=p.PartCode - + PartCode = p.PartCode + }).ToList();//不能结算 - await FirstInvoice(entitys,new List(),dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); + await FirstInvoice(entitys, new List(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); } else//二次开票 { - await SecInvoice(entitys,new List(),dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); + await SecInvoice(entitys, new List(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); } } } @@ -174,7 +157,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { return new JsonResult(new { Code = 400, Message = "不存在可结算单记录" }); } - return new JsonResult(new { Code = 200, Message = "生成成功" }); + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs index 7a173b52..fb944620 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_NOT_SA_SERVICE.cs @@ -1,16 +1,9 @@ -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using NetTaste; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Repositories; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -47,26 +40,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public override async Task GenerateSettlementOrder(BBAC_NOT_SA_DETAIL_REQ_DTO input) { List errorlist = new List(); - var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - if (entitys == null ) + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); + if (entitys == null) { errorlist.Add(new ERR_EXP_DTO() { Message = "查询条件无记录" }); } else { - var errors = await _bbacNotMng.GenerateSettlementOrder(entitys); + var errors = await _bbacNotMng.GenerateSettlementOrder(entitys).ConfigureAwait(false); if (errors.Count > 0) { foreach (var itm in errors) { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); } } - return new JsonResult(new { Code = 200, Message = "生成成功" }); + return new JsonResult(new { Code = 200, Message = "生成成功" }); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs index 9f22e696..cc2ec50d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_PD_SERVICE.cs @@ -1,29 +1,23 @@ -using Microsoft.AspNetCore.Authorization; -//using Microsoft.AspNetCore.Components; -using SettleAccount.Domain.BQ; -using SettleAccount.Job.Services.Report; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +//using Microsoft.AspNetCore.Components; +using SettleAccount.Domain.BQ; using TaskJob.EventArgs; -using Volo.Abp.Application.Services; +using Volo.Abp; +using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -using Win.Sfs.SettleAccount.Entities.BQ.Vmi; -using Win.Sfs.Shared.RepositoryBase; using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Volo.Abp.Uow; -using Volo.Abp; -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Mvc; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -52,12 +46,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); List customConditionList = new List(); - customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value =string.Join(",",p_list) }); + customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value = string.Join(",", p_list) }); customConditionList.Add(new CustomCondition() { Name = "Type", Value = EnumBusinessType.JisBBAC.ToString() }); - customConditionList.Add(new CustomCondition() { Name = "IsOut", Value ="out"}); + customConditionList.Add(new CustomCondition() { Name = "IsOut", Value = "out" }); var ls = _repository.Where(p => p_list.Contains(p.BillNum)).ToList(); var lst = ls.Where(p => (p.State == SettleBillState.已提交扣减 || p.State == SettleBillState.已扣减)); - if (lst.Count() > 0) + if (lst.Any()) { throw new UserFriendlyException("当前状态是已提交状态,不能重复已提交", "400"); } @@ -65,11 +59,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { item.State = SettleBillState.已提交扣减; } - await _repository.DbContext.BulkUpdateAsync(ls); + await _repository.DbContext.BulkUpdateAsync(ls).ConfigureAwait(false); var _taskid = await _service.ExportEnqueueAsync("BBAC待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => { - }); - + }).ConfigureAwait(false); + return _taskid; } //[HttpPost] @@ -98,6 +92,5 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //} - } -} +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs index af0c9647..6b5e0585 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_DETAIL_SERVICE.cs @@ -15,67 +15,68 @@ using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// BBAC结算明细 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class BBAC_SA_DETAIL_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// BBAC结算明细仓储 - /// - private readonly INormalEfCoreRepository _bbacSaDetailRepository; - - /// - /// 构造 + /// BBAC结算明细 /// - public BBAC_SA_DETAIL_SERVICE(INormalEfCoreRepository bbacSaDetailRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class BBAC_SA_DETAIL_SERVICE : SettleAccountApplicationBase { - _bbacSaDetailRepository = bbacSaDetailRepository; - } + /// + /// BBAC结算明细仓储 + /// + private readonly INormalEfCoreRepository _bbacSaDetailRepository; - #region 导出 - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(BBAC_SA_DETAIL_EXPORT_REQUEST_DTO input) - { - string fileName = $"JisBBAC的结算数据_{Guid.NewGuid()}.xlsx"; - List filters = new List(); - filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + /// + /// 构造 + /// + public BBAC_SA_DETAIL_SERVICE(INormalEfCoreRepository bbacSaDetailRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _bbacSaDetailRepository = bbacSaDetailRepository; + } - var entities = await _bbacSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); + #region 导出 + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(BBAC_SA_DETAIL_EXPORT_REQUEST_DTO input) + { + string fileName = $"JisBBAC的结算数据_{Guid.NewGuid()}.xlsx"; + List filters = new List(); + filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); - result.ShouldNotBeNull(); + var entities = await _bbacSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); - return fileName; - } - #endregion + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _bbacSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _bbacSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion + + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _bbacSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _bbacSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs index 16dca66d..bf7234a4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SA_SERVICE.cs @@ -22,536 +22,537 @@ using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// JISBBAC结算 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class BBAC_SA_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// DbContext + /// JISBBAC结算 /// - private readonly SettleAccountDbContext _settleAccountDbContext; - /// - /// BBAC结算仓储 - /// - private readonly INormalEfCoreRepository _bbacSaRepository; - - /// - /// BBAC结算明细仓储 - /// - private readonly INormalEfCoreRepository _bbacSaDetailRepository; - - /// - /// BBAC可结算仓储 - /// - private readonly INormalEfCoreRepository _bbacCanSaRepository; - - /// - /// BBAC可结算明细仓储 - /// - private readonly INormalEfCoreRepository _bbacCanSaDetailRepository; - - /// - /// BBAC不可结算明细仓储 - /// - private readonly INormalEfCoreRepository _bbacNotSaDetailRepository; - - /// - /// 销售价格仓储 - /// - private readonly INormalEfCoreRepository _priceListRepository; - - /// - /// 客户零件关系仓储 - /// - private readonly INormalEfCoreRepository _materialRelationshipRepository; - - /// - /// 替换件关系仓储 - /// - private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository; + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class BBAC_SA_SERVICE : SettleAccountApplicationBase + { + /// + /// DbContext + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// + /// BBAC结算仓储 + /// + private readonly INormalEfCoreRepository _bbacSaRepository; + + /// + /// BBAC结算明细仓储 + /// + private readonly INormalEfCoreRepository _bbacSaDetailRepository; + + /// + /// BBAC可结算仓储 + /// + private readonly INormalEfCoreRepository _bbacCanSaRepository; + + /// + /// BBAC可结算明细仓储 + /// + private readonly INormalEfCoreRepository _bbacCanSaDetailRepository; + + /// + /// BBAC不可结算明细仓储 + /// + private readonly INormalEfCoreRepository _bbacNotSaDetailRepository; + + /// + /// 销售价格仓储 + /// + private readonly INormalEfCoreRepository _priceListRepository; + + /// + /// 客户零件关系仓储 + /// + private readonly INormalEfCoreRepository _materialRelationshipRepository; + + /// + /// 替换件关系仓储 + /// + private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository; + + /// + /// 业务类型 + /// + private readonly EnumBusinessType _businessType = EnumBusinessType.JisBBAC; + + /// + /// 构造 + /// + public BBAC_SA_SERVICE(SettleAccountDbContext settleAccountDbContext, + INormalEfCoreRepository bbacSaRepository, + INormalEfCoreRepository bbacSaDetailRepository, + INormalEfCoreRepository bbacCanSaRepository, + INormalEfCoreRepository bbacCanSaDetailRepository, + INormalEfCoreRepository bbacNotSaDetailRepository, + INormalEfCoreRepository priceListRepository, + INormalEfCoreRepository materialRelationshipRepository, + INormalEfCoreRepository tbRePartsRelationshipRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _settleAccountDbContext = settleAccountDbContext; + _bbacSaRepository = bbacSaRepository; + _bbacSaDetailRepository = bbacSaDetailRepository; + _bbacCanSaRepository = bbacCanSaRepository; + _bbacCanSaDetailRepository = bbacCanSaDetailRepository; + _bbacNotSaDetailRepository = bbacNotSaDetailRepository; + _priceListRepository = priceListRepository; + _materialRelationshipRepository = materialRelationshipRepository; + _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; + } - /// - /// 业务类型 - /// - private readonly EnumBusinessType _businessType = EnumBusinessType.JisBBAC; + /// + /// 地点 + /// + public string Site { get; set; } + /// + /// 期间 + /// + public int Version { get; set; } + + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto) + { + Site = bbacSaImportRequestDto.Site; + Version = bbacSaImportRequestDto.Version; + #region 导入数据转换、数据校验 + var exportImporter = new ExportImporter(); + var importDtos = await exportImporter.UploadExcelImport(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); - /// - /// 构造 - /// - public BBAC_SA_SERVICE(SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository bbacSaRepository, - INormalEfCoreRepository bbacSaDetailRepository, - INormalEfCoreRepository bbacCanSaRepository, - INormalEfCoreRepository bbacCanSaDetailRepository, - INormalEfCoreRepository bbacNotSaDetailRepository, - INormalEfCoreRepository priceListRepository, - INormalEfCoreRepository materialRelationshipRepository, - INormalEfCoreRepository tbRePartsRelationshipRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) - { - _settleAccountDbContext = settleAccountDbContext; - _bbacSaRepository = bbacSaRepository; - _bbacSaDetailRepository = bbacSaDetailRepository; - _bbacCanSaRepository = bbacCanSaRepository; - _bbacCanSaDetailRepository = bbacCanSaDetailRepository; - _bbacNotSaDetailRepository = bbacNotSaDetailRepository; - _priceListRepository = priceListRepository; - _materialRelationshipRepository = materialRelationshipRepository; - _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; - } + importDtos.ForEach(importDto => + { + if (importDto.MovementType == "967") + { + importDto.Qty = -importDto.Qty; + } + }); - /// - /// 地点 - /// - public string Site { get; set; } - /// - /// 期间 - /// - public int Version { get; set; } + var importBBACSaDetails = ObjectMapper.Map, List>(importDtos); - #region 导入、导出 - /// - /// 导入 - /// - [HttpPost] - public async Task ImportAsync([FromForm] BBACSaImportRequestDto bbacSaImportRequestDto) - { - Site = bbacSaImportRequestDto.Site; - Version = bbacSaImportRequestDto.Version; - #region 导入数据转换、数据校验 - var exportImporter = new ExportImporter(); - var importDtos = await exportImporter.UploadExcelImport(bbacSaImportRequestDto.Files, _excelImportService).ConfigureAwait(false); + importBBACSaDetails = HandleSaDetails(importBBACSaDetails); + importBBACSaDetails.ForEach(importBBACSaDetail => + { + importBBACSaDetail.Version = Version; + importBBACSaDetail.Site = Site; + importBBACSaDetail.BusinessType = importBBACSaDetail.PN.Contains("R0") ? EnumBusinessType.MaiDanJianBBAC : EnumBusinessType.JisBBAC; + }); - importDtos.ForEach(importDto => - { - if (importDto.MovementType == "967") + //数据校验 + var checkList = new List(); + //结算分组号 + var bbacSaGroupNums = importBBACSaDetails.Select(t => t.GroupNum).Distinct(); + //已存在的结算分组号 + var havBBACSaGroupNums = (await _bbacSaDetailRepository.GetListAsync(t => bbacSaGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct(); + if (havBBACSaGroupNums.Any() == true) { - importDto.Qty = -importDto.Qty; + foreach (var item in havBBACSaGroupNums) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); + } } - }); - - var importBBACSaDetails = ObjectMapper.Map, List>(importDtos); - importBBACSaDetails = HandleSaDetails(importBBACSaDetails); - importBBACSaDetails.ForEach(importBBACSaDetail => - { - importBBACSaDetail.Version = Version; - importBBACSaDetail.Site = Site; - importBBACSaDetail.BusinessType = importBBACSaDetail.PN.Contains("R0") ? EnumBusinessType.MaiDanJianBBAC : EnumBusinessType.JisBBAC; - }); - - //数据校验 - var checkList = new List(); - //结算分组号 - var bbacSaGroupNums = importBBACSaDetails.Select(t => t.GroupNum).Distinct(); - //已存在的结算分组号 - var havBBACSaGroupNums = (await _bbacSaDetailRepository.GetListAsync(t => bbacSaGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct(); - if (havBBACSaGroupNums.Any() == true) - { - foreach (var item in havBBACSaGroupNums) + if (!checkList.Any()) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); + //验证客户对应厂内零件号是否存在 + + var jisSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.JisBBAC); + var maiDanSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.MaiDanJianHBPO); + if (jisSaDetails.Any()) + { + checkList.AddRange(await CheckAsync(jisSaDetails, EnumBusinessType.JisBBAC).ConfigureAwait(false)); + } + if (maiDanSaDetails.Any()) + { + checkList.AddRange(await CheckAsync(maiDanSaDetails, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false)); + } } - } - - if (!checkList.Any()) - { - //验证客户对应厂内零件号是否存在 - var jisSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.JisBBAC); - var maiDanSaDetails = importBBACSaDetails.FindAll(t => t.BusinessType == EnumBusinessType.MaiDanJianHBPO); - if (jisSaDetails.Any()) + if (checkList.Count > 0) { - checkList.AddRange(await CheckAsync(jisSaDetails, EnumBusinessType.JisBBAC).ConfigureAwait(false)); + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } - if (maiDanSaDetails.Any()) + #endregion + + if (importBBACSaDetails.Any()) { - checkList.AddRange(await CheckAsync(maiDanSaDetails, EnumBusinessType.MaiDanJianBBAC).ConfigureAwait(false)); + await SaDataHandleAsync(importBBACSaDetails).ConfigureAwait(false); } - } - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - #endregion - if (importBBACSaDetails.Any()) + /// + /// 数据校验 + /// + private async Task> CheckAsync(List saDetails, EnumBusinessType businessType) { - await SaDataHandleAsync(importBBACSaDetails).ConfigureAwait(false); - } + #region 数据校验 + //数据校验 + var checkList = new List(); - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } - - /// - /// 数据校验 - /// - private async Task> CheckAsync(List saDetails, EnumBusinessType businessType) - { - #region 数据校验 - //数据校验 - var checkList = new List(); - - //验证客户对应厂内零件号是否存在 - //导入的零件号集合 - var saLus = saDetails.Select(t => t.LU).Distinct(); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && saLus.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - var settleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); - - //不存在的客户零件号(差集) - var noExistSettleMaterialCodes = saLus.Except(settleMaterialCodes); - noExistSettleMaterialCodes.ForEach(t => - { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); - }); + //验证客户对应厂内零件号是否存在 + //导入的零件号集合 + var saLus = saDetails.Select(t => t.LU).Distinct(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && saLus.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + var settleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + + //不存在的客户零件号(差集) + var noExistSettleMaterialCodes = saLus.Except(settleMaterialCodes); + noExistSettleMaterialCodes.ForEach(t => + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); + }); - return checkList; + return checkList; + #endregion + } #endregion - } - #endregion - - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - /// - /// 删除 - /// - [HttpPost] - public async Task DeleteAsync(Guid id) - { - //结算主表 - BBAC_SA bbacSaDelEntity; - //结算明细 - List bbacSaDetailDelEntitys; - //可结算主表 - List bbacCanSaDelEntitys; - //可结算明细 - List bbacCanSaDetailDelEntitys; - //不可结算 - List bbacNotSaDetailDelEntitys; - - bbacSaDelEntity = await _bbacSaRepository.FindAsync(id); - if (bbacSaDelEntity == null) + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) { - throw new UserFriendlyException($"未获取到结算单!", "400"); + var entities = await _bbacSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _bbacSaRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); } - //结算单据 - string bbacSaBillNum = bbacSaDelEntity.BillNum; - bbacCanSaDelEntitys = await _bbacCanSaRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum); - //验证可结算主表状态 - if (bbacCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态)) + /// + /// 删除 + /// + [HttpPost] + public async Task DeleteAsync(Guid id) { - throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400"); - } + //结算主表 + BBAC_SA bbacSaDelEntity; + //结算明细 + List bbacSaDetailDelEntitys; + //可结算主表 + List bbacCanSaDelEntitys; + //可结算明细 + List bbacCanSaDetailDelEntitys; + //不可结算 + List bbacNotSaDetailDelEntitys; + + bbacSaDelEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false); + if (bbacSaDelEntity == null) + { + throw new UserFriendlyException($"未获取到结算单!", "400"); + } + //结算单据 + string bbacSaBillNum = bbacSaDelEntity.BillNum; - bbacSaDetailDelEntitys = await _bbacSaDetailRepository.GetListAsync(t => t.BillNum == bbacSaBillNum); - bbacCanSaDetailDelEntitys = await _bbacCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum); - bbacNotSaDetailDelEntitys = await _bbacNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum); + bbacCanSaDelEntitys = await _bbacCanSaRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); + //验证可结算主表状态 + if (bbacCanSaDelEntitys.Any(t => t.State != SettleBillState.未结状态)) + { + throw new UserFriendlyException($"该单据可结算单状态无法删除!", "400"); + } - //删除 - await _bbacSaRepository.DeleteAsync(bbacSaDelEntity); - if (bbacSaDetailDelEntitys.Any()) - { - await _bbacSaDetailRepository.DeleteManyAsync(bbacSaDetailDelEntitys); - } - if (bbacCanSaDelEntitys.Any()) - { - await _bbacCanSaRepository.DeleteManyAsync(bbacCanSaDelEntitys); - } - if (bbacCanSaDetailDelEntitys.Any()) - { - await _bbacCanSaDetailRepository.DeleteManyAsync(bbacCanSaDetailDelEntitys); - } - if (bbacNotSaDetailDelEntitys.Any()) - { - await _bbacNotSaDetailRepository.DeleteManyAsync(bbacNotSaDetailDelEntitys); - } + bbacSaDetailDelEntitys = await _bbacSaDetailRepository.GetListAsync(t => t.BillNum == bbacSaBillNum).ConfigureAwait(false); + bbacCanSaDetailDelEntitys = await _bbacCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); + bbacNotSaDetailDelEntitys = await _bbacNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); - } - - /// - /// 删除 - /// - [HttpPost] - public async Task DeleteListAsync(List ids) - { - //结算主表 - List bbacSas = new List(); - //结算明细 - List bbacSaDetails = new List(); - //可结算主表 - List bbacCanSas = new List(); - //可结算明细 - List bbacCanSaDetails = new List(); - //不可结算 - List bbacNotSaDetails = new List(); - - foreach (var id in ids) - { - try + //删除 + await _bbacSaRepository.DeleteAsync(bbacSaDelEntity).ConfigureAwait(false); + if (bbacSaDetailDelEntitys.Any()) { - var bbacSaDelItems = await GetBBACSaDelItemsAsync(id).ConfigureAwait(false); - - bbacSas.AddRange(bbacSaDelItems.bbacSas); - bbacSaDetails.AddRange(bbacSaDelItems.bbacSaDetails); - bbacCanSas.AddRange(bbacSaDelItems.bbacCanSas); - bbacCanSaDetails.AddRange(bbacSaDelItems.bbacCanSaDetails); - bbacNotSaDetails.AddRange(bbacSaDelItems.bbacNotSaDetails); + await _bbacSaDetailRepository.DeleteManyAsync(bbacSaDetailDelEntitys).ConfigureAwait(false); } - catch (Exception) + if (bbacCanSaDelEntitys.Any()) { - throw; + await _bbacCanSaRepository.DeleteManyAsync(bbacCanSaDelEntitys).ConfigureAwait(false); + } + if (bbacCanSaDetailDelEntitys.Any()) + { + await _bbacCanSaDetailRepository.DeleteManyAsync(bbacCanSaDetailDelEntitys).ConfigureAwait(false); + } + if (bbacNotSaDetailDelEntitys.Any()) + { + await _bbacNotSaDetailRepository.DeleteManyAsync(bbacNotSaDetailDelEntitys).ConfigureAwait(false); } - } - //删除 - if (bbacSas.Any()) - { - await _bbacSaRepository.DeleteManyAsync(bbacSas).ConfigureAwait(false); } - if (bbacSaDetails.Any()) - { - await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails).ConfigureAwait(false); - } - if (bbacCanSas.Any()) - { - await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas).ConfigureAwait(false); - } - if (bbacCanSaDetails.Any()) - { - await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails).ConfigureAwait(false); - } - if (bbacNotSaDetails.Any()) - { - await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails).ConfigureAwait(false); - } - } - #endregion - #region 私有方法 - /// - /// 处理结算数据 - /// - private List HandleSaDetails(List bbacSaDetails) - { - bbacSaDetails.ForEach(bbacSaDetail => + /// + /// 删除 + /// + [HttpPost] + public async Task DeleteListAsync(List ids) { - var lus = bbacSaDetail.LU.Split(new string(' ', 4)).ToList(); - bbacSaDetail.LU = lus[0].Replace(" ", ""); - if (lus.Count > 1) + //结算主表 + List bbacSas = new List(); + //结算明细 + List bbacSaDetails = new List(); + //可结算主表 + List bbacCanSas = new List(); + //可结算明细 + List bbacCanSaDetails = new List(); + //不可结算 + List bbacNotSaDetails = new List(); + + foreach (var id in ids) { - lus.RemoveAt(0); - var luAssemble = lus.Select(t => t.Replace(" ", "")); - bbacSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + try + { + var bbacSaDelItems = await GetBBACSaDelItemsAsync(id).ConfigureAwait(false); + + bbacSas.AddRange(bbacSaDelItems.bbacSas); + bbacSaDetails.AddRange(bbacSaDelItems.bbacSaDetails); + bbacCanSas.AddRange(bbacSaDelItems.bbacCanSas); + bbacCanSaDetails.AddRange(bbacSaDelItems.bbacCanSaDetails); + bbacNotSaDetails.AddRange(bbacSaDelItems.bbacNotSaDetails); + } + catch (Exception) + { + throw; + } } - bbacSaDetail.PN = Regex.Replace(bbacSaDetail.PN, "['‘’]", ""); - }); - return GroupPnLu(bbacSaDetails); - } - - /// - /// 结算数据分组Pn、Lu - /// - private List GroupPnLu(List bbacSaDetails) - { - return bbacSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => - { - var bbacSaDetail = t.First(); - bbacSaDetail.Qty = t.Sum(t => t.Qty); - return bbacSaDetail; - }).ToList(); - } - /// - /// 结算数据处理 - /// - private async Task SaDataHandleAsync(List bbacSaDetails) - { - //结算单号 - var bbacSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); - //结算主表 - var bbacSa = new BBAC_SA() - { - BillNum = bbacSaBillNum, - State = "0", - BusinessType = _businessType, - Site = Site, - Version = Version - }; - //可结算单号 - var bbacCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); - //可结算主表 - var bbacCanSa = new BBAC_CAN_SA() - { - BillNum = bbacCanSaBillNum, - InvGroupNum = bbacCanSaBillNum, - SettleBillNum = bbacSaBillNum, - State = SettleBillState.未结状态, - BusinessType = _businessType, - Site = Site, - Version = Version - }; - //可结算明细 - var bbacCanSaDetails = new List(); - //不可结算明细 - var bbacNotSaDetails = new List(); - //客户零件关系 - var materialRelationships = new List(); - - #region 处理结算数据 - bbacSaDetails.ForEach(bbacSaDetail => - { - bbacSaDetail.SetId(GuidGenerator.Create()); - bbacSaDetail.BillNum = bbacSaBillNum; - bbacSaDetail.KeyCode = bbacSaDetail.PN + bbacSaDetail.LU; - bbacSaDetail.CustomerPartCodeNoSpace = bbacSaDetail.LU.Replace(" ", ""); - }); - - //导入的零件号集合 - var importPubSaLUs = bbacSaDetails.Select(t => t.LU).Distinct(); - //销售价格 - - var priceListEntitys = GetPriceListEntitys(importPubSaLUs); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => new List { EnumBusinessType.JisBBAC, EnumBusinessType.MaiDanJianBBAC }.Contains(t.BusinessType) && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - bbacSaDetails.ForEach(bbacSaDetail => - { - //根据物料号、结算日期获取价格 - var priceListEntity = priceListEntitys - .Where(t => t.LU == bbacSaDetail.LU) - .Where(t => bbacSaDetail.SettleDate >= t.BeginTime && bbacSaDetail.SettleDate <= t.EndTime) - .OrderByDescending(t => t.Date) - .ThenByDescending(t => t.CreationTime) - .FirstOrDefault(); - bbacSaDetail.Price = priceListEntity?.Price ?? 0; - - bbacSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.BusinessType == bbacSaDetail.BusinessType && t.SettleMaterialCode == bbacSaDetail.LU)?.ErpMaterialCode; - }); + //删除 + if (bbacSas.Any()) + { + await _bbacSaRepository.DeleteManyAsync(bbacSas).ConfigureAwait(false); + } + if (bbacSaDetails.Any()) + { + await _bbacSaDetailRepository.DbContext.BulkDeleteAsync(bbacSaDetails).ConfigureAwait(false); + } + if (bbacCanSas.Any()) + { + await _bbacCanSaRepository.DeleteManyAsync(bbacCanSas).ConfigureAwait(false); + } + if (bbacCanSaDetails.Any()) + { + await _bbacCanSaDetailRepository.DbContext.BulkDeleteAsync(bbacCanSaDetails).ConfigureAwait(false); + } + if (bbacNotSaDetails.Any()) + { + await _bbacNotSaDetailRepository.DbContext.BulkDeleteAsync(bbacNotSaDetails).ConfigureAwait(false); + } + } #endregion - #region 入库数据赋值 - //根据价格区分结算、不可结算 - var bbacSaDetailsCanSes = bbacSaDetails.FindAll(t => t.Price != default); - var bbacSaDetailsNotCanSes = bbacSaDetails.FindAll(t => t.Price == default); + #region 私有方法 + /// + /// 处理结算数据 + /// + private List HandleSaDetails(List bbacSaDetails) + { + bbacSaDetails.ForEach(bbacSaDetail => + { + var lus = bbacSaDetail.LU.Split(new string(' ', 4)).ToList(); + bbacSaDetail.LU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + bbacSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + } + bbacSaDetail.PN = Regex.Replace(bbacSaDetail.PN, "['‘’]", ""); + }); + return GroupPnLu(bbacSaDetails); + } - //可结算明细 - bbacCanSaDetails = ObjectMapper.Map, List>(bbacSaDetailsCanSes); - //不可结算明细 - bbacNotSaDetails = ObjectMapper.Map, List>(bbacSaDetailsNotCanSes); - #endregion + /// + /// 结算数据分组Pn、Lu + /// + private List GroupPnLu(List bbacSaDetails) + { + return bbacSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => + { + var bbacSaDetail = t.First(); + bbacSaDetail.Qty = t.Sum(t => t.Qty); + return bbacSaDetail; + }).ToList(); + } - #region 添加入库 - await _bbacSaRepository.InsertAsync(bbacSa).ConfigureAwait(false); - //存在买单将BBAC数据添加买单件BBAC主表数据 - if (bbacSaDetails.Any(t => t.BusinessType == EnumBusinessType.MaiDanJianBBAC)) + /// + /// 结算数据处理 + /// + private async Task SaDataHandleAsync(List bbacSaDetails) { - //买单件结算主表 - await _bbacSaRepository.InsertAsync(new BBAC_SA() + //结算单号 + var bbacSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); + //结算主表 + var bbacSa = new BBAC_SA() { BillNum = bbacSaBillNum, State = "0", - BusinessType = EnumBusinessType.MaiDanJianBBAC, + BusinessType = _businessType, Site = Site, Version = Version - }).ConfigureAwait(false); - } - await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails).ConfigureAwait(false); - if (bbacCanSaDetails.Count > 0) - { - bbacCanSaDetails.ForEach(bbacCanSaDetail => + }; + //可结算单号 + var bbacCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); + //可结算主表 + var bbacCanSa = new BBAC_CAN_SA() + { + BillNum = bbacCanSaBillNum, + InvGroupNum = bbacCanSaBillNum, + SettleBillNum = bbacSaBillNum, + State = SettleBillState.未结状态, + BusinessType = _businessType, + Site = Site, + Version = Version + }; + //可结算明细 + var bbacCanSaDetails = new List(); + //不可结算明细 + var bbacNotSaDetails = new List(); + //客户零件关系 + var materialRelationships = new List(); + + #region 处理结算数据 + bbacSaDetails.ForEach(bbacSaDetail => { - bbacCanSaDetail.BillNum = bbacCanSaDetail.InvGroupNum = bbacCanSaBillNum; - bbacCanSaDetail.BusinessType = _businessType; + bbacSaDetail.SetId(GuidGenerator.Create()); + bbacSaDetail.BillNum = bbacSaBillNum; + bbacSaDetail.KeyCode = bbacSaDetail.PN + bbacSaDetail.LU; + bbacSaDetail.CustomerPartCodeNoSpace = bbacSaDetail.LU.Replace(" ", ""); }); - await _bbacCanSaRepository.InsertAsync(bbacCanSa).ConfigureAwait(false); - await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails).ConfigureAwait(false); - } - if (bbacNotSaDetails.Count > 0) - { - bbacNotSaDetails.ForEach(bbacNotSaDetail => + //导入的零件号集合 + var importPubSaLUs = bbacSaDetails.Select(t => t.LU).Distinct(); + //销售价格 + + var priceListEntitys = GetPriceListEntitys(importPubSaLUs); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => new List { EnumBusinessType.JisBBAC, EnumBusinessType.MaiDanJianBBAC }.Contains(t.BusinessType) && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + bbacSaDetails.ForEach(bbacSaDetail => { - bbacNotSaDetail.BusinessType = _businessType; + //根据物料号、结算日期获取价格 + var priceListEntity = priceListEntitys + .Where(t => t.LU == bbacSaDetail.LU) + .Where(t => bbacSaDetail.SettleDate >= t.BeginTime && bbacSaDetail.SettleDate <= t.EndTime) + .OrderByDescending(t => t.Date) + .ThenByDescending(t => t.CreationTime) + .FirstOrDefault(); + bbacSaDetail.Price = priceListEntity?.Price ?? 0; + + bbacSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.BusinessType == bbacSaDetail.BusinessType && t.SettleMaterialCode == bbacSaDetail.LU)?.ErpMaterialCode; }); + #endregion + + #region 入库数据赋值 + //根据价格区分结算、不可结算 + var bbacSaDetailsCanSes = bbacSaDetails.FindAll(t => t.Price != default); + var bbacSaDetailsNotCanSes = bbacSaDetails.FindAll(t => t.Price == default); + + //可结算明细 + bbacCanSaDetails = ObjectMapper.Map, List>(bbacSaDetailsCanSes); + //不可结算明细 + bbacNotSaDetails = ObjectMapper.Map, List>(bbacSaDetailsNotCanSes); + #endregion + + #region 添加入库 + await _bbacSaRepository.InsertAsync(bbacSa).ConfigureAwait(false); + //存在买单将BBAC数据添加买单件BBAC主表数据 + if (bbacSaDetails.Any(t => t.BusinessType == EnumBusinessType.MaiDanJianBBAC)) + { + //买单件结算主表 + await _bbacSaRepository.InsertAsync(new BBAC_SA() + { + BillNum = bbacSaBillNum, + State = "0", + BusinessType = EnumBusinessType.MaiDanJianBBAC, + Site = Site, + Version = Version + }).ConfigureAwait(false); + } + await _bbacSaDetailRepository.DbContext.BulkInsertAsync(bbacSaDetails).ConfigureAwait(false); + if (bbacCanSaDetails.Count > 0) + { + bbacCanSaDetails.ForEach(bbacCanSaDetail => + { + bbacCanSaDetail.BillNum = bbacCanSaDetail.InvGroupNum = bbacCanSaBillNum; + bbacCanSaDetail.BusinessType = _businessType; + }); + + await _bbacCanSaRepository.InsertAsync(bbacCanSa).ConfigureAwait(false); + await _bbacCanSaDetailRepository.DbContext.BulkInsertAsync(bbacCanSaDetails).ConfigureAwait(false); + } + if (bbacNotSaDetails.Count > 0) + { + bbacNotSaDetails.ForEach(bbacNotSaDetail => + { + bbacNotSaDetail.BusinessType = _businessType; + }); - await _bbacNotSaDetailRepository.DbContext.BulkInsertAsync(bbacNotSaDetails).ConfigureAwait(false); - } - if (materialRelationships.Count > 0) - { - await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false); + await _bbacNotSaDetailRepository.DbContext.BulkInsertAsync(bbacNotSaDetails).ConfigureAwait(false); + } + if (materialRelationships.Count > 0) + { + await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false); + } + #endregion } - #endregion - } - /// - /// 获取结算关联项 - /// - private async Task<(List bbacSas, List bbacSaDetails, List bbacCanSas, List bbacCanSaDetails, List bbacNotSaDetails)> GetBBACSaDelItemsAsync(Guid id) - { - //结算主表 - var bbacSas = new List(); - //结算明细 - var bbacSaDetails = new List(); - //可结算主表 - var bbacCanSas = new List(); - //可结算明细 - var bbacCanSaDetails = new List(); - //不可结算 - var bbacNotSaDetails = new List(); - var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false); - if (bbacSaEntity != null) + /// + /// 获取结算关联项 + /// + private async Task<(List bbacSas, List bbacSaDetails, List bbacCanSas, List bbacCanSaDetails, List bbacNotSaDetails)> GetBBACSaDelItemsAsync(Guid id) { - //结算单据 - string bbacSaBillNum = bbacSaEntity.BillNum; - - bbacCanSas = await _bbacCanSaRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); - //验证可结算主表状态 - if (bbacCanSas.Any() && bbacCanSas.Any(t => t.State != SettleBillState.未结状态)) + //结算主表 + var bbacSas = new List(); + //结算明细 + var bbacSaDetails = new List(); + //可结算主表 + var bbacCanSas = new List(); + //可结算明细 + var bbacCanSaDetails = new List(); + //不可结算 + var bbacNotSaDetails = new List(); + var bbacSaEntity = await _bbacSaRepository.FindAsync(id).ConfigureAwait(false); + if (bbacSaEntity != null) { - throw new UserFriendlyException($"{bbacSaBillNum} 该单据可结算单状态无法删除!", "400"); + //结算单据 + string bbacSaBillNum = bbacSaEntity.BillNum; + + bbacCanSas = await _bbacCanSaRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); + //验证可结算主表状态 + if (bbacCanSas.Any() && bbacCanSas.Any(t => t.State != SettleBillState.未结状态)) + { + throw new UserFriendlyException($"{bbacSaBillNum} 该单据可结算单状态无法删除!", "400"); + } + + bbacSas = await _bbacSaRepository.GetListAsync(t => t.BillNum == bbacSaBillNum).ConfigureAwait(false); + bbacSaDetails = await _bbacSaDetailRepository.GetListAsync(t => t.BillNum == bbacSaBillNum).ConfigureAwait(false); + bbacCanSaDetails = await _bbacCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); + bbacNotSaDetails = await _bbacNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); } - bbacSas = await _bbacSaRepository.GetListAsync(t => t.BillNum == bbacSaBillNum).ConfigureAwait(false); - bbacSaDetails = await _bbacSaDetailRepository.GetListAsync(t => t.BillNum == bbacSaBillNum).ConfigureAwait(false); - bbacCanSaDetails = await _bbacCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); - bbacNotSaDetails = await _bbacNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == bbacSaBillNum).ConfigureAwait(false); + return (bbacSas, bbacSaDetails, bbacCanSas, bbacCanSaDetails, bbacNotSaDetails); } - return (bbacSas, bbacSaDetails, bbacCanSas, bbacCanSaDetails, bbacNotSaDetails); - } - - /// - /// 获取价格 - /// - private List GetPriceListEntitys(IEnumerable importSaLus) - { - var clientCode = Site; - return _settleAccountDbContext.Set() - .Where(t => t.IsCancel == false) - .Where(t => t.ClientCode == clientCode) - .Where(t => importSaLus.Contains(t.LU)) - .ToList(); + /// + /// 获取价格 + /// + private List GetPriceListEntitys(IEnumerable importSaLus) + { + var clientCode = Site; + return _settleAccountDbContext.Set() + .Where(t => t.IsCancel == false) + .Where(t => t.ClientCode == clientCode) + .Where(t => importSaLus.Contains(t.LU)) + .ToList(); + } + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs index 928e228e..2142bc96 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs @@ -1,10 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; using Shouldly; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; @@ -34,7 +34,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// 构造 /// - public BBAC_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) + public BBAC_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) { _repository = repository; _excelImportService = excelImportService; @@ -48,14 +48,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task ExportAsync(RequestDto input) { string fileName = $"JisBBAC发运数据_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); return fileName; } #endregion @@ -67,8 +67,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] public async Task> GetListAsync(RequestDto input) { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs index aee5a3b8..d82c71f6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_EDI_Service.cs @@ -12,66 +12,67 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// BBAC的EDI数据 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class BBAC_SE_EDI_SERVICE : ApplicationService +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// BBAC的EDI数据仓储 + /// BBAC的EDI数据 /// - private readonly INormalEfCoreRepository _repository; + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class BBAC_SE_EDI_SERVICE : ApplicationService + { + /// + /// BBAC的EDI数据仓储 + /// + private readonly INormalEfCoreRepository _repository; - /// - /// excel服务 - /// - private readonly IExcelImportAppService _excelImportService; + /// + /// excel服务 + /// + private readonly IExcelImportAppService _excelImportService; - /// - /// 构造 - /// - public BBAC_SE_EDI_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) - { - _repository = repository; - _excelImportService = excelImportService; - } + /// + /// 构造 + /// + public BBAC_SE_EDI_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) + { + _repository = repository; + _excelImportService = excelImportService; + } - #region 导出 - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(RequestDto input) - { - string fileName = $"BBAC的EDI数据_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); ; - var dtos = ObjectMapper.Map, List>(entities); + #region 导出 + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(RequestDto input) + { + string fileName = $"BBAC的EDI数据_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); ; + var dtos = ObjectMapper.Map, List>(entities); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); ; - result.ShouldNotBeNull(); + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); ; + result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); ; - return fileName; - } - #endregion + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); ; + return fileName; + } + #endregion - #region 查询 - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - #endregion + #region 查询 + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs index 9e8a9eac..78cd4e95 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/CompareService.cs @@ -11,104 +11,105 @@ using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.TaskJobs; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// 对比服务 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class CompareService : ApplicationService +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// 任务服务 + /// 对比服务 /// - private readonly TaskJobService _taskJobService; - - public CompareService(TaskJobService taskJobService) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class CompareService : ApplicationService { - _taskJobService = taskJobService; - } + /// + /// 任务服务 + /// + private readonly TaskJobService _taskJobService; - #region Edi与发运比对 - /// - /// Edi与发运比对 - /// - [HttpPost] - public async Task EdiSeCompare(EdiSeCompareRequestDto ediSeCompareRequestDto) - { - var businessTypeDisplayName = ediSeCompareRequestDto.BusinessType.ToString(); - var attributeOfType = ediSeCompareRequestDto.BusinessType.GetAttributeOfType(); - if (attributeOfType != null) + public CompareService(TaskJobService taskJobService) { - businessTypeDisplayName = attributeOfType.Name; + _taskJobService = taskJobService; } - var projectName = $"{businessTypeDisplayName}EDI与发运数据对比"; - - var customConditionList = new List(); - customConditionList.Add(new CustomCondition() { Name = "Version", Value = ediSeCompareRequestDto.Version }); - customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)ediSeCompareRequestDto.BusinessType).ToString() }); - customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = ediSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") }); - customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = ediSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") }); - customConditionList.Add(new CustomCondition() { Name = "LU", Value = ediSeCompareRequestDto.LU }); - customConditionList.Add(new CustomCondition() { Name = "PN", Value = ediSeCompareRequestDto.PN }); - customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); - var jobMoudle = ediSeCompareRequestDto.BusinessType switch + #region Edi与发运比对 + /// + /// Edi与发运比对 + /// + [HttpPost] + public async Task EdiSeCompare(EdiSeCompareRequestDto ediSeCompareRequestDto) { - EnumBusinessType.JisBBAC => typeof(JisBBACSeEdiCompareExportService), - EnumBusinessType.JisHBPO => typeof(JisHBPOSeEdiCompareExportService), - _ => throw new UserFriendlyException($"{nameof(ediSeCompareRequestDto.BusinessType)}参数值无效", "403") - }; + var businessTypeDisplayName = ediSeCompareRequestDto.BusinessType.ToString(); + var attributeOfType = ediSeCompareRequestDto.BusinessType.GetAttributeOfType(); + if (attributeOfType != null) + { + businessTypeDisplayName = attributeOfType.Name; + } + var projectName = $"{businessTypeDisplayName}EDI与发运数据对比"; - var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, ediSeCompareRequestDto.Version, string.Empty, CurrentUser, jobMoudle, customConditionList, (rs) => - { - }).ConfigureAwait(false); - return _taskid; - } - #endregion + var customConditionList = new List(); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = ediSeCompareRequestDto.Version }); + customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)ediSeCompareRequestDto.BusinessType).ToString() }); + customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = ediSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") }); + customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = ediSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") }); + customConditionList.Add(new CustomCondition() { Name = "LU", Value = ediSeCompareRequestDto.LU }); + customConditionList.Add(new CustomCondition() { Name = "PN", Value = ediSeCompareRequestDto.PN }); + customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); - #region 结算与发运比对 - /// - /// 结算与发运比对 - /// - [HttpPost] - public async Task SaSeCompare(SaSeCompareRequestDto saSeCompareRequestDto) - { - var businessTypeDisplayName = saSeCompareRequestDto.BusinessType.ToString(); - var attributeOfType = saSeCompareRequestDto.BusinessType.GetAttributeOfType(); - if (attributeOfType != null) - { - businessTypeDisplayName = attributeOfType.Name; - } - var projectName = $"{businessTypeDisplayName}结算与发运数据对比"; + var jobMoudle = ediSeCompareRequestDto.BusinessType switch + { + EnumBusinessType.JisBBAC => typeof(JisBBACSeEdiCompareExportService), + EnumBusinessType.JisHBPO => typeof(JisHBPOSeEdiCompareExportService), + _ => throw new UserFriendlyException($"{nameof(ediSeCompareRequestDto.BusinessType)}参数值无效", "403") + }; - var customConditionList = new List(); - customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version }); - customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)saSeCompareRequestDto.BusinessType).ToString() }); - customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = saSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") }); - customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = saSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") }); - customConditionList.Add(new CustomCondition() { Name = "LU", Value = saSeCompareRequestDto.LU }); - customConditionList.Add(new CustomCondition() { Name = "PN", Value = saSeCompareRequestDto.PN }); - customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); + var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, ediSeCompareRequestDto.Version, string.Empty, CurrentUser, jobMoudle, customConditionList, (rs) => + { + }).ConfigureAwait(false); + return _taskid; + } + #endregion - var jobMoudle = saSeCompareRequestDto.BusinessType switch + #region 结算与发运比对 + /// + /// 结算与发运比对 + /// + [HttpPost] + public async Task SaSeCompare(SaSeCompareRequestDto saSeCompareRequestDto) { - EnumBusinessType.JisBBAC => typeof(JisBBACSaSeEdiCompareExportService), - EnumBusinessType.JisHBPO => typeof(JisHBPOSaSeEdiCompareExportService), - EnumBusinessType.ZhiGongJianBBAC => typeof(PubSaSeCompareExportService), - EnumBusinessType.ZhiGongJianHBPO => typeof(PubSaSeCompareExportService), - EnumBusinessType.MaiDanJianBBAC => typeof(MaiDanBBACSaSeCompareExportService), - EnumBusinessType.MaiDanJianHBPO => typeof(MaiDanHBPOSaSeCompareExportService), - EnumBusinessType.BeiJian => typeof(PubSaSeCompareExportService), - EnumBusinessType.YinDuJian => typeof(PubSaSeCompareExportService), - _ => throw new UserFriendlyException($"{nameof(saSeCompareRequestDto.BusinessType)}参数值无效", "403") - }; + var businessTypeDisplayName = saSeCompareRequestDto.BusinessType.ToString(); + var attributeOfType = saSeCompareRequestDto.BusinessType.GetAttributeOfType(); + if (attributeOfType != null) + { + businessTypeDisplayName = attributeOfType.Name; + } + var projectName = $"{businessTypeDisplayName}结算与发运数据对比"; - var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, saSeCompareRequestDto.Version, string.Empty, CurrentUser, jobMoudle, customConditionList, (rs) => - { - }).ConfigureAwait(false); - return _taskid; + var customConditionList = new List(); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = saSeCompareRequestDto.Version }); + customConditionList.Add(new CustomCondition() { Name = "BusinessType", Value = ((int)saSeCompareRequestDto.BusinessType).ToString() }); + customConditionList.Add(new CustomCondition() { Name = "SeStartDateTime", Value = saSeCompareRequestDto.SeStartDateTime?.ToString("yyyy-MM-dd 00:00:00") }); + customConditionList.Add(new CustomCondition() { Name = "SeEndDateTime", Value = saSeCompareRequestDto.SeEndDateTime?.ToString("yyyy-MM-dd 23:59:59") }); + customConditionList.Add(new CustomCondition() { Name = "LU", Value = saSeCompareRequestDto.LU }); + customConditionList.Add(new CustomCondition() { Name = "PN", Value = saSeCompareRequestDto.PN }); + customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = projectName }); + + var jobMoudle = saSeCompareRequestDto.BusinessType switch + { + EnumBusinessType.JisBBAC => typeof(JisBBACSaSeEdiCompareExportService), + EnumBusinessType.JisHBPO => typeof(JisHBPOSaSeEdiCompareExportService), + EnumBusinessType.ZhiGongJianBBAC => typeof(PubSaSeCompareExportService), + EnumBusinessType.ZhiGongJianHBPO => typeof(PubSaSeCompareExportService), + EnumBusinessType.MaiDanJianBBAC => typeof(MaiDanBBACSaSeCompareExportService), + EnumBusinessType.MaiDanJianHBPO => typeof(MaiDanHBPOSaSeCompareExportService), + EnumBusinessType.BeiJian => typeof(PubSaSeCompareExportService), + EnumBusinessType.YinDuJian => typeof(PubSaSeCompareExportService), + _ => throw new UserFriendlyException($"{nameof(saSeCompareRequestDto.BusinessType)}参数值无效", "403") + }; + + var _taskid = await _taskJobService.ExportEnqueueAsync(projectName, ExportExtentsion.Excel, saSeCompareRequestDto.Version, string.Empty, CurrentUser, jobMoudle, customConditionList, (rs) => + { + }).ConfigureAwait(false); + return _taskid; + } + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs index 9a057873..3093b2ce 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_BA_SERVICE.cs @@ -1,15 +1,12 @@ -using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Mvc; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; using System.LinqAsync; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.Application.Services; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -22,7 +19,6 @@ using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -31,7 +27,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [Route("api/settleaccount/[controller]/[action]")] public class HBPO_BA_SERVICE : BA_SERVICE { - + private readonly INormalEfCoreRepository _priceRepository; private readonly ADJ_SERVICE _adjservice; @@ -43,9 +39,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository priceRepository, ADJ_SERVICE adjservice ) - : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice) + : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service, baseservice) { - _priceRepository= priceRepository; + _priceRepository = priceRepository; _adjservice = adjservice; } /// @@ -60,8 +56,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum); - var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); + var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); + var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { throw new UserFriendlyException($"选择发票:{p_invbillnum}对应的可结算单不存在请检查!", "400"); @@ -77,8 +73,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{p_invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var hbpolist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + var hbpolist = await _hbpoMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 + var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync().ConfigureAwait(false);//调整表明细 if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) @@ -108,10 +104,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 var priceList = _priceRepository.ToList();//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - if (errorList.Count() > 0) + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -142,12 +138,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - await ReissueFirstInvoice(hbpolist, adjlist, dtos, version, p_invbillnum); + await ReissueFirstInvoice(hbpolist, adjlist, dtos, version, p_invbillnum).ConfigureAwait(false); } else//二次开票 { - await ReissueSecInvoice(hbpolist, adjlist, dtos, version, p_invbillnum); + await ReissueSecInvoice(hbpolist, adjlist, dtos, version, p_invbillnum).ConfigureAwait(false); } } } @@ -173,10 +169,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceExtend(List p_list) { - var errorlist = await CheckRepeat(p_list); + var errorlist = await CheckRepeat(p_list).ConfigureAwait(false); if (errorlist.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); } var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) @@ -190,8 +186,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); - var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); + var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不存在请检查!", "400"); @@ -207,8 +203,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var hbpolist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + var hbpolist = await _hbpoMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 + // var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) @@ -237,16 +233,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.Where(p=>p.IsCancel==false).ToList();//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - if (errorList.Count() > 0) + var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys join p in priceList on d.LU equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel==false && p.ClientCode==inv.Site + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site select new TEMP_CAN_SA_DETAIL { SettleBillNum = d.SettleBillNum, @@ -272,12 +268,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - await ReissueFirstInvoice(hbpolist, adjlist, dtos, version, invbillnum); + await ReissueFirstInvoice(hbpolist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); } else//二次开票 { - await ReissueSecInvoice(hbpolist, adjlist, dtos, version, invbillnum); + await ReissueSecInvoice(hbpolist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); } } } @@ -290,7 +286,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ // throw new UserFriendlyException( $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return new JsonResult(new { Code = 200, Message = "发票重开成功" }); + return new JsonResult(new { Code = 200, Message = "发票重开成功" }); } @@ -302,7 +298,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceList(List p_list) { - var result = await _adjservice.CheckImport(p_list); + var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); if (result != "OK") { return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); @@ -315,11 +311,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var first = p_list.FirstOrDefault(); var invbillnum = first.InvBillNum; - + var version = int.Parse(DateTime.Now.ToString("yyyymm")); - - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); - var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); + + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); + var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); @@ -335,8 +331,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -401,14 +397,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); invBilllist.AddRange(ls); - + } else//二次开票 { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); invBilllist.AddRange(ls); } @@ -425,7 +421,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ // throw new UserFriendlyException($"不存发票号:{invbillnum}对应的结算分组号"); //} - return new JsonResult(new { Code = 200, Message = "生成成功", Data= invBilllist }); + return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); } @@ -440,7 +436,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public virtual async Task ReissueInvoiceListExt(List p_list) { - var result = await _adjservice.CheckImport(p_list); + var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); if (result != "OK") { return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); @@ -463,9 +459,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); - var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum); + var settle = await _hbpoMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { @@ -483,9 +479,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + var bbaclist = await _hbpoMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -551,7 +547,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) @@ -574,7 +570,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else//二次开票 { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(entities); var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) @@ -602,7 +598,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"不存发票号为:{invbillnum}发票", "400"); } - + return new JsonResult(new { Code = 200, Message = "生成成功", Data = invBilllist }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs index ae2eee1a..fc4adc53 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_CAN_SA_SERVICE.cs @@ -1,20 +1,10 @@ -using CodeArts; -using DocumentFormat.OpenXml.Bibliography; -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Mvc; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; -using System.Security.Policy; -using System.Text; using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.ObjectMapping; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -26,9 +16,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; -using static System.Runtime.CompilerServices.RuntimeHelpers; namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -52,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly INormalEfCoreRepository _notRepository; private readonly INormalEfCoreRepository _priceRepository; private readonly HBPO_CAN_SA_MNG _hbpoMng; - public HBPO_CAN_SA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, @@ -64,7 +51,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository priceRepository, HBPO_CAN_SA_MNG hbpoMng, BaseDomainService baseservice - ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng,baseservice) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) { _priceRepository = priceRepository; @@ -76,30 +63,30 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// /// /// - + [HttpPost] [UnitOfWork(false)] //[Route("generateinvoice")] - public async Task GenerateInvoice([FromBody] string invbillnum) + public async Task GenerateInvoice([FromBody] string invbillnum) { - var main =await _hbpoMng.GetMainAsync(invbillnum); + var main = await _hbpoMng.GetMainAsync(invbillnum).ConfigureAwait(false); if (main != null) { if (main.State != SettleBillState.未结状态) { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } - var entitys = await _hbpoMng.GetDetalListAsync(invbillnum); + var entitys = await _hbpoMng.GetDetalListAsync(invbillnum).ConfigureAwait(false); var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList(); //价格单 - var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 - if (errorList.Count() > 0) + var errorList = await CheckInvoiceGenerationRules(entitys, main.Site, priceList, main.BusinessType).ConfigureAwait(false);//校验生成规则 + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } - if (await _hbpoMng.SetForwardState(main, SettleBillState.已开票)) + if (await _hbpoMng.SetForwardState(main, SettleBillState.已开票).ConfigureAwait(false)) { var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - var notQuery = _notRepository.Where(p =>p.SettleBillNum==main.SettleBillNum).ToList(); + var notQuery = _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToList(); var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU @@ -149,11 +136,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ PartCode = p.PartCode }).ToList();//不能结算 - var falg = await FirstInvoice(entitys, new List(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); + var falg = await FirstInvoice(entitys, new List(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); } else//二次开票 { - var flag = await SecInvoice(entitys, new List(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); + var flag = await SecInvoice(entitys, new List(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); } } @@ -163,7 +150,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { return new JsonResult(new { Code = 400, Message = "不存在可结算单记录" }); } - return new JsonResult(new { Code = 200, Message = "生成成功" }); + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs index 5dfd895a..4c55ad26 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_NOT_SA_SERVICE.cs @@ -1,16 +1,9 @@ -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Mvc; -using NetTaste; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -36,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { private readonly HBPO_NOT_SA_MNG _hbpoNotMng; - public HBPO_NOT_SA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, @@ -50,7 +42,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public override async Task GenerateSettlementOrder(HBPO_NOT_SA_DETAIL_REQ_DTO input) { - var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); List errorlist = new List(); if (entitys == null) { @@ -58,14 +50,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else { - var errors = await _hbpoNotMng.GenerateSettlementOrder(entitys); + var errors = await _hbpoNotMng.GenerateSettlementOrder(entitys).ConfigureAwait(false); if (errors.Count > 0) { foreach (var itm in errors) { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); } } return new JsonResult(new { Code = 200, Message = "生成成功" }); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs index 97a1fe4e..fbfad493 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_PD_SERVICE.cs @@ -1,29 +1,20 @@ -using DocumentFormat.OpenXml.Bibliography; -using DocumentFormat.OpenXml.Drawing.Charts; -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components; -using SettleAccount.Domain.BQ; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components; +using SettleAccount.Domain.BQ; using TaskJob.EventArgs; -using TaskJob.Services; using Volo.Abp; -using Volo.Abp.Application.Services; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.TaskJobs; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ @@ -40,7 +31,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _service = service; } - [UnitOfWork(false)] public override async Task ApprovalPassed(List p_list) { @@ -51,24 +41,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ customConditionList.Add(new CustomCondition() { Name = "IsOut", Value = "out" }); var ls = _repository.Where(p => p_list.Contains(p.BillNum)).ToList(); var lst = ls.Where(p => (p.State == SettleBillState.已提交扣减 || p.State == SettleBillState.已扣减)); - if (lst.Count() > 0) + if (lst.Any()) { - throw new UserFriendlyException("当前状态是已提交状态,不能重复已提交","400"); + throw new UserFriendlyException("当前状态是已提交状态,不能重复已提交", "400"); } foreach (var item in ls) { item.State = SettleBillState.已提交扣减; } - await _repository.DbContext.BulkUpdateAsync(ls); + await _repository.DbContext.BulkUpdateAsync(ls).ConfigureAwait(false); var _taskid = await _service.ExportEnqueueAsync("HBPO待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs index 4ae7f4d4..86feed21 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_DETAIL_SERVICE.cs @@ -15,67 +15,68 @@ using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// HBPO结算明细 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class HBPO_SA_DETAIL_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// HBPO结算明细仓储 - /// - private readonly INormalEfCoreRepository _hbpoSaDetailRepository; - - /// - /// 构造 + /// HBPO结算明细 /// - public HBPO_SA_DETAIL_SERVICE(INormalEfCoreRepository hbpoSaDetailRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class HBPO_SA_DETAIL_SERVICE : SettleAccountApplicationBase { - _hbpoSaDetailRepository = hbpoSaDetailRepository; - } + /// + /// HBPO结算明细仓储 + /// + private readonly INormalEfCoreRepository _hbpoSaDetailRepository; - #region 导出 - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(HBPO_SA_DETAIL_EXPORT_REQUEST_DTO input) - { - string fileName = $"JisHBPO的结算数据_{Guid.NewGuid()}.xlsx"; - List filters = new List(); - filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + /// + /// 构造 + /// + public HBPO_SA_DETAIL_SERVICE(INormalEfCoreRepository hbpoSaDetailRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _hbpoSaDetailRepository = hbpoSaDetailRepository; + } - var entities = await _hbpoSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); + #region 导出 + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(HBPO_SA_DETAIL_EXPORT_REQUEST_DTO input) + { + string fileName = $"JisHBPO的结算数据_{Guid.NewGuid()}.xlsx"; + List filters = new List(); + filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); - result.ShouldNotBeNull(); + var entities = await _hbpoSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); - return fileName; - } - #endregion + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _hbpoSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _hbpoSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion + + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _hbpoSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _hbpoSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs index a5b5b01f..cdb8b58a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SA_SERVICE.cs @@ -24,480 +24,481 @@ using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// HBPO结算 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class HBPO_SA_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// HBPO结算仓储 + /// HBPO结算 /// - private readonly INormalEfCoreRepository _hbpoSaRepository; - - /// - /// HBPO结算明细仓储 - /// - private readonly INormalEfCoreRepository _hbpoSaDetailRepository; - - /// - /// HBPO可结算仓储 - /// - private readonly INormalEfCoreRepository _hbpoCanSaRepository; - - /// - /// HBPO可结算明细仓储 - /// - private readonly INormalEfCoreRepository _hbpoCanSaDetailRepository; - - /// - /// HBPO不可结算明细仓储 - /// - private readonly INormalEfCoreRepository _hbpoNotSaDetailRepository; - - /// - /// 销售价格仓储 - /// - private readonly INormalEfCoreRepository _priceListRepository; - - /// - /// 客户零件关系仓储 - /// - private readonly INormalEfCoreRepository _materialRelationshipRepository; - - /// - /// 替换件关系仓储 - /// - private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository; - - /// - /// 构造 - /// - public HBPO_SA_SERVICE(INormalEfCoreRepository hbpoSaRepository, - INormalEfCoreRepository hbpoSaDetailRepository, - INormalEfCoreRepository hbpoCanSaRepository, - INormalEfCoreRepository hbpoCanSaDetailRepository, - INormalEfCoreRepository hbpoNotSaDetailRepository, - INormalEfCoreRepository priceListRepository, - INormalEfCoreRepository materialRelationshipRepository, - INormalEfCoreRepository tbRePartsRelationshipRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class HBPO_SA_SERVICE : SettleAccountApplicationBase { - _hbpoSaRepository = hbpoSaRepository; - _hbpoSaDetailRepository = hbpoSaDetailRepository; - _hbpoCanSaRepository = hbpoCanSaRepository; - _hbpoCanSaDetailRepository = hbpoCanSaDetailRepository; - _hbpoNotSaDetailRepository = hbpoNotSaDetailRepository; - _priceListRepository = priceListRepository; - _materialRelationshipRepository = materialRelationshipRepository; - _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; - } - - /// - /// 业务类型 - /// - public EnumBusinessType BusinessType { get; set; } - /// - /// 期间 - /// - public int Version { get; set; } - - #region 导入、导出 - /// - /// 导入 - /// - [HttpPost] - public async Task ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto) - { - IActionResult result = new JsonResult(new { Code = 400 }); - Version = hbpoSaImportRequestDto.Version; - switch (hbpoSaImportRequestDto.BusinessType) + /// + /// HBPO结算仓储 + /// + private readonly INormalEfCoreRepository _hbpoSaRepository; + + /// + /// HBPO结算明细仓储 + /// + private readonly INormalEfCoreRepository _hbpoSaDetailRepository; + + /// + /// HBPO可结算仓储 + /// + private readonly INormalEfCoreRepository _hbpoCanSaRepository; + + /// + /// HBPO可结算明细仓储 + /// + private readonly INormalEfCoreRepository _hbpoCanSaDetailRepository; + + /// + /// HBPO不可结算明细仓储 + /// + private readonly INormalEfCoreRepository _hbpoNotSaDetailRepository; + + /// + /// 销售价格仓储 + /// + private readonly INormalEfCoreRepository _priceListRepository; + + /// + /// 客户零件关系仓储 + /// + private readonly INormalEfCoreRepository _materialRelationshipRepository; + + /// + /// 替换件关系仓储 + /// + private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository; + + /// + /// 构造 + /// + public HBPO_SA_SERVICE(INormalEfCoreRepository hbpoSaRepository, + INormalEfCoreRepository hbpoSaDetailRepository, + INormalEfCoreRepository hbpoCanSaRepository, + INormalEfCoreRepository hbpoCanSaDetailRepository, + INormalEfCoreRepository hbpoNotSaDetailRepository, + INormalEfCoreRepository priceListRepository, + INormalEfCoreRepository materialRelationshipRepository, + INormalEfCoreRepository tbRePartsRelationshipRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - case EnumBusinessType.JisHBPO: - BusinessType = EnumBusinessType.JisHBPO; - result = await ImportJisHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); - break; - case EnumBusinessType.MaiDanJianHBPO: - BusinessType = EnumBusinessType.MaiDanJianHBPO; - result = await ImportMaiDanJianHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); - break; - default: - break; + _hbpoSaRepository = hbpoSaRepository; + _hbpoSaDetailRepository = hbpoSaDetailRepository; + _hbpoCanSaRepository = hbpoCanSaRepository; + _hbpoCanSaDetailRepository = hbpoCanSaDetailRepository; + _hbpoNotSaDetailRepository = hbpoNotSaDetailRepository; + _priceListRepository = priceListRepository; + _materialRelationshipRepository = materialRelationshipRepository; + _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; } - return result; - } - #endregion - - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - input.Filters.RemoveAll(t => t.Column.ToLower() == "site"); - var entities = await _hbpoSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _hbpoSaRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - /// - /// 删除 - /// - [HttpPost] - public async Task DeleteListAsync(List ids) - { - //结算主表 - List hbpoSas = new List(); - //结算明细 - List hbpoSaDetails = new List(); - //可结算主表 - List hbpoCanSas = new List(); - //可结算明细 - List hbpoCanSaDetails = new List(); - //不可结算 - List hbpoNotSaDetails = new List(); - - foreach (var id in ids) + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + /// + /// 期间 + /// + public int Version { get; set; } + + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] HBPOSaImportRequestDto hbpoSaImportRequestDto) { - try - { - var hbpoSaDelItems = await GetHBPOSaDelItemsAsync(id); - - hbpoSas.AddRange(hbpoSaDelItems.hbpoSas); - hbpoSaDetails.AddRange(hbpoSaDelItems.hbpoSaDetails); - hbpoCanSas.AddRange(hbpoSaDelItems.hbpoCanSas); - hbpoCanSaDetails.AddRange(hbpoSaDelItems.hbpoCanSaDetails); - hbpoNotSaDetails.AddRange(hbpoSaDelItems.hbpoNotSaDetails); - } - catch (Exception) + IActionResult result = new JsonResult(new { Code = 400 }); + Version = hbpoSaImportRequestDto.Version; + switch (hbpoSaImportRequestDto.BusinessType) { - throw; + case EnumBusinessType.JisHBPO: + BusinessType = EnumBusinessType.JisHBPO; + result = await ImportJisHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); + break; + case EnumBusinessType.MaiDanJianHBPO: + BusinessType = EnumBusinessType.MaiDanJianHBPO; + result = await ImportMaiDanJianHBPOAsync(hbpoSaImportRequestDto.Files).ConfigureAwait(false); + break; + default: + break; } + return result; } + #endregion - //删除 - if (hbpoSas.Any()) - { - await _hbpoSaRepository.DeleteManyAsync(hbpoSas); - } - if (hbpoSaDetails.Any()) + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) { - await _hbpoSaDetailRepository.DbContext.BulkDeleteAsync(hbpoSaDetails); + input.Filters.RemoveAll(t => t.Column.ToLower() == "site"); + var entities = await _hbpoSaRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _hbpoSaRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); } - if (hbpoCanSas.Any()) - { - await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSas); - } - if (hbpoCanSaDetails.Any()) - { - await _hbpoCanSaDetailRepository.DbContext.BulkDeleteAsync(hbpoCanSaDetails); - } - if (hbpoNotSaDetails.Any()) - { - await _hbpoNotSaDetailRepository.DbContext.BulkDeleteAsync(hbpoNotSaDetails); - } - } - #endregion - #region 私有方法 - /// - /// JisHBPO导入 - /// - private async Task ImportJisHBPOAsync([FromForm] IFormFileCollection files) - { - var exportImporter = new ExportImporter(); - var result = await exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - var importHBOPSaDetails = ObjectMapper.Map, List>(result); - - return await SaDataGroupByPlaceAsync(importHBOPSaDetails).ConfigureAwait(false); - } - - /// - /// 买单件HBPO导入 - /// - private async Task ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files) - { - #region 导入数据转换 - var exportImporter = new ExportImporter(); - var importResults = await exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - var importMaiDanHBPOSaDetails = ObjectMapper.Map, List>(importResults); - #endregion - - return await SaDataGroupByPlaceAsync(importMaiDanHBPOSaDetails).ConfigureAwait(false); - } - - /// - /// 处理结算数据 - /// - private List HandleSaDetails(List hbpoSaDetails) - { - hbpoSaDetails.ForEach(hbpoSaDetail => + /// + /// 删除 + /// + [HttpPost] + public async Task DeleteListAsync(List ids) { - hbpoSaDetail.SetId(GuidGenerator.Create()); - var lus = hbpoSaDetail.LU.Split(new string(' ', 4)).ToList(); - hbpoSaDetail.LU = lus[0].Replace(" ", ""); - if (lus.Count > 1) + //结算主表 + List hbpoSas = new List(); + //结算明细 + List hbpoSaDetails = new List(); + //可结算主表 + List hbpoCanSas = new List(); + //可结算明细 + List hbpoCanSaDetails = new List(); + //不可结算 + List hbpoNotSaDetails = new List(); + + foreach (var id in ids) { - lus.RemoveAt(0); - var luAssemble = lus.Select(t => t.Replace(" ", "")); - hbpoSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + try + { + var hbpoSaDelItems = await GetHBPOSaDelItemsAsync(id).ConfigureAwait(false); + + hbpoSas.AddRange(hbpoSaDelItems.hbpoSas); + hbpoSaDetails.AddRange(hbpoSaDelItems.hbpoSaDetails); + hbpoCanSas.AddRange(hbpoSaDelItems.hbpoCanSas); + hbpoCanSaDetails.AddRange(hbpoSaDelItems.hbpoCanSaDetails); + hbpoNotSaDetails.AddRange(hbpoSaDelItems.hbpoNotSaDetails); + } + catch (Exception) + { + throw; + } } - hbpoSaDetail.PN = Regex.Replace(hbpoSaDetail.PN, "['‘’]", ""); - hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", ""); - hbpoSaDetail.Version = Version; - }); - return GroupPnLu(hbpoSaDetails); - } - - /// - /// 结算数据分组Pn、Lu - /// - private List GroupPnLu(List hbpoSaDetails) - { - return hbpoSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => - { - var hbpoSaDetail = t.First(); - hbpoSaDetail.Qty = t.Sum(t => t.Qty); - return hbpoSaDetail; - }).ToList(); - } - /// - /// 结算数据 Place 分组保存 - /// - /// - /// - private async Task SaDataGroupByPlaceAsync(List hbpoSaDetails) - { - if (!hbpoSaDetails.Any()) - { - return new JsonResult(new { Code = 200, Message = "导入成功" }); + //删除 + if (hbpoSas.Any()) + { + await _hbpoSaRepository.DeleteManyAsync(hbpoSas).ConfigureAwait(false); + } + if (hbpoSaDetails.Any()) + { + await _hbpoSaDetailRepository.DbContext.BulkDeleteAsync(hbpoSaDetails).ConfigureAwait(false); + } + if (hbpoCanSas.Any()) + { + await _hbpoCanSaRepository.DeleteManyAsync(hbpoCanSas).ConfigureAwait(false); + } + if (hbpoCanSaDetails.Any()) + { + await _hbpoCanSaDetailRepository.DbContext.BulkDeleteAsync(hbpoCanSaDetails).ConfigureAwait(false); + } + if (hbpoNotSaDetails.Any()) + { + await _hbpoNotSaDetailRepository.DbContext.BulkDeleteAsync(hbpoNotSaDetails).ConfigureAwait(false); + } } + #endregion - hbpoSaDetails = HandleSaDetails(hbpoSaDetails); + #region 私有方法 + /// + /// JisHBPO导入 + /// + private async Task ImportJisHBPOAsync([FromForm] IFormFileCollection files) + { + var exportImporter = new ExportImporter(); + var result = await exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + var importHBOPSaDetails = ObjectMapper.Map, List>(result); - var cn1HBOPSaDetails = hbpoSaDetails.FindAll(t => t.Place.Contains("CN1")); - var cn5HBOPSaDetails = hbpoSaDetails.FindAll(t => t.Place.Contains("CN5")); + return await SaDataGroupByPlaceAsync(importHBOPSaDetails).ConfigureAwait(false); + } - #region 数据校验 - var checkList = await CheckAsync(hbpoSaDetails).ConfigureAwait(false); - if (checkList.Count > 0) + /// + /// 买单件HBPO导入 + /// + private async Task ImportMaiDanJianHBPOAsync([FromForm] IFormFileCollection files) { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + #region 导入数据转换 + var exportImporter = new ExportImporter(); + var importResults = await exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + var importMaiDanHBPOSaDetails = ObjectMapper.Map, List>(importResults); + #endregion + + return await SaDataGroupByPlaceAsync(importMaiDanHBPOSaDetails).ConfigureAwait(false); } - #endregion - if (cn1HBOPSaDetails.Any()) + /// + /// 处理结算数据 + /// + private List HandleSaDetails(List hbpoSaDetails) { - await InsertSaDataAsync(cn1HBOPSaDetails, "CN1").ConfigureAwait(false); + hbpoSaDetails.ForEach(hbpoSaDetail => + { + hbpoSaDetail.SetId(GuidGenerator.Create()); + var lus = hbpoSaDetail.LU.Split(new string(' ', 4)).ToList(); + hbpoSaDetail.LU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + hbpoSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + } + hbpoSaDetail.PN = Regex.Replace(hbpoSaDetail.PN, "['‘’]", ""); + hbpoSaDetail.CustomerPartCodeNoSpace = hbpoSaDetail.LU.Replace(" ", ""); + hbpoSaDetail.Version = Version; + }); + return GroupPnLu(hbpoSaDetails); } - if (cn5HBOPSaDetails.Any()) + + /// + /// 结算数据分组Pn、Lu + /// + private List GroupPnLu(List hbpoSaDetails) { - await InsertSaDataAsync(cn5HBOPSaDetails, "CN5").ConfigureAwait(false); + return hbpoSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => + { + var hbpoSaDetail = t.First(); + hbpoSaDetail.Qty = t.Sum(t => t.Qty); + return hbpoSaDetail; + }).ToList(); } - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } - /// - /// Insert结算数据 - /// - private async Task InsertSaDataAsync(List hbpoSaDetails, string place) - { - var site = "104T"; - //结算单号 - var hbpoSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); - //结算主表 - var hbpoSa = new HBPO_SA() - { - BillNum = hbpoSaBillNum, - State = "0", - BusinessType = BusinessType, - Site = site, - Place = place, - Version = Version - }; - //可结算单号 - var hbpoCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); - //可结算主表 - var hbpoCanSa = new HBPO_CAN_SA() + /// + /// 结算数据 Place 分组保存 + /// + /// + /// + private async Task SaDataGroupByPlaceAsync(List hbpoSaDetails) { - BillNum = hbpoCanSaBillNum, - InvGroupNum = hbpoCanSaBillNum, - SettleBillNum = hbpoSaBillNum, - State = SettleBillState.未结状态, - BusinessType = BusinessType, - Site = site, - Version = Version - }; - //可结算明细 - var hbpoCanSaDetails = new List(); - //不可结算明细 - var hbpoNotSaDetails = new List(); - //客户零件关系 - var materialRelationships = new List(); - - #region 处理结算数据 - hbpoSaDetails.ForEach(hbpoSaDetail => - { - hbpoSaDetail.SetId(GuidGenerator.Create()); - List lus = hbpoSaDetail.LU.Split(new string(' ', 4)).ToList(); - hbpoSaDetail.LU = lus[0].Replace(" ", ""); - if (lus.Count > 1) + if (!hbpoSaDetails.Any()) { - lus.RemoveAt(0); - var luAssemble = lus.Select(t => t.Replace(" ", "")); - hbpoSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - hbpoSaDetail.BillNum = hbpoSaBillNum; - hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU; - hbpoSaDetail.BusinessType = BusinessType; - hbpoSaDetail.Site = site; - }); - - //导入的零件号集合 - var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); - //销售价格 - var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false) - .Where(t => t.ClientCode == "104T") - .Where(t => importPubSaLUs.Contains(t.LU)).ToList(); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - hbpoSaDetails.ForEach(hbpoSaDetail => - { - //根据物料号、结算日期获取价格 - var priceListEntity = priceListEntitys - .Where(t => t.LU == hbpoSaDetail.LU) - .Where(t => hbpoSaDetail.SettleDate >= t.BeginTime && hbpoSaDetail.SettleDate <= t.EndTime) - .OrderByDescending(t => t.Date) - .ThenByDescending(t => t.CreationTime) - .FirstOrDefault(); - hbpoSaDetail.Price = priceListEntity?.Price ?? 0; - - hbpoSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode; - }); - #endregion + hbpoSaDetails = HandleSaDetails(hbpoSaDetails); - #region 入库数据赋值 - //根据价格区分结算、不可结算 - var hbpoSaDetailsCanSes = hbpoSaDetails.FindAll(t => t.Price != default); - var hbpoSaDetailsNotCanSes = hbpoSaDetails.FindAll(t => t.Price == default); - - //可结算明细 - hbpoCanSaDetails = ObjectMapper.Map, List>(hbpoSaDetailsCanSes); - //不可结算明细 - hbpoNotSaDetails = ObjectMapper.Map, List>(hbpoSaDetailsNotCanSes); - #endregion + var cn1HBOPSaDetails = hbpoSaDetails.FindAll(t => t.Place.Contains("CN1")); + var cn5HBOPSaDetails = hbpoSaDetails.FindAll(t => t.Place.Contains("CN5")); - #region 添加入库 - await _hbpoSaRepository.InsertAsync(hbpoSa).ConfigureAwait(false); - await _hbpoSaDetailRepository.DbContext.BulkInsertAsync(hbpoSaDetails).ConfigureAwait(false); - if (hbpoCanSaDetails.Count > 0) - { - hbpoCanSaDetails.ForEach(hbpoCanSaDetail => + #region 数据校验 + var checkList = await CheckAsync(hbpoSaDetails).ConfigureAwait(false); + if (checkList.Count > 0) { - hbpoCanSaDetail.BillNum = hbpoCanSaDetail.InvGroupNum = hbpoCanSaBillNum; - }); + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + } + #endregion - await _hbpoCanSaRepository.InsertAsync(hbpoCanSa).ConfigureAwait(false); - await _hbpoCanSaDetailRepository.DbContext.BulkInsertAsync(hbpoCanSaDetails).ConfigureAwait(false); - } - if (hbpoNotSaDetails.Count > 0) - { - await _hbpoNotSaDetailRepository.DbContext.BulkInsertAsync(hbpoNotSaDetails).ConfigureAwait(false); - } - if (materialRelationships.Count > 0) - { - await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false); + if (cn1HBOPSaDetails.Any()) + { + await InsertSaDataAsync(cn1HBOPSaDetails, "CN1").ConfigureAwait(false); + } + if (cn5HBOPSaDetails.Any()) + { + await InsertSaDataAsync(cn5HBOPSaDetails, "CN5").ConfigureAwait(false); + } + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - #endregion - } - /// - /// 获取结算关联项 - /// - private async Task<(List hbpoSas, List hbpoSaDetails, List hbpoCanSas, List hbpoCanSaDetails, List hbpoNotSaDetails)> GetHBPOSaDelItemsAsync(Guid id) - { - //结算主表 - var hbpoSas = new List(); - //结算明细 - var hbpoSaDetails = new List(); - //可结算主表 - var hbpoCanSas = new List(); - //可结算明细 - var hbpoCanSaDetails = new List(); - //不可结算 - var hbpoNotSaDetails = new List(); - - var hbpoSaEntity = await _hbpoSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false); - if (hbpoSaEntity != null) + /// + /// Insert结算数据 + /// + private async Task InsertSaDataAsync(List hbpoSaDetails, string place) { - //结算单据 - string hbpoSaBillNum = hbpoSaEntity.BillNum; + var site = "104T"; + //结算单号 + var hbpoSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); + //结算主表 + var hbpoSa = new HBPO_SA() + { + BillNum = hbpoSaBillNum, + State = "0", + BusinessType = BusinessType, + Site = site, + Place = place, + Version = Version + }; + //可结算单号 + var hbpoCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); + //可结算主表 + var hbpoCanSa = new HBPO_CAN_SA() + { + BillNum = hbpoCanSaBillNum, + InvGroupNum = hbpoCanSaBillNum, + SettleBillNum = hbpoSaBillNum, + State = SettleBillState.未结状态, + BusinessType = BusinessType, + Site = site, + Version = Version + }; + //可结算明细 + var hbpoCanSaDetails = new List(); + //不可结算明细 + var hbpoNotSaDetails = new List(); + //客户零件关系 + var materialRelationships = new List(); + + #region 处理结算数据 + hbpoSaDetails.ForEach(hbpoSaDetail => + { + hbpoSaDetail.SetId(GuidGenerator.Create()); + List lus = hbpoSaDetail.LU.Split(new string(' ', 4)).ToList(); + hbpoSaDetail.LU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + hbpoSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + } + + hbpoSaDetail.BillNum = hbpoSaBillNum; + hbpoSaDetail.KeyCode = hbpoSaDetail.PN + hbpoSaDetail.LU; + hbpoSaDetail.BusinessType = BusinessType; + hbpoSaDetail.Site = site; + }); - hbpoCanSas = await _hbpoCanSaRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum).ConfigureAwait(false); - //验证可结算主表状态 - if (hbpoCanSas.Any() && hbpoCanSas.Any(t => t.State != SettleBillState.未结状态)) + //导入的零件号集合 + var importPubSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); + //销售价格 + var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false) + .Where(t => t.ClientCode == "104T") + .Where(t => importPubSaLUs.Contains(t.LU)).ToList(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + hbpoSaDetails.ForEach(hbpoSaDetail => { - throw new UserFriendlyException($"{hbpoSaBillNum} 该单据可结算单状态无法删除!", "400"); - } + //根据物料号、结算日期获取价格 + var priceListEntity = priceListEntitys + .Where(t => t.LU == hbpoSaDetail.LU) + .Where(t => hbpoSaDetail.SettleDate >= t.BeginTime && hbpoSaDetail.SettleDate <= t.EndTime) + .OrderByDescending(t => t.Date) + .ThenByDescending(t => t.CreationTime) + .FirstOrDefault(); + hbpoSaDetail.Price = priceListEntity?.Price ?? 0; + + hbpoSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == hbpoSaDetail.LU)?.ErpMaterialCode; + }); + #endregion + + #region 入库数据赋值 + //根据价格区分结算、不可结算 + var hbpoSaDetailsCanSes = hbpoSaDetails.FindAll(t => t.Price != default); + var hbpoSaDetailsNotCanSes = hbpoSaDetails.FindAll(t => t.Price == default); + + //可结算明细 + hbpoCanSaDetails = ObjectMapper.Map, List>(hbpoSaDetailsCanSes); + //不可结算明细 + hbpoNotSaDetails = ObjectMapper.Map, List>(hbpoSaDetailsNotCanSes); + #endregion + + #region 添加入库 + await _hbpoSaRepository.InsertAsync(hbpoSa).ConfigureAwait(false); + await _hbpoSaDetailRepository.DbContext.BulkInsertAsync(hbpoSaDetails).ConfigureAwait(false); + if (hbpoCanSaDetails.Count > 0) + { + hbpoCanSaDetails.ForEach(hbpoCanSaDetail => + { + hbpoCanSaDetail.BillNum = hbpoCanSaDetail.InvGroupNum = hbpoCanSaBillNum; + }); - hbpoSas.Add(hbpoSaEntity); - hbpoSaDetails = await _hbpoSaDetailRepository.GetListAsync(t => t.BillNum == hbpoSaBillNum); - hbpoCanSaDetails = await _hbpoCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum); - hbpoNotSaDetails = await _hbpoNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum); + await _hbpoCanSaRepository.InsertAsync(hbpoCanSa).ConfigureAwait(false); + await _hbpoCanSaDetailRepository.DbContext.BulkInsertAsync(hbpoCanSaDetails).ConfigureAwait(false); + } + if (hbpoNotSaDetails.Count > 0) + { + await _hbpoNotSaDetailRepository.DbContext.BulkInsertAsync(hbpoNotSaDetails).ConfigureAwait(false); + } + if (materialRelationships.Count > 0) + { + await _materialRelationshipRepository.InsertManyAsync(materialRelationships).ConfigureAwait(false); + } + #endregion } - return (hbpoSas, hbpoSaDetails, hbpoCanSas, hbpoCanSaDetails, hbpoNotSaDetails); - } - - /// - /// 数据校验 - /// - private async Task> CheckAsync(List hbpoSaDetails) - { - #region 数据校验 - //数据校验 - var checkList = new List(); - //结算分组号 - var saGroupNums = hbpoSaDetails.Select(t => t.GroupNum).Distinct(); - //已存在的结算分组号 - var havPubSaGroupNums = (await _hbpoSaDetailRepository.GetListAsync(t => saGroupNums.Contains(t.GroupNum))).Select(t => t.GroupNum).Distinct(); - if (havPubSaGroupNums.Any() == true) + /// + /// 获取结算关联项 + /// + private async Task<(List hbpoSas, List hbpoSaDetails, List hbpoCanSas, List hbpoCanSaDetails, List hbpoNotSaDetails)> GetHBPOSaDelItemsAsync(Guid id) { - foreach (var item in havPubSaGroupNums) + //结算主表 + var hbpoSas = new List(); + //结算明细 + var hbpoSaDetails = new List(); + //可结算主表 + var hbpoCanSas = new List(); + //可结算明细 + var hbpoCanSaDetails = new List(); + //不可结算 + var hbpoNotSaDetails = new List(); + + var hbpoSaEntity = await _hbpoSaRepository.FirstOrDefaultAsync(t => t.Id.Equals(id)).ConfigureAwait(false); + if (hbpoSaEntity != null) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); + //结算单据 + string hbpoSaBillNum = hbpoSaEntity.BillNum; + + hbpoCanSas = await _hbpoCanSaRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum).ConfigureAwait(false); + //验证可结算主表状态 + if (hbpoCanSas.Any() && hbpoCanSas.Any(t => t.State != SettleBillState.未结状态)) + { + throw new UserFriendlyException($"{hbpoSaBillNum} 该单据可结算单状态无法删除!", "400"); + } + + hbpoSas.Add(hbpoSaEntity); + hbpoSaDetails = await _hbpoSaDetailRepository.GetListAsync(t => t.BillNum == hbpoSaBillNum).ConfigureAwait(false); + hbpoCanSaDetails = await _hbpoCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum).ConfigureAwait(false); + hbpoNotSaDetails = await _hbpoNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == hbpoSaBillNum).ConfigureAwait(false); } + + return (hbpoSas, hbpoSaDetails, hbpoCanSas, hbpoCanSaDetails, hbpoNotSaDetails); } - if (!checkList.Any()) + /// + /// 数据校验 + /// + private async Task> CheckAsync(List hbpoSaDetails) { - //验证客户对应厂内零件号是否存在 - //导入的零件号集合 - var importSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + #region 数据校验 + //数据校验 + var checkList = new List(); + //结算分组号 + var saGroupNums = hbpoSaDetails.Select(t => t.GroupNum).Distinct(); + //已存在的结算分组号 + var havPubSaGroupNums = (await _hbpoSaDetailRepository.GetListAsync(t => saGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct(); + if (havPubSaGroupNums.Any() == true) + { + foreach (var item in havPubSaGroupNums) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); + } + } - //不存在的客户零件号(差集) - var noExistSettleMaterialCodes = importSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); - noExistSettleMaterialCodes.ForEach(t => + if (!checkList.Any()) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); - }); - } + //验证客户对应厂内零件号是否存在 + //导入的零件号集合 + var importSaLUs = hbpoSaDetails.Select(t => t.LU).Distinct(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == BusinessType && importSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + + //不存在的客户零件号(差集) + var noExistSettleMaterialCodes = importSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); + noExistSettleMaterialCodes.ForEach(t => + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); + }); + } - return checkList; + return checkList; + #endregion + } #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs index 7869efee..39d8cfb6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_DETAIL_SERVICE.cs @@ -1,10 +1,10 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; using Shouldly; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; @@ -31,7 +31,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// private readonly IExcelImportAppService _excelImportService; - public HBPO_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) + public HBPO_SE_DETAIL_SERVICE(INormalEfCoreRepository repository, IExcelImportAppService excelImportService) { _repository = repository; _excelImportService = excelImportService; @@ -45,14 +45,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task ExportAsync(RequestDto input) { string fileName = $"JisHBPO发运数据_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); return fileName; } #endregion @@ -64,8 +64,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] public async Task> GetListAsync(RequestDto input) { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs index c816622b..bcf411e3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/HBPO_SE_EDI_SERVICE.cs @@ -1,10 +1,10 @@ -using Microsoft.AspNetCore.Authorization; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; using Shouldly; -using System; -using System.Collections.Generic; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Win.Sfs.BaseData.ImportExcelCommon; @@ -48,14 +48,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public async Task ExportAsync(RequestDto input) { string fileName = $"HBPO的EDI数据_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); return fileName; } #endregion @@ -67,8 +67,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [HttpPost] public async Task> GetListAsync(RequestDto input) { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index 4e96e232..0995e662 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -1,9 +1,9 @@ -using CodeArts.Db; -using DocumentFormat.OpenXml.Bibliography; -using DocumentFormat.OpenXml.Drawing.Diagrams; -using DocumentFormat.OpenXml.Office.Drawing; -using DocumentFormat.OpenXml.Spreadsheet; -using DocumentFormat.OpenXml.Wordprocessing; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; @@ -11,21 +11,10 @@ using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using NPOI.HPSF; using SettleAccount.Domain.BQ; using Shouldly; using SqlSugar; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Management; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -35,7 +24,6 @@ using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; -using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; @@ -94,11 +82,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public virtual async Task ApprovalPassed(List p_invs) { List errors = new List(); - var invs = await _invMng.GetInvoiceListAsync(p_invs); + var invs = await _invMng.GetInvoiceListAsync(p_invs).ConfigureAwait(false); if (invs.Count > 0) { var ls = invs.Where(p => p.State != SettleBillState.商务已审核).Distinct(); - if (ls.Count() > 0) + if (ls.Any()) { foreach (var itm in ls) { @@ -113,21 +101,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ errors.Add(new ERR_EXP_DTO() { Message = $"{itm.InvbillNum}发票号状态不是商务审核!" }); } } - if (errors.Count() > 0) + if (errors.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errors).ConfigureAwait(false) }); } } - await _invMng.SetForwardState(p_invs, SettleBillState.财务已审核); + await _invMng.SetForwardState(p_invs, SettleBillState.财务已审核).ConfigureAwait(false); return new JsonResult(new { Code = "200", Message = "审核成功" }); } [HttpPost] - public virtual async Task UpdateInvoice(string invbill,string remark) + public virtual async Task UpdateInvoice(string invbill, string remark) { - var sucess= await _invMng.UpdateInvoiceAsync(invbill,remark); + var sucess = await _invMng.UpdateInvoiceAsync(invbill, remark).ConfigureAwait(false); if (sucess) { - return new JsonResult(new { Code = 200, Message = "更新成功" }); + return new JsonResult(new { Code = 200, Message = "更新成功" }); } return new JsonResult(new { Code = 400, Message = "更新失败" }); } @@ -141,8 +129,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //[Route("mainquery")] public virtual async Task> MainQueryAsync(INVOICE_GRP_REQ_DTO input) { - var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entitys = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entitys); foreach (var itm in dtos) { @@ -159,17 +147,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public virtual async Task DetailQueryAsync(INVOICE_GRP_REQ_DTO input) { INVOICE_GRP_DETAIL_DTO entity = new INVOICE_GRP_DETAIL_DTO(); - var materialList = await _baseservice.GetMaterialList(); - var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); - var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); + var invs = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); + var m = await _mRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var mdtos = ObjectMapper.Map, List>(m); var first = invs.FirstOrDefault(); - - if (invs.FirstOrDefault().BusinessType == EnumBusinessType.JisBBAC) { - var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var A = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var AMap = ObjectMapper.Map, List>(A); var wquery = from itm in AMap join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum @@ -198,7 +184,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else if (invs.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) { - var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var B = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); B.OrderBy(p => p.LineCode); var BMap = ObjectMapper.Map, List>(B); @@ -231,7 +217,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ else { - var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var w = await _wRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var wdtos = ObjectMapper.Map, List>(w); var wquery = from itm in wdtos join itm1 in invs on itm.InvbillNum equals itm1.InvbillNum @@ -259,9 +245,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ }; entity.INVOICE_WAIT_DETAIL = wquery.OrderBy(p => p.LU).ToList(); } - var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var s = await _sRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); var sdtos = ObjectMapper.Map, List>(s);//不可结 - var adjs = await _adjRepository.GetListByFilterAsync(input.Filters);//调整数据 + var adjs = await _adjRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false);//调整数据 var adjdtos = ObjectMapper.Map, List>(adjs);//调整数据DTO var notquery = from itm in sdtos @@ -306,7 +292,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Price = itm.Price }; - entity.INVOICE_NOT_SETTLE = notquery.OrderBy(p=>p.SettleGroupNum).ThenBy(p=>p.LU).ToList(); + entity.INVOICE_NOT_SETTLE = notquery.OrderBy(p => p.SettleGroupNum).ThenBy(p => p.LU).ToList(); var lscompare = entity.INVOICE_NOT_SETTLE.GroupBy(x => new { x.InvBillNum, x.SettleGroupNum }).Select(p => new INVOICE_MAP_GROUP_DTO() @@ -337,8 +323,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { entity.INVOICE_MAP_GROUP = mdtos; } - - entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p=>p.GroupNum).ThenBy(p=>p.LU).ToList(); + + entity.ADJ_DETAIL = adjQuery.ToList().OrderBy(p => p.GroupNum).ThenBy(p => p.LU).ToList(); return entity; } [HttpPost] @@ -346,7 +332,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); foreach (var itm in dtoDetails) { @@ -354,9 +340,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; - byte[] result = null; - - result = await _excel.ExportAsByteArray(dtoDetails); + var result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); //switch (input.FileType) //{ // case 0: @@ -375,7 +359,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } @@ -389,20 +373,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { IExporter _csv = new CsvExporter(); ExcelExporter _excel = new ExcelExporter(); - var materialList = await _baseservice.GetMaterialList(); - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var first=entities.FirstOrDefault(); + var materialList = await _baseservice.GetMaterialList().ConfigureAwait(false); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var first = entities.FirstOrDefault(); var dtoDetails = ObjectMapper.Map, List>(entities); - var invdetail= await DetailQueryAsync(input); + var invdetail = await DetailQueryAsync(input).ConfigureAwait(false); var m = invdetail.INVOICE_MAP_GROUP; - var not=invdetail.INVOICE_NOT_SETTLE;//零件结算对应关系 - var detail =invdetail.INVOICE_WAIT_DETAIL;//常规明细 + var not = invdetail.INVOICE_NOT_SETTLE;//零件结算对应关系 + var detail = invdetail.INVOICE_WAIT_DETAIL;//常规明细 var adj = invdetail.ADJ_DETAIL;//调整表 var bbac = invdetail.INVOICE_WAIT_DETAIL_BBAC;//BBACJIS明细 var bj = invdetail.INVOICE_WAIT_DETAIL_BJ;//备件明细 var unsettle = invdetail.UNSETTLED_DETAIL;//全部未结明细 - var classDisplayName = typeof(INVOICE_GRP_DTO).GetCustomAttribute()?.Name ?? typeof(INVOICE_GRP_DTO).Name; string _fileName = $"{classDisplayName}_{Guid.NewGuid().ToString()}.xlsx"; @@ -413,7 +396,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else if (entities.FirstOrDefault().BusinessType == EnumBusinessType.BeiJian) { - + _excel.Append(bj, "发票明细"); } else @@ -425,7 +408,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { _excel.Append(m, "发票结算分组对应");//发票分组对应结算号 } - if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC ) + if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC) { _excel.Append(unsettle, "未结零件结算汇总"); } @@ -434,9 +417,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ _excel.Append(unsettle, "未结零件列表"); } - - - foreach (var itm in entities) { var mgroup = m.Where(p => p.InvbillNum == itm.InvbillNum).ToList(); @@ -529,7 +509,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } _excel.Append(adjp, "发票调整数据" + itm.InvbillNum).SeparateBySheet(); } - + var result = _excel.ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制 @@ -539,37 +519,37 @@ namespace Win.Sfs.SettleAccount.Entities.BQ Name = _fileName, Content = result.Result } - ); + ).ConfigureAwait(false); return _fileName; } [HttpPost] public virtual async Task RejectAsync([FromBody] string p_invGroupNum) { - var entities=await _invMng.GetMainListAsync(p_invGroupNum); - var entity=entities.FirstOrDefault(); - bool state = await _invMng.Reject(p_invGroupNum); + var entities = await _invMng.GetMainListAsync(p_invGroupNum).ConfigureAwait(false); + var entity = entities.FirstOrDefault(); + bool state = await _invMng.Reject(p_invGroupNum).ConfigureAwait(false); if (state == true) { switch (entity.BusinessType) { case EnumBusinessType.BeiJian: - await _pubMng.SetNewState(p_invGroupNum); + await _pubMng.SetNewState(p_invGroupNum).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - await _pubMng.SetNewState(p_invGroupNum); + await _pubMng.SetNewState(p_invGroupNum).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianHBPO: - await _pubMng.SetNewState(p_invGroupNum); + await _pubMng.SetNewState(p_invGroupNum).ConfigureAwait(false); break; case EnumBusinessType.YinDuJian: - await _pubMng.SetNewState(p_invGroupNum); + await _pubMng.SetNewState(p_invGroupNum).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - await _bbacMng.SetNewState(p_invGroupNum); + await _bbacMng.SetNewState(p_invGroupNum).ConfigureAwait(false); break; case EnumBusinessType.JisHBPO: - await _hbpoMng.SetNewState(p_invGroupNum); + await _hbpoMng.SetNewState(p_invGroupNum).ConfigureAwait(false); break; } } @@ -594,11 +574,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// [HttpPost] [DisableRequestSizeLimit] - + public async Task ExcelImport([FromForm] IFormFileCollection files) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var ls = ObjectMapper.Map, List>(result); var namelist = ls.Select(p => p.InvbillNum).Distinct(); var invlist = _repository.Where(p => namelist.Contains(p.InvbillNum)).ToList(); @@ -612,16 +592,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //inv.TaxAmt = inv.Amt+ Math.Round(inv.Amt * newinv.Tax, 2); inv.RealnvBillNum = newinv.RealnvBillNum; // inv.RealAmt = newinv.RealAmt; - inv.TaxDiff =newinv.PreTaxDiff; + inv.TaxDiff = newinv.PreTaxDiff; - // inv.ClientCode = newinv.ClientCode; + // inv.ClientCode = newinv.ClientCode; } foreach (var detail in invdetail) { detail.Extend1 = Math.Round(detail.Amt * first.Tax, 2).ToString(); } - await _repository.DbContext.BulkUpdateAsync(invlist); - await _repository.DbContext.BulkUpdateAsync(invdetail); + await _repository.DbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); + await _repository.DbContext.BulkUpdateAsync(invdetail).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs index e5ea8327..bb126bed 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobHostdService.cs @@ -19,310 +19,311 @@ using SettleAccount.Job.SignalR; using Volo.Abp.Application.Services; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -public class JobHostdService : BackgroundService, IApplicationService +namespace Win.Sfs.SettleAccount.Entities.BQ { - private readonly object _lockObj = new object(); - private readonly IServiceProvider _serviceProvider; - private FileSystemWatcher _watcher; - private CancellationToken _stoppingToken; - - public JobHostdService(IServiceProvider serviceProvider) + public class JobHostdService : BackgroundService, IApplicationService { - this._serviceProvider = serviceProvider; - } + private readonly object _lockObj = new object(); + private readonly IServiceProvider _serviceProvider; + private FileSystemWatcher _watcher; + private CancellationToken _stoppingToken; - public override Task StartAsync(CancellationToken cancellationToken) - { - var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"); - var filter = "*.js"; - this._watcher = new FileSystemWatcher(path, filter); - this._watcher.NotifyFilter = NotifyFilters.Attributes - | NotifyFilters.CreationTime - | NotifyFilters.DirectoryName - | NotifyFilters.FileName - | NotifyFilters.LastAccess - | NotifyFilters.LastWrite - | NotifyFilters.Security - | NotifyFilters.Size; - this._watcher.Created += _watcher_Created; - this._watcher.Deleted += _watcher_Created; - this._watcher.Changed += _watcher_Created; - this._watcher.Renamed += _watcher_Created; - this._watcher.IncludeSubdirectories = true; - this._watcher.EnableRaisingEvents = true; - return base.StartAsync(cancellationToken); - } + public JobHostdService(IServiceProvider serviceProvider) + { + this._serviceProvider = serviceProvider; + } - private void _watcher_Created(object sender, FileSystemEventArgs e) - { - using var scope = this._serviceProvider.CreateScope(); - scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("Refresh", e.FullPath, ""); - } + public override Task StartAsync(CancellationToken cancellationToken) + { + var path = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"); + var filter = "*.js"; + this._watcher = new FileSystemWatcher(path, filter); + this._watcher.NotifyFilter = NotifyFilters.Attributes + | NotifyFilters.CreationTime + | NotifyFilters.DirectoryName + | NotifyFilters.FileName + | NotifyFilters.LastAccess + | NotifyFilters.LastWrite + | NotifyFilters.Security + | NotifyFilters.Size; + this._watcher.Created += _watcher_Created; + this._watcher.Deleted += _watcher_Created; + this._watcher.Changed += _watcher_Created; + this._watcher.Renamed += _watcher_Created; + this._watcher.IncludeSubdirectories = true; + this._watcher.EnableRaisingEvents = true; + return base.StartAsync(cancellationToken); + } - public override Task StopAsync(CancellationToken cancellationToken) - { - this._watcher?.Dispose(); - return base.StopAsync(cancellationToken); - } + private void _watcher_Created(object sender, FileSystemEventArgs e) + { + using var scope = this._serviceProvider.CreateScope(); + scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("Refresh", e.FullPath, ""); + } - public static List ServiceTypes { get; private set; } - public ConcurrentDictionary> Jobs { get; } = new(); + public override Task StopAsync(CancellationToken cancellationToken) + { + this._watcher?.Dispose(); + return base.StopAsync(cancellationToken); + } - public static void AddService(IServiceCollection services) - { - ServiceTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(o => o.GetTypes()) - .Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService))) - .ToList(); - ServiceTypes.ForEach(o => + public static List ServiceTypes { get; private set; } + public ConcurrentDictionary> Jobs { get; } = new(); + + public static void AddService(IServiceCollection services) { - services.AddTransient(typeof(IJobService), o); - services.AddTransient(o); - }); - } + ServiceTypes = AppDomain.CurrentDomain.GetAssemblies().SelectMany(o => o.GetTypes()) + .Where(o => o.IsClass && !o.IsAbstract && o.IsAssignableTo(typeof(IJobService))) + .ToList(); + ServiceTypes.ForEach(o => + { + services.AddTransient(typeof(IJobService), o); + services.AddTransient(o); + }); + } - public void AddJob(JobItem job) - { - lock (_lockObj) + public void AddJob(JobItem job) { - if (!Jobs.Keys.Any(o => o.Id == job.Id)) + lock (_lockObj) { - try + if (!Jobs.Keys.Any(o => o.Id == job.Id)) { - var source = new CancellationTokenSource(); - var token = source.Token; - var thread = new Thread(async () => + try { - try + var source = new CancellationTokenSource(); + var token = source.Token; + var thread = new Thread(async () => { - var expression = CronExpression.Parse(job.Cron, job.Cron.Split(' ').Length == 5 ? CronFormat.Standard : CronFormat.IncludeSeconds); - var serviceType = ServiceTypes.FirstOrDefault(o => o.FullName == job.Service); - if (serviceType != null) + try { - while (!_stoppingToken.IsCancellationRequested && !token.IsCancellationRequested) + var expression = CronExpression.Parse(job.Cron, job.Cron.Split(' ').Length == 5 ? CronFormat.Standard : CronFormat.IncludeSeconds); + var serviceType = ServiceTypes.FirstOrDefault(o => o.FullName == job.Service); + if (serviceType != null) { - try + while (!_stoppingToken.IsCancellationRequested && !token.IsCancellationRequested) { - var now = DateTime.UtcNow; - var nextUtc = expression.GetNextOccurrence(now); - var span = nextUtc - now; - if (span != null && (int)span.Value.TotalMilliseconds > 0) + try { - var delay = (int)span.Value.TotalMilliseconds; - while (delay > 0) - { - var currentDelay = delay > int.MaxValue ? int.MaxValue : delay; - delay -= currentDelay; - await Task.Delay(currentDelay).ConfigureAwait(false); - } - Debug.WriteLine($"{job.Name} 定时任务开始执行"); - using var scope = this._serviceProvider.CreateScope(); - if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService) + var now = DateTime.UtcNow; + var nextUtc = expression.GetNextOccurrence(now); + var span = nextUtc - now; + if (span != null && (int)span.Value.TotalMilliseconds > 0) { - if (!job.IsDisabled) + var delay = (int)span.Value.TotalMilliseconds; + while (delay > 0) { - var jobItem = this.GetJobItem(job.Id); - Guid? jobLogId = null; - if (jobItem.IsRunning && (DateTime.Now - jobItem.HeartBeat.Value).TotalSeconds > 20) - { - JobItemStop(jobItem.Id); - } - if (!jobItem.IsRunning) + var currentDelay = delay > int.MaxValue ? int.MaxValue : delay; + delay -= currentDelay; + await Task.Delay(currentDelay).ConfigureAwait(false); + } + Debug.WriteLine($"{job.Name} 定时任务开始执行"); + using var scope = this._serviceProvider.CreateScope(); + if (scope.ServiceProvider.GetService(serviceType) is IJobService jobService) + { + if (!job.IsDisabled) { - jobLogId = this.JobItemStart(job.Id); - using var timer = new System.Timers.Timer(10000); - if (jobLogId.HasValue) + var jobItem = this.GetJobItem(job.Id); + Guid? jobLogId = null; + if (jobItem.IsRunning && (DateTime.Now - jobItem.HeartBeat.Value).TotalSeconds > 20) { - try - { - timer.Elapsed += (s, e) => JobItemHeartBeat(job.Id); - timer.Start(); - scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("JobItem", "refresh", ""); - await jobService.Invoke(scope.ServiceProvider).ConfigureAwait(false); - this.JobItemSuccess(job.Id, jobLogId.Value); - Debug.WriteLine($"{job.Name} 定时任务执行成功"); - } - catch (Exception ex) - { - Debug.WriteLine($"{job.Name} 定时任务执行失败:{ex.Message}"); - Console.WriteLine(ex.ToString()); - this.JobItemFaild(job.Id, jobLogId.Value, ex); - } - finally + JobItemStop(jobItem.Id); + } + if (!jobItem.IsRunning) + { + jobLogId = this.JobItemStart(job.Id); + using var timer = new System.Timers.Timer(10000); + if (jobLogId.HasValue) { - timer.Stop(); - scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("JobItem", "refresh", ""); + try + { + timer.Elapsed += (s, e) => JobItemHeartBeat(job.Id); + timer.Start(); + scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("JobItem", "refresh", ""); + await jobService.Invoke(scope.ServiceProvider).ConfigureAwait(false); + this.JobItemSuccess(job.Id, jobLogId.Value); + Debug.WriteLine($"{job.Name} 定时任务执行成功"); + } + catch (Exception ex) + { + Debug.WriteLine($"{job.Name} 定时任务执行失败:{ex.Message}"); + Console.WriteLine(ex.ToString()); + this.JobItemFaild(job.Id, jobLogId.Value, ex); + } + finally + { + timer.Stop(); + scope.ServiceProvider.GetRequiredService>().Clients.All.ServerToClient("JobItem", "refresh", ""); + } } } } } } } - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } } } } - } - catch (CronFormatException ex) + catch (CronFormatException ex) + { + Console.WriteLine($"{job.Name},Cron解析失败:{ex.Message},{ex.ToString()}"); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + } + }) { - Console.WriteLine($"{job.Name},Cron解析失败:{ex.Message},{ex.ToString()}"); - } - catch (Exception ex) + IsBackground = true + }; + if (this.Jobs.TryAdd(job, new Tuple(source, thread))) { - Console.WriteLine(ex.ToString()); + thread.Start(); + Debug.WriteLine($"{job.Name} 定时任务线程启动"); } - }) - { - IsBackground = true - }; - if (this.Jobs.TryAdd(job, new Tuple(source, thread))) + } + catch (Exception ex) { - thread.Start(); - Debug.WriteLine($"{job.Name} 定时任务线程启动"); + Console.WriteLine(ex.ToString()); } } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); - } } } - } - private void JobItemFaild(Guid id, Guid jobLogId, Exception ex) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var entity = db.Set().FirstOrDefault(o => o.Id == id); - if (entity != null) + private void JobItemFaild(Guid id, Guid jobLogId, Exception ex) { - entity.IsRunning = false; - var log = db.Set().FirstOrDefault(o => o.Id == jobLogId); - log.End = DateTime.Now; - log.Success = false; - log.Exception = ex.ToString(); - db.SaveChanges(); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.IsRunning = false; + var log = db.Set().FirstOrDefault(o => o.Id == jobLogId); + log.End = DateTime.Now; + log.Success = false; + log.Exception = ex.ToString(); + db.SaveChanges(); + } } - } - private void JobItemSuccess(Guid id, Guid jobLogId) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var entity = db.Set().FirstOrDefault(o => o.Id == id); - if (entity != null) + private void JobItemSuccess(Guid id, Guid jobLogId) { - entity.IsRunning = false; - var log = db.Set().FirstOrDefault(o => o.Id == jobLogId); - if (log != null) + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) { - log.End = DateTime.Now; - log.Success = true; + entity.IsRunning = false; + var log = db.Set().FirstOrDefault(o => o.Id == jobLogId); + if (log != null) + { + log.End = DateTime.Now; + log.Success = true; + } + db.SaveChanges(); } - db.SaveChanges(); } - } - private void JobItemStop(Guid id) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var entity = db.Set().FirstOrDefault(o => o.Id == id); - if (entity != null) + private void JobItemStop(Guid id) { - entity.IsRunning = false; - var log = db.Set().Where(o => o.JobId == id && o.End == null).OrderByDescending(o => o.Start).FirstOrDefault(); - log.Success = false; - log.Exception = "心跳超时,自动停止"; - db.SaveChanges(); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.IsRunning = false; + var log = db.Set().Where(o => o.JobId == id && o.End == null).OrderByDescending(o => o.Start).FirstOrDefault(); + log.Success = false; + log.Exception = "心跳超时,自动停止"; + db.SaveChanges(); + } } - } - private Guid? JobItemStart(Guid id) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var entity = db.Set().FirstOrDefault(o => o.Id == id); - if (entity != null) + private Guid? JobItemStart(Guid id) { - entity.IsRunning = true; - entity.HeartBeat = DateTime.Now; - var log = db.Set().Add(new JobLog { Start = DateTime.Now, JobId = entity.Id, Host = Dns.GetHostName() }); - db.SaveChanges(); - return log.Entity.Id; + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.IsRunning = true; + entity.HeartBeat = DateTime.Now; + var log = db.Set().Add(new JobLog { Start = DateTime.Now, JobId = entity.Id, Host = Dns.GetHostName() }); + db.SaveChanges(); + return log.Entity.Id; + } + return null; } - return null; - } - private JobItem GetJobItem(Guid id) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var repo = db.Set(); - return repo.FirstOrDefault(o => o.Id == id); - } + private JobItem GetJobItem(Guid id) + { + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var repo = db.Set(); + return repo.FirstOrDefault(o => o.Id == id); + } - private void JobItemHeartBeat(Guid id) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var entity = db.Set().FirstOrDefault(o => o.Id == id); - if (entity != null) + private void JobItemHeartBeat(Guid id) { - entity.HeartBeat = DateTime.Now; - db.SaveChanges(); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var entity = db.Set().FirstOrDefault(o => o.Id == id); + if (entity != null) + { + entity.HeartBeat = DateTime.Now; + db.SaveChanges(); + } } - } - public void RemoveJob(JobItem item) - { - lock (_lockObj) + public void RemoveJob(JobItem item) { - var key = this.Jobs.Keys.FirstOrDefault(o => o.Id == item.Id); - if (key != null) + lock (_lockObj) { - try + var key = this.Jobs.Keys.FirstOrDefault(o => o.Id == item.Id); + if (key != null) { - if (this.Jobs.TryRemove(key, out var value)) + try { - value.Item1.Cancel(); - value.Item2.Interrupt(); - value.Item2.Join(); + if (this.Jobs.TryRemove(key, out var value)) + { + value.Item1.Cancel(); + value.Item2.Interrupt(); + value.Item2.Join(); + } + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); } - } - catch (Exception ex) - { - Console.WriteLine(ex.ToString()); } } } - } - protected override Task ExecuteAsync(CancellationToken stoppingToken) - { - this._stoppingToken = stoppingToken; - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var db = new SettleAccountDbContext(options); - var jobs = db.Set().ToList(); - jobs.ForEach(this.AddJob); - return Task.CompletedTask; + protected override Task ExecuteAsync(CancellationToken stoppingToken) + { + this._stoppingToken = stoppingToken; + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var db = new SettleAccountDbContext(options); + var jobs = db.Set().ToList(); + jobs.ForEach(this.AddJob); + return Task.CompletedTask; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs index 0a71ef90..eae89e5e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/JobItemAppService.cs @@ -14,108 +14,109 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -[Route("api/settleaccount/[controller]/[action]")] -public class JobItemAppService : ApplicationService, ITransientDependency +namespace Win.Sfs.SettleAccount.Entities.BQ { - private readonly INormalEfCoreRepository _repository; - private readonly JobHostdService _jobHostdService; - private readonly IHubContext _hubContext; - - public JobItemAppService(INormalEfCoreRepository repository, JobHostdService jobHostdService, IHubContext hubContext) - { - this._repository = repository; - this._jobHostdService = jobHostdService; - this._hubContext = hubContext; - } - - [HttpPost] - public async Task CreateAsync(JobItem input) + [Route("api/settleaccount/[controller]/[action]")] + public class JobItemAppService : ApplicationService, ITransientDependency { - var entity = await _repository.InsertAsync(input).ConfigureAwait(false); - this._jobHostdService.AddJob(entity); - this.Notify(); - return entity; - } + private readonly INormalEfCoreRepository _repository; + private readonly JobHostdService _jobHostdService; + private readonly IHubContext _hubContext; - [HttpPost] - public async Task DeleteListAsync(List ids) - { - var entites = _repository.Where(p => ids.Contains(p.Id)).ToList(); - foreach (var item in entites) + public JobItemAppService(INormalEfCoreRepository repository, JobHostdService jobHostdService, IHubContext hubContext) { - await _repository.DeleteAsync(item).ConfigureAwait(false); - this._jobHostdService.RemoveJob(item); + this._repository = repository; + this._jobHostdService = jobHostdService; + this._hubContext = hubContext; } - this.Notify(); - return entites.Count > 0; - } - [HttpPost("{id}")] - public async Task DetailsAsync(Guid id) - { - var entity = await _repository.FindAsync(id).ConfigureAwait(false); - return entity; - } + [HttpPost] + public async Task CreateAsync(JobItem input) + { + var entity = await _repository.InsertAsync(input).ConfigureAwait(false); + this._jobHostdService.AddJob(entity); + this.Notify(); + return entity; + } - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - return new PagedResultDto(totalCount, entities); - } + [HttpPost] + public async Task DeleteListAsync(List ids) + { + var entites = _repository.Where(p => ids.Contains(p.Id)).ToList(); + foreach (var item in entites) + { + await _repository.DeleteAsync(item).ConfigureAwait(false); + this._jobHostdService.RemoveJob(item); + } + this.Notify(); + return entites.Count > 0; + } - [HttpPost("{id}")] - public async Task UpdateAsync(Guid id, JobItem input) - { - var entity = await _repository.FindAsync(id).ConfigureAwait(false); - if (entity != null) + [HttpPost("{id}")] + public async Task DetailsAsync(Guid id) { - entity.InjectFrom(input); - await _repository.UpdateAsync(entity).ConfigureAwait(false); - this._jobHostdService.RemoveJob(entity); - this._jobHostdService.AddJob(entity); + var entity = await _repository.FindAsync(id).ConfigureAwait(false); + return entity; } - this.Notify(); - return input; - } - private void Notify() - { - this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); - } -} + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, + input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + return new PagedResultDto(totalCount, entities); + } -[Route("api/settleaccount/[controller]/[action]")] -public class JobLogAppService : ApplicationService, ITransientDependency -{ - private readonly INormalEfCoreRepository _repository; + [HttpPost("{id}")] + public async Task UpdateAsync(Guid id, JobItem input) + { + var entity = await _repository.FindAsync(id).ConfigureAwait(false); + if (entity != null) + { + entity.InjectFrom(input); + await _repository.UpdateAsync(entity).ConfigureAwait(false); + this._jobHostdService.RemoveJob(entity); + this._jobHostdService.AddJob(entity); + } + this.Notify(); + return input; + } - public JobLogAppService(INormalEfCoreRepository repository) - { - this._repository = repository; + private void Notify() + { + this._hubContext.Clients.All.ServerToClient("JobItem", "refresh", ""); + } } - [HttpPost] - public async Task> GetListAsync(RequestDto input) + [Route("api/settleaccount/[controller]/[action]")] + public class JobLogAppService : ApplicationService, ITransientDependency { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - return new PagedResultDto(totalCount, entities); - } + private readonly INormalEfCoreRepository _repository; - [HttpPost] - public async Task DeleteListAsync(List ids) - { - var entites = _repository.Where(p => ids.Contains(p.Id)).ToList(); - foreach (var item in entites) + public JobLogAppService(INormalEfCoreRepository repository) + { + this._repository = repository; + } + + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, + input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + return new PagedResultDto(totalCount, entities); + } + + [HttpPost] + public async Task DeleteListAsync(List ids) { - await _repository.DeleteAsync(item).ConfigureAwait(false); + var entites = _repository.Where(p => ids.Contains(p.Id)).ToList(); + foreach (var item in entites) + { + await _repository.DeleteAsync(item).ConfigureAwait(false); + } + return entites.Count > 0; } - return entites.Count > 0; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs index 821f7a9e..d5db6b24 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_BA_SERVICE.cs @@ -1,15 +1,12 @@ -using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Mvc; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; using System.LinqAsync; -using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.Application.Services; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -42,11 +39,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ ADJ_SERVICE adjservice - ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service,baseservice) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, wRepository, sRepository, mRepository, adjRepository, bbacMng, hbpoMng, pubMng, invMng, service, baseservice) { _priceRepository = priceRepository; _pricebjRepository = pricebjRepository; - _adjservice= adjservice; + _adjservice = adjservice; } /// @@ -60,11 +57,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [UnitOfWork(false)] public virtual async Task ReissueInvoiceExtend(List p_list) { - var errorlist = await CheckRepeat(p_list); + var errorlist = await CheckRepeat(p_list).ConfigureAwait(false); if (errorlist.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); } @@ -75,35 +72,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var adjlist = ObjectMapper.Map, List>(p_list); if (adjlist == null && adjlist.Count == 0) { - throw new UserFriendlyException($"调整表无数据!","400"); + throw new UserFriendlyException($"调整表无数据!", "400"); } //var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); - var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); + var settle = await _pubMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { - throw new UserFriendlyException( $"选择发票:{invbillnum}对应的可结算单不在请检查!","400"); + throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); } version = settle.Version; if (inv != null) { if (inv.InvoiceState == InvoiceBillState.报废) { - throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!","400"); + throw new UserFriendlyException($"选择发票:{invbillnum}状态为报废状态不能重开!", "400"); } if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) { - throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!","400"); + throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!", "400"); } - var publist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 + var publist = await _pubMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -124,7 +121,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ invGroupNum: itm.InvGroupNum, invbillnum: string.Empty, partcode: itm.PartCode, - pobillnum:string.Empty + pobillnum: string.Empty )); } } @@ -145,10 +142,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { priceList = _priceRepository.ToList();//价格单 } - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } // var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in entitys @@ -180,11 +177,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - await ReissueFirstInvoice(publist, adjlist, dtos, version, invbillnum); + await ReissueFirstInvoice(publist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); } else//二次开票 { - await ReissueSecInvoice(publist, adjlist, dtos, version, invbillnum); + await ReissueSecInvoice(publist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); } } } @@ -211,112 +208,112 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //var mappingList = await GetMapGroupAsync(p_invbillnum);//发票对应结算分组 //if (mappingList != null && mappingList.Count() > 0) //{ - var version = int.Parse(DateTime.Now.ToString("yyyymm")); - //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum); + var version = int.Parse(DateTime.Now.ToString("yyyymm")); + //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 + var inv = await GetInvoiceGroupByInvBillNum(p_invbillnum).ConfigureAwait(false); - var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); + var settle = await _pubMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); - if (settle == null) + if (settle == null) + { + throw new BusinessException("8989", $"选择发票:{p_invbillnum}对应的可结算单不在请检查!"); + } + version = settle.Version; + if (inv != null) + { + if (inv.InvoiceState == InvoiceBillState.报废) { - throw new BusinessException("8989", $"选择发票:{p_invbillnum}对应的可结算单不在请检查!"); + throw new BusinessException("8989", $"选择发票:{p_invbillnum}状态为报废状态不能重开!"); } - version = settle.Version; - if (inv != null) + if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) { - if (inv.InvoiceState == InvoiceBillState.报废) - { - throw new BusinessException("8989", $"选择发票:{p_invbillnum}状态为报废状态不能重开!"); - } - if (inv.State == SettleBillState.商务已审核 || inv.State == SettleBillState.已开票) - { - throw new BusinessException("8989", $"选择发票:{p_invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!"); - } - var publist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + throw new BusinessException("8989", $"选择发票:{p_invbillnum}状态在财务审核后可以报废重开,之前不能重开可以退回!"); + } + var publist = await _pubMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 + var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync().ConfigureAwait(false);//调整表明细 + if (adjlist != null && adjlist.Count > 0) + { + foreach (var itm in adjlist) { - foreach (var itm in adjlist) - { - publist.Add(new PUB_CAN_SA_DETAIL( - guid: GuidGenerator.Create(), - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvGroupNum, - settleBillNum: itm.SettleBillNum, - lU: itm.LU, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - price: itm.Price, - businessType: itm.BusinessType, - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, - invbillnum: string.Empty, - partcode:itm.PartCode, - pobillnum:string.Empty - )); - } + publist.Add(new PUB_CAN_SA_DETAIL( + guid: GuidGenerator.Create(), + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: itm.Price, + businessType: itm.BusinessType, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + invbillnum: string.Empty, + partcode: itm.PartCode, + pobillnum: string.Empty + )); } - var entitys = publist;//合并库存调整单和就发票可结算明细数据 - var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); - //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 - var priceList = _priceRepository.Where(p=>p.IsCancel==false).ToList();//价格单 - var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType); - if (errorList.Count > 0) - { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); } - // var dto1s = ObjectMapper.Map, List>(entitys); - var q = from d in entitys - join p in priceList on d.PartCode equals p.LU - where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site - select new TEMP_CAN_SA_DETAIL - { - SettleBillNum = d.SettleBillNum, - Site = d.Site, - Version = d.Version, - Price = p.Price, - BillNum = d.BillNum, - SettleDate = d.SettleDate, - InvGroupNum = d.InvGroupNum, - LU = d.LU, - // MaterialDesc = d.MaterialDesc, - PN = d.PN, - Qty = d.Qty, - GroupNum = d.GroupNum, - Amt = Math.Round(d.Qty * p.Price, 2), - ContractDocID = "n", - BeginDate = p.BeginTime, - EndDate = p.EndTime, - PartCode= d.PartCode + var entitys = publist;//合并库存调整单和就发票可结算明细数据 + var gNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); + //var groupNumList = entitys.Select(p => new { p.GroupNum).Distinct().ToList(); + //var notList = _notRepository.Where(p => gNumList.Contains(p.GroupNum)).ToList();//不能结算 + var priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 + var errorList = await CheckInvoiceGenerationRules(entitys, priceList, inv.BusinessType).ConfigureAwait(false); + if (errorList.Count > 0) + { + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); + } + // var dto1s = ObjectMapper.Map, List>(entitys); + var q = from d in entitys + join p in priceList on d.PartCode equals p.LU + where d.SettleDate >= p.BeginTime && d.SettleDate <= p.EndTime && p.IsCancel == false && p.ClientCode == inv.Site + select new TEMP_CAN_SA_DETAIL + { + SettleBillNum = d.SettleBillNum, + Site = d.Site, + Version = d.Version, + Price = p.Price, + BillNum = d.BillNum, + SettleDate = d.SettleDate, + InvGroupNum = d.InvGroupNum, + LU = d.LU, + // MaterialDesc = d.MaterialDesc, + PN = d.PN, + Qty = d.Qty, + GroupNum = d.GroupNum, + Amt = Math.Round(d.Qty * p.Price, 2), + ContractDocID = "n", + BeginDate = p.BeginTime, + EndDate = p.EndTime, + PartCode = d.PartCode - }; - var dtos = q.ToList(); - if (dtos != null && dtos.Count > 0) + }; + var dtos = q.ToList(); + if (dtos != null && dtos.Count > 0) + { + if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - if (p_invbillnum.Substring(0, 3) == "INV")//一次开票重开 - { - await ReissueFirstInvoice(publist,adjlist,dtos, version, p_invbillnum); - } - else//二次开票 - { - await ReissueSecInvoice(publist,adjlist, dtos, version, p_invbillnum); - } + await ReissueFirstInvoice(publist, adjlist, dtos, version, p_invbillnum).ConfigureAwait(false); + } + else//二次开票 + { + await ReissueSecInvoice(publist, adjlist, dtos, version, p_invbillnum).ConfigureAwait(false); } } - else - { - throw new BusinessException("8989", $"不存发票号为:{p_invbillnum}发票"); - } + } + else + { + throw new BusinessException("8989", $"不存发票号为:{p_invbillnum}发票"); + } //} //else //{ // throw new BusinessException("8989", $"不存发票号:{p_invbillnum}对应的结算分组号"); //} - return new JsonResult(new { Code = 200, Message = "发票重开成功" }); ; + return new JsonResult(new { Code = 200, Message = "发票重开成功" }); ; } [HttpPost] [UnitOfWork(false)] @@ -326,7 +323,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ /// public virtual async Task ReissueInvoiceListExt(List p_list) { - var result = await _adjservice.CheckImport(p_list); + var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); if (result != "OK") { return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); @@ -345,9 +342,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); - var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); + var settle = await _pubMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { @@ -364,9 +361,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 - //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 + //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -433,7 +430,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); ls = ObjectMapper.Map, List>(entities); var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) @@ -456,7 +453,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else//二次开票 { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); ls = ObjectMapper.Map, List>(entities); var invlist = ls.Select(p => p.InvbillNum).Distinct(); foreach (var itm in invlist) @@ -497,7 +494,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [UnitOfWork(false)] public virtual async Task ReissueInvoiceList(List p_list) { - var result = await _adjservice.CheckImport(p_list); + var result = await _adjservice.CheckImport(p_list).ConfigureAwait(false); if (result != "OK") { return new JsonResult(new { Code = 400, Message = "请下载错误模版", fileName = result }); @@ -516,8 +513,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ //{ var version = int.Parse(DateTime.Now.ToString("yyyymm")); //var gList = mappingList.Select(p => p.SettleGroupNum).ToList();//获取发票所有结算分组 - var inv = await GetInvoiceGroupByInvBillNum(invbillnum); - var settle = await _pubMng.GetMainAsync(inv.InvGroupNum); + var inv = await GetInvoiceGroupByInvBillNum(invbillnum).ConfigureAwait(false); + var settle = await _pubMng.GetMainAsync(inv.InvGroupNum).ConfigureAwait(false); if (settle == null) { throw new UserFriendlyException($"选择发票:{invbillnum}对应的可结算单不在请检查!", "400"); @@ -533,8 +530,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { throw new UserFriendlyException($"选择发票:{invbillnum}状态在财务审核后可以报废重开,之前请退回重开!", "400"); } - var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 - if (adjlist != null && adjlist.Count() > 0) + var bbaclist = await _pubMng.GetContainsAsync(inv.InvbillNum).ConfigureAwait(false);//结算分组对应结算零件 //var adjlist = await _adjRepository.Where(p => p.OldInvBillNum == inv.InvbillNum).ToListAsync();//调整表明细 + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -598,14 +595,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { if (invbillnum.Substring(0, 3) == "INV")//一次开票重开 { - var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueFirstInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); ls = ObjectMapper.Map, List>(entities); invBilllist.AddRange(ls.ToList()); } else//二次开票 { - var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum); + var entities = await ReissueSecInvoiceExtend(bbaclist, adjlist, dtos, version, invbillnum).ConfigureAwait(false); ls = ObjectMapper.Map, List>(entities); invBilllist.AddRange(ls.ToList()); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs index 4a319121..df6db51b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_CAN_SA_SERVICE.cs @@ -3,15 +3,9 @@ using System.Collections.Generic; using System.Linq; using System.LinqAsync; using System.Threading.Tasks; -using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Query.SqlExpressions; using SettleAccount.Domain.BQ; -using Volo.Abp; -using Volo.Abp.Data; -using Volo.Abp.Domain.Entities; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; @@ -23,12 +17,7 @@ using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Managers; using Win.Sfs.SettleAccount.Entities.BQ.Temp; using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; -using static Win.Sfs.SettleAccount.SettleAccountPermissions; - - - namespace Win.Sfs.SettleAccount.Entities.BQ { @@ -66,7 +55,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BaseDomainService baseservice, INormalEfCoreRepository notRepository - ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng,baseservice) + ) : base(excelImportService, snowflakeIdGenerator, commonManager, repository, detailRepository, invmng, baseservice) { _pubMng = pubMng; _priceRepository = priceRepository; @@ -75,16 +64,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } [HttpPost] [UnitOfWork(false)] - public async Task GenerateInvoice( [FromBody] string billnum) + public async Task GenerateInvoice([FromBody] string billnum) { - var main = await _pubMng.GetMainAsync(billnum); + var main = await _pubMng.GetMainAsync(billnum).ConfigureAwait(false); if (main != null) { if (main.State != SettleBillState.未结状态) { return new JsonResult(new { Code = 400, Message = "已创建发票不能重复创建" }); } - var entitys = await _pubMng.GetDetalListAsync(billnum); + var entitys = await _pubMng.GetDetalListAsync(billnum).ConfigureAwait(false); List priceList = new List(); if (main.BusinessType == EnumBusinessType.BeiJian) { @@ -98,15 +87,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { priceList = _priceRepository.Where(p => p.IsCancel == false).ToList();//价格单 } - var errorList = await CheckInvoiceGenerationRules(entitys,main.Site,priceList, main.BusinessType);//校验生成规则 - if (errorList.Count() > 0) + var errorList = await CheckInvoiceGenerationRules(entitys, main.Site, priceList, main.BusinessType).ConfigureAwait(false);//校验生成规则 + if (errorList.Count > 0) { - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorList).ConfigureAwait(false) }); } - if (await _pubMng.SetForwardState(main, SettleBillState.已开票)) + if (await _pubMng.SetForwardState(main, SettleBillState.已开票).ConfigureAwait(false)) { var groupNumList = entitys.Select(p => p.GroupNum).Distinct().ToList(); - entitys= entitys.OrderBy(p => p.IndexNum).ToList(); + entitys = entitys.OrderBy(p => p.IndexNum).ToList(); var dto1s = ObjectMapper.Map, List>(entitys); var q = from d in dto1s join p in priceList on d.LU equals p.LU @@ -131,14 +120,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ BeginDate = p.BeginTime, EndDate = p.EndTime, PartCode = d.PartCode,//客户零件号 - LineCode=d.IndexNum + LineCode = d.IndexNum }; var dtos = q.ToList(); if (dtos != null && dtos.Count > 0) { if (billnum.Substring(0, 1) == "C")//一次开票 { - var notQuery = await _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToListAsync(); + var notQuery = await _notRepository.Where(p => p.SettleBillNum == main.SettleBillNum).ToListAsync().ConfigureAwait(false); var notlist = notQuery.Select(p => new TEMP_NOT_SA_DETAIL { KeyCode = p.KeyCode, @@ -158,11 +147,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ PartCode = p.PartCode }).ToList();//不能结算 - await FirstInvoice(entitys, new List(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); + await FirstInvoice(entitys, new List(), dtos, notlist, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); } else//二次开票 { - await SecInvoice(entitys, new List(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType); + await SecInvoice(entitys, new List(), dtos, main.Version, main.InvGroupNum, string.Empty, main.BusinessType).ConfigureAwait(false); } } } @@ -172,7 +161,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ return new JsonResult(new { Code = 400, Message = "不存在可结算单记录" }); } - return new JsonResult(new { Code = 200, Message = "生成成功" }); + return new JsonResult(new { Code = 200, Message = "生成成功" }); } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs index 17b2acb0..64eb7291 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_NOT_SA_SERVICE.cs @@ -1,15 +1,9 @@ -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Mvc; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using SettleAccount.Domain.BQ; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; @@ -31,7 +25,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ PUB_NOT_SA_DETAIL_EXP_DTO> { private readonly PUB_NOT_SA_MNG _pubNotMng; - public PUB_NOT_SA_SERVICE(IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, @@ -46,7 +39,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ public override async Task GenerateSettlementOrder(PUB_NOT_SA_DETAIL_REQ_DTO input) { - var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount); + var entitys = await _detailRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, input.SkipCount).ConfigureAwait(false); List errorlist = new List(); if (entitys == null) { @@ -54,21 +47,20 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } else { - var errors = await _pubNotMng.GenerateSettlementOrder(entitys); + var errors = await _pubNotMng.GenerateSettlementOrder(entitys).ConfigureAwait(false); if (errors.Count > 0) { foreach (var itm in errors) { errorlist.Add(new ERR_EXP_DTO() { Message = itm }); } - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist) }); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = await ExportErrorReportAsync(errorlist).ConfigureAwait(false) }); } } - return new JsonResult(new { Code = 200, Message = "生成成功" }); + return new JsonResult(new { Code = 200, Message = "生成成功" }); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs index 52dcea77..888b0353 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_PD_SERVICE.cs @@ -1,26 +1,20 @@ -using EFCore.BulkExtensions; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components; -using SettleAccount.Domain.BQ; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Components; +using SettleAccount.Domain.BQ; using TaskJob.EventArgs; using Volo.Abp; -using Volo.Abp.Application.Services; using Volo.Abp.Uow; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.TaskJobs; using Win.Sfs.Shared.RepositoryBase; @@ -35,7 +29,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly TaskJobService _service; public PUB_PD_SERVICE(INormalEfCoreRepository bbacSecRepository, INormalEfCoreRepository hbpoSecRepository, INormalEfCoreRepository pubSecRepository, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager, INormalEfCoreRepository repository, VmiAppService vimservice, INormalEfCoreRepository detailRepository, TaskJobService service) : base(bbacSecRepository, hbpoSecRepository, pubSecRepository, excelImportService, snowflakeIdGenerator, commonManager, repository, vimservice, detailRepository) { - _service=service; + _service = service; } [UnitOfWork(false)] public override async Task ApprovalPassed(List p_list) @@ -43,12 +37,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var detailist = _detailRepository.Where(p => p_list.Contains(p.BillNum)).ToList(); List customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "BillNumList", Value = string.Join(",", p_list) }); - var first=detailist.FirstOrDefault(); - customConditionList.Add(new CustomCondition() { Name = "Type", Value = first.BusinessType.ToString()}); + var first = detailist.FirstOrDefault(); + customConditionList.Add(new CustomCondition() { Name = "Type", Value = first.BusinessType.ToString() }); customConditionList.Add(new CustomCondition() { Name = "IsOut", Value = "out" }); var ls = _repository.Where(p => p_list.Contains(p.BillNum)).ToList(); var lst = ls.Where(p => (p.State == SettleBillState.已提交扣减 || p.State == SettleBillState.已扣减)); - if (lst.Count() > 0) + if (lst.Any()) { throw new UserFriendlyException("当前状态是已提交状态,不能重复已提交", "400"); } @@ -56,14 +50,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ { item.State = SettleBillState.已提交扣减; } - await _repository.DbContext.BulkUpdateAsync(ls); + await _repository.DbContext.BulkUpdateAsync(ls).ConfigureAwait(false); var _taskid = await _service.ExportEnqueueAsync("PUB待扣减任务", ExportExtentsion.Excel, DateTime.Now.ToString("yyyyMM"), string.Empty, CurrentUser, typeof(PendingDeductionService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; - } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs index 665a8644..cecaa920 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_DETAIL_SERVICE.cs @@ -20,95 +20,96 @@ using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// PUB结算明细 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// PUB结算明细仓储 - /// - private readonly INormalEfCoreRepository _pubSaDetailRepository; - - /// - /// PUB结算仓储 + /// PUB结算明细 /// - private readonly INormalEfCoreRepository _pubSaRepository; + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class PUB_SA_DETAIL_SERVICE : SettleAccountApplicationBase + { + /// + /// PUB结算明细仓储 + /// + private readonly INormalEfCoreRepository _pubSaDetailRepository; - /// - /// 任务服务 - /// - private readonly TaskJobService _taskJobService; + /// + /// PUB结算仓储 + /// + private readonly INormalEfCoreRepository _pubSaRepository; - /// - /// 构造 - /// - public PUB_SA_DETAIL_SERVICE(INormalEfCoreRepository pubSaDetailRepository, - INormalEfCoreRepository pubSaRepository, - TaskJobService taskJobService, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) - { - _pubSaDetailRepository = pubSaDetailRepository; - _pubSaRepository = pubSaRepository; - _taskJobService = taskJobService; - } + /// + /// 任务服务 + /// + private readonly TaskJobService _taskJobService; - #region 导出 - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(PUB_SA_DETAIL_EXPORT_REQUEST_DTO input) - { - var pubSaEntity = await _pubSaRepository.FirstOrDefaultAsync(t => t.BillNum == input.BillNum); - if (pubSaEntity == null) + /// + /// 构造 + /// + public PUB_SA_DETAIL_SERVICE(INormalEfCoreRepository pubSaDetailRepository, + INormalEfCoreRepository pubSaRepository, + TaskJobService taskJobService, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - throw new UserFriendlyException($"导出失败,结算单号不存在!", "400"); + _pubSaDetailRepository = pubSaDetailRepository; + _pubSaRepository = pubSaRepository; + _taskJobService = taskJobService; } - var businessType = pubSaEntity.BusinessType; - var displayName = businessType.ToString(); - DisplayAttribute attributeOfType = businessType.GetAttributeOfType(); - if (attributeOfType != null) + #region 导出 + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(PUB_SA_DETAIL_EXPORT_REQUEST_DTO input) { - displayName = attributeOfType.Name; - } + var pubSaEntity = await _pubSaRepository.FirstOrDefaultAsync(t => t.BillNum == input.BillNum).ConfigureAwait(false); + if (pubSaEntity == null) + { + throw new UserFriendlyException($"导出失败,结算单号不存在!", "400"); + } + var businessType = pubSaEntity.BusinessType; - string fileName = $"{displayName}的结算数据_{Guid.NewGuid()}.xlsx"; - List filters = new List(); - filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); + var displayName = businessType.ToString(); + DisplayAttribute attributeOfType = businessType.GetAttributeOfType(); + if (attributeOfType != null) + { + displayName = attributeOfType.Name; + } - var entities = await _pubSaDetailRepository.GetListByFilterAsync(filters); - var dtos = ObjectMapper.Map, List>(entities); + string fileName = $"{displayName}的结算数据_{Guid.NewGuid()}.xlsx"; + List filters = new List(); + filters.Add(new FilterCondition("BillNum", input.BillNum, EnumFilterAction.Equal, EnumFilterLogic.And)); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); - result.ShouldNotBeNull(); + var entities = await _pubSaDetailRepository.GetListByFilterAsync(filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); - return fileName; - } - #endregion + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _pubSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _pubSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion + + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _pubSaDetailRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _pubSaDetailRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs index 99c8a179..e4027663 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SA_SERVICE.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Linq.Dynamic.Core; -using System.Security.Policy; using System.Text.RegularExpressions; using System.Threading.Tasks; using EFCore.BulkExtensions; @@ -27,600 +26,601 @@ using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// PUB结算 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class PUB_SA_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// DbContext - /// - public SettleAccountDbContext _settleAccountDbContext; - /// - /// PUB结算仓储 - /// - private readonly INormalEfCoreRepository _repository; - /// - /// PUB结算明细仓储 - /// - private readonly INormalEfCoreRepository _pubSaDetailRepository; - /// - /// PUB可结算仓储 - /// - private readonly INormalEfCoreRepository _pubCanSaRepository; - /// - /// PUB可结算明细仓储 - /// - private readonly INormalEfCoreRepository _pubCanSaDetailRepository; - /// - /// PUB不可结算明细仓储 - /// - private readonly INormalEfCoreRepository _pubNotSaDetailRepository; - /// - /// 销售价格仓储 + /// PUB结算 /// - private readonly INormalEfCoreRepository _priceListRepository; - /// - /// 备件价格仓储 - /// - private readonly INormalEfCoreRepository _priceBjListRepository; - /// - /// 客户零件关系仓储 - /// - private readonly INormalEfCoreRepository _materialRelationshipRepository; - /// - /// 替换件关系仓储 - /// - private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository; - - /// - /// 构造 - /// - public PUB_SA_SERVICE(SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository repository, - INormalEfCoreRepository pubSaDetailRepository, - INormalEfCoreRepository pubCanSaRepository, - INormalEfCoreRepository pubCanSaDetailRepository, - INormalEfCoreRepository pubNotSaDetailRepository, - INormalEfCoreRepository priceListRepository, - INormalEfCoreRepository priceBjListRepository, - INormalEfCoreRepository materialRelationshipRepository, - INormalEfCoreRepository tbRePartsRelationshipRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class PUB_SA_SERVICE : SettleAccountApplicationBase { - _settleAccountDbContext = settleAccountDbContext; - _repository = repository; - _pubSaDetailRepository = pubSaDetailRepository; - _pubCanSaRepository = pubCanSaRepository; - _pubCanSaDetailRepository = pubCanSaDetailRepository; - _pubNotSaDetailRepository = pubNotSaDetailRepository; - _priceListRepository = priceListRepository; - _priceBjListRepository = priceBjListRepository; - _materialRelationshipRepository = materialRelationshipRepository; - _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; - } - - /// - /// 期间 - /// - private int version; - /// - /// 业务类别 - /// - private EnumBusinessType businessType; - /// - /// 地点 - /// - private string site; - - #region 导入、导出 - /// - /// 导入 - /// - [HttpPost] - public async Task ImportAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto) - { - IActionResult result = new JsonResult(new { Code = 400 }); - version = pubSaImportRequestDto.Version; - businessType = pubSaImportRequestDto.BusinessType; - site = pubSaImportRequestDto.Site; - switch (pubSaImportRequestDto.BusinessType) + /// + /// DbContext + /// + public SettleAccountDbContext _settleAccountDbContext; + /// + /// PUB结算仓储 + /// + private readonly INormalEfCoreRepository _repository; + /// + /// PUB结算明细仓储 + /// + private readonly INormalEfCoreRepository _pubSaDetailRepository; + /// + /// PUB可结算仓储 + /// + private readonly INormalEfCoreRepository _pubCanSaRepository; + /// + /// PUB可结算明细仓储 + /// + private readonly INormalEfCoreRepository _pubCanSaDetailRepository; + /// + /// PUB不可结算明细仓储 + /// + private readonly INormalEfCoreRepository _pubNotSaDetailRepository; + /// + /// 销售价格仓储 + /// + private readonly INormalEfCoreRepository _priceListRepository; + /// + /// 备件价格仓储 + /// + private readonly INormalEfCoreRepository _priceBjListRepository; + /// + /// 客户零件关系仓储 + /// + private readonly INormalEfCoreRepository _materialRelationshipRepository; + /// + /// 替换件关系仓储 + /// + private readonly INormalEfCoreRepository _tbRePartsRelationshipRepository; + + /// + /// 构造 + /// + public PUB_SA_SERVICE(SettleAccountDbContext settleAccountDbContext, + INormalEfCoreRepository repository, + INormalEfCoreRepository pubSaDetailRepository, + INormalEfCoreRepository pubCanSaRepository, + INormalEfCoreRepository pubCanSaDetailRepository, + INormalEfCoreRepository pubNotSaDetailRepository, + INormalEfCoreRepository priceListRepository, + INormalEfCoreRepository priceBjListRepository, + INormalEfCoreRepository materialRelationshipRepository, + INormalEfCoreRepository tbRePartsRelationshipRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - case EnumBusinessType.ZhiGongJianBBAC: - result = await ImportZhiGongJianBBACAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); - break; - case EnumBusinessType.ZhiGongJianHBPO: - result = await ImportZhiGongJianHBPOAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); - break; - case EnumBusinessType.BeiJian: - result = await ImportBeiJianAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); - break; - case EnumBusinessType.YinDuJian: - result = await ImportYinDuJianAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); - break; - default: - break; + _settleAccountDbContext = settleAccountDbContext; + _repository = repository; + _pubSaDetailRepository = pubSaDetailRepository; + _pubCanSaRepository = pubCanSaRepository; + _pubCanSaDetailRepository = pubCanSaDetailRepository; + _pubNotSaDetailRepository = pubNotSaDetailRepository; + _priceListRepository = priceListRepository; + _priceBjListRepository = priceBjListRepository; + _materialRelationshipRepository = materialRelationshipRepository; + _tbRePartsRelationshipRepository = tbRePartsRelationshipRepository; } - return result; - } - #endregion - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(PUB_SARequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - - /// - /// 删除 - /// - [HttpPost] - public async Task DeleteListAsync(List ids) - { - //结算主表 - var pubSas = new List(); - //结算明细 - var pubSaDetails = new List(); - //可结算主表 - var pubCanSas = new List(); - //可结算明细 - var pubCanSaDetails = new List(); - //不可结算 - var pubNotSaDetails = new List(); - - foreach (var id in ids) + /// + /// 期间 + /// + private int version; + /// + /// 业务类别 + /// + private EnumBusinessType businessType; + /// + /// 地点 + /// + private string site; + + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] PUB_SAImportRequestDto pubSaImportRequestDto) { - try - { - var pubSaDelItems = await GetPubSaDelItemsAsync(id).ConfigureAwait(false); - - pubSas.AddRange(pubSaDelItems.pubSas); - pubSaDetails.AddRange(pubSaDelItems.pubSaDetails); - pubCanSas.AddRange(pubSaDelItems.pubCanSas); - pubCanSaDetails.AddRange(pubSaDelItems.pubCanSaDetails); - pubNotSaDetails.AddRange(pubSaDelItems.pubNotSaDetails); - } - catch (Exception) + IActionResult result = new JsonResult(new { Code = 400 }); + version = pubSaImportRequestDto.Version; + businessType = pubSaImportRequestDto.BusinessType; + site = pubSaImportRequestDto.Site; + switch (pubSaImportRequestDto.BusinessType) { - throw; + case EnumBusinessType.ZhiGongJianBBAC: + result = await ImportZhiGongJianBBACAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); + break; + case EnumBusinessType.ZhiGongJianHBPO: + result = await ImportZhiGongJianHBPOAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); + break; + case EnumBusinessType.BeiJian: + result = await ImportBeiJianAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); + break; + case EnumBusinessType.YinDuJian: + result = await ImportYinDuJianAsync(pubSaImportRequestDto.Files).ConfigureAwait(false); + break; + default: + break; } + return result; } + #endregion - //删除 - if (pubSas.Any()) - { - await _repository.DbContext.BulkDeleteAsync(pubSas).ConfigureAwait(false); - } - if (pubSaDetails.Any()) - { - await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false); - } - if (pubCanSas.Any()) + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(PUB_SARequestDto input) { - await _pubCanSaRepository.DbContext.BulkDeleteAsync(pubCanSas).ConfigureAwait(false); - } - if (pubCanSaDetails.Any()) - { - await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false); - } - if (pubNotSaDetails.Any()) - { - await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); } - return new JsonResult(new { Code = 200, Message = "成功" }); - } - #endregion - - #region 私有方法 - /// - /// 直供件BBAC导入 - /// - private async Task ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files) - { - #region 导入数据转换 - ExportImporter _exportImporter = new ExportImporter(); - var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - importResults = importResults.FindAll(t => t.Vendor == "15663496"); - var importPubSaDetails = ObjectMapper.Map, List>(importResults); - #endregion - - if (!importPubSaDetails.Any()) + /// + /// 删除 + /// + [HttpPost] + public async Task DeleteListAsync(List ids) { - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } + //结算主表 + var pubSas = new List(); + //结算明细 + var pubSaDetails = new List(); + //可结算主表 + var pubCanSas = new List(); + //可结算明细 + var pubCanSaDetails = new List(); + //不可结算 + var pubNotSaDetails = new List(); + + foreach (var id in ids) + { + try + { + var pubSaDelItems = await GetPubSaDelItemsAsync(id).ConfigureAwait(false); + + pubSas.AddRange(pubSaDelItems.pubSas); + pubSaDetails.AddRange(pubSaDelItems.pubSaDetails); + pubCanSas.AddRange(pubSaDelItems.pubCanSas); + pubCanSaDetails.AddRange(pubSaDelItems.pubCanSaDetails); + pubNotSaDetails.AddRange(pubSaDelItems.pubNotSaDetails); + } + catch (Exception) + { + throw; + } + } - importPubSaDetails = HandleSaDetails(importPubSaDetails); + //删除 + if (pubSas.Any()) + { + await _repository.DbContext.BulkDeleteAsync(pubSas).ConfigureAwait(false); + } + if (pubSaDetails.Any()) + { + await _pubSaDetailRepository.DbContext.BulkDeleteAsync(pubSaDetails).ConfigureAwait(false); + } + if (pubCanSas.Any()) + { + await _pubCanSaRepository.DbContext.BulkDeleteAsync(pubCanSas).ConfigureAwait(false); + } + if (pubCanSaDetails.Any()) + { + await _pubCanSaDetailRepository.DbContext.BulkDeleteAsync(pubCanSaDetails).ConfigureAwait(false); + } + if (pubNotSaDetails.Any()) + { + await _pubNotSaDetailRepository.DbContext.BulkDeleteAsync(pubNotSaDetails).ConfigureAwait(false); + } - #region 数据校验 - var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + return new JsonResult(new { Code = 200, Message = "成功" }); } #endregion - return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianBBAC).ConfigureAwait(false); - } - - /// - /// 直供件HBPO导入 - /// - private async Task ImportZhiGongJianHBPOAsync([FromForm] IFormFileCollection files) - { - #region 导入数据转换 - ExportImporter _exportImporter = new ExportImporter(); - var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - - //截取结算分组前8位为结算日期 - importResults.ForEach(importResult => + #region 私有方法 + /// + /// 直供件BBAC导入 + /// + private async Task ImportZhiGongJianBBACAsync([FromForm] IFormFileCollection files) { - importResult.SettleDate = DateTime.ParseExact(importResult.GroupNum.Substring(0, 8), "yyyyMMdd", CultureInfo.InvariantCulture); - }); + #region 导入数据转换 + ExportImporter _exportImporter = new ExportImporter(); + var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + importResults = importResults.FindAll(t => t.Vendor == "15663496"); + var importPubSaDetails = ObjectMapper.Map, List>(importResults); + #endregion + + if (!importPubSaDetails.Any()) + { + return new JsonResult(new { Code = 200, Message = "导入成功" }); + } - var importPubSaDetails = ObjectMapper.Map, List>(importResults); - #endregion + importPubSaDetails = HandleSaDetails(importPubSaDetails); - if (!importPubSaDetails.Any()) - { - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } + #region 数据校验 + var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); + if (checkList.Count > 0) + { + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + } + #endregion - importPubSaDetails = HandleSaDetails(importPubSaDetails); + return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianBBAC).ConfigureAwait(false); + } - #region 数据校验 - var checkList = await CheckAsync(importPubSaDetails); - if (checkList.Count > 0) + /// + /// 直供件HBPO导入 + /// + private async Task ImportZhiGongJianHBPOAsync([FromForm] IFormFileCollection files) { - string fileName = await ExportErrorReportAsync(checkList); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); - } - #endregion + #region 导入数据转换 + ExportImporter _exportImporter = new ExportImporter(); + var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianHBPO).ConfigureAwait(false); - } + //截取结算分组前8位为结算日期 + importResults.ForEach(importResult => + { + importResult.SettleDate = DateTime.ParseExact(importResult.GroupNum.Substring(0, 8), "yyyyMMdd", CultureInfo.InvariantCulture); + }); - /// - /// 备件导入 - /// - private async Task ImportBeiJianAsync([FromForm] IFormFileCollection files) - { - #region 导入数据转换 - ExportImporter _exportImporter = new ExportImporter(); - var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - var importPubSaDetails = ObjectMapper.Map, List>(importResults); - #endregion + var importPubSaDetails = ObjectMapper.Map, List>(importResults); + #endregion - if (!importPubSaDetails.Any()) - { - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } + if (!importPubSaDetails.Any()) + { + return new JsonResult(new { Code = 200, Message = "导入成功" }); + } - importPubSaDetails = HandleSaDetails(importPubSaDetails); + importPubSaDetails = HandleSaDetails(importPubSaDetails); - #region 数据校验 - var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + #region 数据校验 + var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); + if (checkList.Count > 0) + { + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + } + #endregion + + return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.ZhiGongJianHBPO).ConfigureAwait(false); } - #endregion - return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.BeiJian).ConfigureAwait(false); - } + /// + /// 备件导入 + /// + private async Task ImportBeiJianAsync([FromForm] IFormFileCollection files) + { + #region 导入数据转换 + ExportImporter _exportImporter = new ExportImporter(); + var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + var importPubSaDetails = ObjectMapper.Map, List>(importResults); + #endregion - /// - /// 印度件导入 - /// - private async Task ImportYinDuJianAsync([FromForm] IFormFileCollection files) - { - #region 导入数据转换 - ExportImporter _exportImporter = new ExportImporter(); - var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - importResults = importResults.FindAll(t => t.Supplier == "15663496"); - var importPubSaDetails = ObjectMapper.Map, List>(importResults); - #endregion + if (!importPubSaDetails.Any()) + { + return new JsonResult(new { Code = 200, Message = "导入成功" }); + } - if (!importPubSaDetails.Any()) - { - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } + importPubSaDetails = HandleSaDetails(importPubSaDetails); - importPubSaDetails = HandleSaDetails(importPubSaDetails); + #region 数据校验 + var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); + if (checkList.Count > 0) + { + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + } + #endregion - #region 数据校验 - var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.BeiJian).ConfigureAwait(false); } - #endregion - return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.YinDuJian).ConfigureAwait(false); - } - - /// - /// 数据校验 - /// - private async Task> CheckAsync(List pubSaDetails) - { - #region 数据校验 - //数据校验 - var checkList = new List(); - //结算分组号 - var pubSaGroupNums = pubSaDetails.Select(t => t.GroupNum).Distinct(); - //已存在的结算分组号 - var havPubSaGroupNums = (await _pubSaDetailRepository.GetListAsync(t => pubSaGroupNums.Contains(t.GroupNum))).Select(t => t.GroupNum).Distinct(); - if (havPubSaGroupNums.Any() == true) + /// + /// 印度件导入 + /// + private async Task ImportYinDuJianAsync([FromForm] IFormFileCollection files) { - foreach (var item in havPubSaGroupNums) + #region 导入数据转换 + ExportImporter _exportImporter = new ExportImporter(); + var importResults = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + importResults = importResults.FindAll(t => t.Supplier == "15663496"); + var importPubSaDetails = ObjectMapper.Map, List>(importResults); + #endregion + + if (!importPubSaDetails.Any()) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - } - if (!checkList.Any()) - { - //验证客户对应厂内零件号是否存在 - //导入的零件号集合 - var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + importPubSaDetails = HandleSaDetails(importPubSaDetails); - //不存在的客户零件号(差集) - var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); - noExistSettleMaterialCodes.ForEach(t => + #region 数据校验 + var checkList = await CheckAsync(importPubSaDetails).ConfigureAwait(false); + if (checkList.Count > 0) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); - }); - } + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); + } + #endregion - return checkList; - #endregion - } + return await InsertSaDataAsync(importPubSaDetails, EnumBusinessType.YinDuJian).ConfigureAwait(false); + } - /// - /// 处理结算数据 - /// - private List HandleSaDetails(List pubSaDetails) - { - pubSaDetails.ForEach(pubSaDetail => + /// + /// 数据校验 + /// + private async Task> CheckAsync(List pubSaDetails) { - var lus = pubSaDetail.LU.Split(new string(' ', 4)).ToList(); - pubSaDetail.LU = lus[0].Replace(" ", ""); - if (lus.Count > 1) + #region 数据校验 + //数据校验 + var checkList = new List(); + //结算分组号 + var pubSaGroupNums = pubSaDetails.Select(t => t.GroupNum).Distinct(); + //已存在的结算分组号 + var havPubSaGroupNums = (await _pubSaDetailRepository.GetListAsync(t => pubSaGroupNums.Contains(t.GroupNum)).ConfigureAwait(false)).Select(t => t.GroupNum).Distinct(); + if (havPubSaGroupNums.Any() == true) { - lus.RemoveAt(0); - var luAssemble = lus.Select(t => t.Replace(" ", "")); - pubSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + foreach (var item in havPubSaGroupNums) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"结算分组号{item}已存在", string.Empty)); + } } - pubSaDetail.PN = Regex.Replace(pubSaDetail.PN, "['‘’]", ""); - }); - return GroupPnLu(pubSaDetails); - } - /// - /// 结算数据分组Pn、Lu - /// - private List GroupPnLu(List pubSaDetails) - { - return pubSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => - { - var pubSaDetail = t.First(); - pubSaDetail.Qty = t.Sum(t => t.Qty); - return pubSaDetail; - }).ToList(); - } + if (!checkList.Any()) + { + //验证客户对应厂内零件号是否存在 + //导入的零件号集合 + var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); + var materialRelationshipEntitySettleMaterialCodes = materialRelationshipEntitys.Select(t => t.SettleMaterialCode).Distinct(); + + //不存在的客户零件号(差集) + var noExistSettleMaterialCodes = importPubSaLUs.Except(materialRelationshipEntitySettleMaterialCodes); + noExistSettleMaterialCodes.ForEach(t => + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, $"客户零件号【{t}】对应厂内零件号系统中不存在", string.Empty)); + }); + } - /// - /// Insert结算数据 - /// - private async Task InsertSaDataAsync(List pubSaDetails, EnumBusinessType businessType) - { - #region 处理结算数据 - for (var i = 0; i < pubSaDetails.Count; i++) - { - var pubSaDetail = pubSaDetails[i]; - pubSaDetail.SetId(GuidGenerator.Create()); - pubSaDetail.CustomerPartCodeNoSpace = pubSaDetail.LU.Replace(" ", ""); - pubSaDetail.KeyCode = pubSaDetail.PN + pubSaDetail.LU; - pubSaDetail.Version = version; - pubSaDetail.BusinessType = businessType; - pubSaDetail.IndexNum = i; + return checkList; + #endregion } - var lus = pubSaDetails.Select(t => t.LU).Distinct().ToList(); - var clientCode = businessType switch - { - EnumBusinessType.ZhiGongJianBBAC => site, - EnumBusinessType.ZhiGongJianHBPO => "104T", - EnumBusinessType.BeiJian => "1049", - EnumBusinessType.YinDuJian => "1040", - _ => throw new UserFriendlyException($"业务编码错误", "400") - }; - site = clientCode; - - if (businessType == EnumBusinessType.BeiJian) + /// + /// 处理结算数据 + /// + private List HandleSaDetails(List pubSaDetails) { - //备件销售价格 - var priceListEntitys = _priceBjListRepository.Where(t => t.IsCancel == false) - .Where(t => t.ClientCode == clientCode) - .Where(t => lus.Contains(t.LU)).ToList(); - pubSaDetails.ForEach(importPubSaDetail => + pubSaDetails.ForEach(pubSaDetail => { - //根据物料号、结算日期获取价格 - var priceListEntity = priceListEntitys - .Where(t => t.LU == importPubSaDetail.LU) - .Where(t => importPubSaDetail.SettleDate >= t.BeginDate && importPubSaDetail.SettleDate <= t.EndDate) - .OrderByDescending(t => t.Date) - .ThenByDescending(t => t.CreationTime) - .FirstOrDefault(); - importPubSaDetail.Price = priceListEntity?.Price ?? 0; + var lus = pubSaDetail.LU.Split(new string(' ', 4)).ToList(); + pubSaDetail.LU = lus[0].Replace(" ", ""); + if (lus.Count > 1) + { + lus.RemoveAt(0); + var luAssemble = lus.Select(t => t.Replace(" ", "")); + pubSaDetail.LU += luAssemble.Aggregate(new string(' ', 6), (current, index) => current + index); + } + pubSaDetail.PN = Regex.Replace(pubSaDetail.PN, "['‘’]", ""); }); + return GroupPnLu(pubSaDetails); } - else + + /// + /// 结算数据分组Pn、Lu + /// + private List GroupPnLu(List pubSaDetails) { - //销售价格 - var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false) - .Where(t => t.ClientCode == clientCode) - .Where(t => lus.Contains(t.LU)).ToList(); - pubSaDetails.ForEach(importPubSaDetail => + return pubSaDetails.GroupBy(t => new { t.PN, t.LU }).Select(t => { - //根据物料号、结算日期获取价格 - var priceListEntity = priceListEntitys - .Where(t => t.LU == importPubSaDetail.LU) - .Where(t => importPubSaDetail.SettleDate >= t.BeginTime && importPubSaDetail.SettleDate <= t.EndTime) - .OrderByDescending(t => t.Date) - .ThenByDescending(t => t.CreationTime) - .FirstOrDefault(); - importPubSaDetail.Price = priceListEntity?.Price ?? 0; - }); + var pubSaDetail = t.First(); + pubSaDetail.Qty = t.Sum(t => t.Qty); + return pubSaDetail; + }).ToList(); } - //导入的零件号集合 - var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); - var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - - pubSaDetails.ForEach(pubSaDetail => + /// + /// Insert结算数据 + /// + private async Task InsertSaDataAsync(List pubSaDetails, EnumBusinessType businessType) { - pubSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.LU)?.ErpMaterialCode; - }); - #endregion - - #region 添加入库 - await SeDataEntryAsync(pubSaDetails).ConfigureAwait(false); - #endregion + #region 处理结算数据 + for (var i = 0; i < pubSaDetails.Count; i++) + { + var pubSaDetail = pubSaDetails[i]; + pubSaDetail.SetId(GuidGenerator.Create()); + pubSaDetail.CustomerPartCodeNoSpace = pubSaDetail.LU.Replace(" ", ""); + pubSaDetail.KeyCode = pubSaDetail.PN + pubSaDetail.LU; + pubSaDetail.Version = version; + pubSaDetail.BusinessType = businessType; + pubSaDetail.IndexNum = i; + } + var lus = pubSaDetails.Select(t => t.LU).Distinct().ToList(); - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } + var clientCode = businessType switch + { + EnumBusinessType.ZhiGongJianBBAC => site, + EnumBusinessType.ZhiGongJianHBPO => "104T", + EnumBusinessType.BeiJian => "1049", + EnumBusinessType.YinDuJian => "1040", + _ => throw new UserFriendlyException($"业务编码错误", "400") + }; + site = clientCode; + + if (businessType == EnumBusinessType.BeiJian) + { + //备件销售价格 + var priceListEntitys = _priceBjListRepository.Where(t => t.IsCancel == false) + .Where(t => t.ClientCode == clientCode) + .Where(t => lus.Contains(t.LU)).ToList(); + pubSaDetails.ForEach(importPubSaDetail => + { + //根据物料号、结算日期获取价格 + var priceListEntity = priceListEntitys + .Where(t => t.LU == importPubSaDetail.LU) + .Where(t => importPubSaDetail.SettleDate >= t.BeginDate && importPubSaDetail.SettleDate <= t.EndDate) + .OrderByDescending(t => t.Date) + .ThenByDescending(t => t.CreationTime) + .FirstOrDefault(); + importPubSaDetail.Price = priceListEntity?.Price ?? 0; + }); + } + else + { + //销售价格 + var priceListEntitys = _priceListRepository.Where(t => t.IsCancel == false) + .Where(t => t.ClientCode == clientCode) + .Where(t => lus.Contains(t.LU)).ToList(); + pubSaDetails.ForEach(importPubSaDetail => + { + //根据物料号、结算日期获取价格 + var priceListEntity = priceListEntitys + .Where(t => t.LU == importPubSaDetail.LU) + .Where(t => importPubSaDetail.SettleDate >= t.BeginTime && importPubSaDetail.SettleDate <= t.EndTime) + .OrderByDescending(t => t.Date) + .ThenByDescending(t => t.CreationTime) + .FirstOrDefault(); + importPubSaDetail.Price = priceListEntity?.Price ?? 0; + }); + } - /// - /// 结算数据入库 - /// - private async Task SeDataEntryAsync(List pubSaDetails) - { - //业务类型 - var pubSaFirstDetail = pubSaDetails.First(); - var place = pubSaFirstDetail.Place; - //结算单号 - var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); - //结算主表 - var pubSa = new PUB_SA() - { - BillNum = pubSaBillNum, - State = "0", - BusinessType = pubSaFirstDetail.BusinessType, - Version = pubSaFirstDetail.Version, - Site = site, - Place = place - }; - //可结算单号 - var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); - //可结算主表 - var pubCanSa = new PUB_CAN_SA() - { - BillNum = pubCanSaBillNum, - InvGroupNum = pubCanSaBillNum, - SettleBillNum = pubSaBillNum, - State = SettleBillState.未结状态, - BusinessType = pubSa.BusinessType, - Version = pubSa.Version, - Site = site - }; - - #region 入库数据赋值 - pubSaDetails.ForEach(pubSaDetail => - { - pubSaDetail.BillNum = pubSaBillNum; - pubSaDetail.Site = site; - }); - //不可结算 结算分组号码(根据价格区分结算、不可结算) - var pubNotSaGroupNums = pubSaDetails.FindAll(t => t.Price == default(decimal)).Select(t => t.GroupNum).Distinct(); - var pubSaDetailsCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == false); - var pubSaDetailsNotCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == true); - - //可结算明细 - var pubCanSaDetails = ObjectMapper.Map, List>(pubSaDetailsCanSes); - //不可结算明细 - var pubNotSaDetails = ObjectMapper.Map, List>(pubSaDetailsNotCanSes); - #endregion + //导入的零件号集合 + var importPubSaLUs = pubSaDetails.Select(t => t.LU).Distinct(); + var materialRelationshipEntitys = await _materialRelationshipRepository.GetListAsync(t => t.BusinessType == businessType && importPubSaLUs.Contains(t.SettleMaterialCode)).ConfigureAwait(false); - #region 添加入库 - await _repository.InsertAsync(pubSa).ConfigureAwait(false); - (await _pubSaDetailRepository.GetDbContextAsync().ConfigureAwait(false)).BulkInsert(pubSaDetails); - if (pubCanSaDetails.Count > 0) - { - pubCanSaDetails.ForEach(pubCanSaDetail => + pubSaDetails.ForEach(pubSaDetail => { - pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum; + pubSaDetail.PartCode = materialRelationshipEntitys.FirstOrDefault(t => t.SettleMaterialCode == pubSaDetail.LU)?.ErpMaterialCode; }); + #endregion + + #region 添加入库 + await SeDataEntryAsync(pubSaDetails).ConfigureAwait(false); + #endregion - await _pubCanSaRepository.InsertAsync(pubCanSa).ConfigureAwait(false); - await _pubCanSaDetailRepository.DbContext.BulkInsertAsync(pubCanSaDetails).ConfigureAwait(false); - //await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails); + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - if (pubNotSaDetails.Count > 0) + + /// + /// 结算数据入库 + /// + private async Task SeDataEntryAsync(List pubSaDetails) { - await _pubNotSaDetailRepository.DbContext.BulkInsertAsync(pubNotSaDetails).ConfigureAwait(false); - //await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails); + //业务类型 + var pubSaFirstDetail = pubSaDetails.First(); + var place = pubSaFirstDetail.Place; + //结算单号 + var pubSaBillNum = OrderNumberGenerator.GenerateOrderNumber("SA"); + //结算主表 + var pubSa = new PUB_SA() + { + BillNum = pubSaBillNum, + State = "0", + BusinessType = pubSaFirstDetail.BusinessType, + Version = pubSaFirstDetail.Version, + Site = site, + Place = place + }; + //可结算单号 + var pubCanSaBillNum = OrderNumberGenerator.GenerateOrderNumber("C"); + //可结算主表 + var pubCanSa = new PUB_CAN_SA() + { + BillNum = pubCanSaBillNum, + InvGroupNum = pubCanSaBillNum, + SettleBillNum = pubSaBillNum, + State = SettleBillState.未结状态, + BusinessType = pubSa.BusinessType, + Version = pubSa.Version, + Site = site + }; + + #region 入库数据赋值 + pubSaDetails.ForEach(pubSaDetail => + { + pubSaDetail.BillNum = pubSaBillNum; + pubSaDetail.Site = site; + }); + //不可结算 结算分组号码(根据价格区分结算、不可结算) + var pubNotSaGroupNums = pubSaDetails.FindAll(t => t.Price == default(decimal)).Select(t => t.GroupNum).Distinct(); + var pubSaDetailsCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == false); + var pubSaDetailsNotCanSes = pubSaDetails.FindAll(t => pubNotSaGroupNums.Contains(t.GroupNum) == true); + + //可结算明细 + var pubCanSaDetails = ObjectMapper.Map, List>(pubSaDetailsCanSes); + //不可结算明细 + var pubNotSaDetails = ObjectMapper.Map, List>(pubSaDetailsNotCanSes); + #endregion + + #region 添加入库 + await _repository.InsertAsync(pubSa).ConfigureAwait(false); + (await _pubSaDetailRepository.GetDbContextAsync().ConfigureAwait(false)).BulkInsert(pubSaDetails); + if (pubCanSaDetails.Count > 0) + { + pubCanSaDetails.ForEach(pubCanSaDetail => + { + pubCanSaDetail.BillNum = pubCanSaDetail.InvGroupNum = pubCanSaBillNum; + }); + + await _pubCanSaRepository.InsertAsync(pubCanSa).ConfigureAwait(false); + await _pubCanSaDetailRepository.DbContext.BulkInsertAsync(pubCanSaDetails).ConfigureAwait(false); + //await _pubCanSaDetailRepository.InsertManyAsync(pubCanSaDetails); + } + if (pubNotSaDetails.Count > 0) + { + await _pubNotSaDetailRepository.DbContext.BulkInsertAsync(pubNotSaDetails).ConfigureAwait(false); + //await _pubNotSaDetailRepository.InsertManyAsync(pubNotSaDetails); + } + #endregion } - #endregion - } - /// - /// 获取结算关联项 - /// - private async Task<(List pubSas, List pubSaDetails, List pubCanSas, List pubCanSaDetails, List pubNotSaDetails)> GetPubSaDelItemsAsync(Guid id) - { - //结算主表 - var pubSas = new List(); - //结算明细 - var pubSaDetails = new List(); - //可结算主表 - var pubCanSas = new List(); - //可结算明细 - var pubCanSaDetails = new List(); - //不可结算 - var pubNotSaDetails = new List(); - - var pubSaEntity = await _repository.FindAsync(id).ConfigureAwait(false); - if (pubSaEntity != null) + /// + /// 获取结算关联项 + /// + private async Task<(List pubSas, List pubSaDetails, List pubCanSas, List pubCanSaDetails, List pubNotSaDetails)> GetPubSaDelItemsAsync(Guid id) { - //结算单据 - string pubSaBillNum = pubSaEntity.BillNum; - - pubCanSas = await _pubCanSaRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false); - //验证可结算主表状态 - if (pubCanSas.Any() && pubCanSas.Any(t => t.State != SettleBillState.未结状态)) + //结算主表 + var pubSas = new List(); + //结算明细 + var pubSaDetails = new List(); + //可结算主表 + var pubCanSas = new List(); + //可结算明细 + var pubCanSaDetails = new List(); + //不可结算 + var pubNotSaDetails = new List(); + + var pubSaEntity = await _repository.FindAsync(id).ConfigureAwait(false); + if (pubSaEntity != null) { - throw new UserFriendlyException($"{pubSaBillNum} 该单据可结算单状态无法删除!", "400"); + //结算单据 + string pubSaBillNum = pubSaEntity.BillNum; + + pubCanSas = await _pubCanSaRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false); + //验证可结算主表状态 + if (pubCanSas.Any() && pubCanSas.Any(t => t.State != SettleBillState.未结状态)) + { + throw new UserFriendlyException($"{pubSaBillNum} 该单据可结算单状态无法删除!", "400"); + } + + pubSas.Add(pubSaEntity); + pubSaDetails = await _pubSaDetailRepository.GetListAsync(t => t.BillNum == pubSaBillNum).ConfigureAwait(false); + pubCanSaDetails = await _pubCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false); + pubNotSaDetails = await _pubNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false); } - pubSas.Add(pubSaEntity); - pubSaDetails = await _pubSaDetailRepository.GetListAsync(t => t.BillNum == pubSaBillNum).ConfigureAwait(false); - pubCanSaDetails = await _pubCanSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false); - pubNotSaDetails = await _pubNotSaDetailRepository.GetListAsync(t => t.SettleBillNum == pubSaBillNum).ConfigureAwait(false); + return (pubSas, pubSaDetails, pubCanSas, pubCanSaDetails, pubNotSaDetails); } - - return (pubSas, pubSaDetails, pubCanSas, pubCanSaDetails, pubNotSaDetails); + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs index 752f6c6d..e6b71bc7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PUB_SE_DETAIL_SERVICE.cs @@ -1,22 +1,16 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; using Castle.Core.Internal; -using DocumentFormat.OpenXml.Office2010.Excel; -using DocumentFormat.OpenXml.Spreadsheet; -using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -using Magicodes.ExporterAndImporter.Excel.Utility; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.OpenApi.Extensions; -using NPOI.HPSF; using SettleAccount.Domain.BQ; using Shouldly; using SqlSugar; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Security.Cryptography; -using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.BlobStoring; @@ -24,7 +18,6 @@ using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.Reports; -using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs index c0076805..76ff7c8f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/PURCHASE_PRICE_SERVICE.cs @@ -5,9 +5,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.SignalR; using SettleAccount.Domain.BQ; -using SettleAccount.Job.SignalR; using Shouldly; using Volo.Abp.Application.Dtos; using Volo.Abp.Caching; @@ -20,108 +18,109 @@ using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// 采购价格单 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// 采购价格单仓储 + /// 采购价格单 /// - private readonly INormalEfCoreRepository _repository; - - public PURCHASE_PRICE_SERVICE( - INormalEfCoreRepository repository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class PURCHASE_PRICE_SERVICE : SettleAccountApplicationBase { - _repository = repository; - } + /// + /// 采购价格单仓储 + /// + private readonly INormalEfCoreRepository _repository; - #region 导入、导出 - /// - /// 导入 - /// - [HttpPost] - public async Task ImportAsync([FromForm] IFormFileCollection files) - { - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - var _ls = ObjectMapper.Map, List>(result); - List _errorList = new List(); - var checkList = new List(); + public PURCHASE_PRICE_SERVICE( + INormalEfCoreRepository repository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _repository = repository; + } - if (_ls.Count > 0) + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] IFormFileCollection files) { - var query = from arc in _ls - group arc by new { arc.LU } - into g - where g.Count() > 1 - select g; - foreach (var itm in query) + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + var _ls = ObjectMapper.Map, List>(result); + List _errorList = new List(); + var checkList = new List(); + + if (_ls.Count > 0) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("零件号{0}有重复", itm.Key.LU), string.Empty)); + var query = from arc in _ls + group arc by new { arc.LU } + into g + where g.Count() > 1 + select g; + foreach (var itm in query) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("零件号{0}有重复", itm.Key.LU), string.Empty)); + } } - } - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); - } - foreach (var itm in _ls) - { - var _first = _repository.FirstOrDefault(p => p.LU == itm.LU); - if (_first != null) + if (checkList.Count > 0) { - _first.Update(itm.Price); - await _repository.UpdateAsync(_first); + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } - else + foreach (var itm in _ls) { - await _repository.InsertAsync(itm); + var _first = _repository.FirstOrDefault(p => p.LU == itm.LU); + if (_first != null) + { + _first.Update(itm.Price); + await _repository.UpdateAsync(_first).ConfigureAwait(false); + } + else + { + await _repository.InsertAsync(itm).ConfigureAwait(false); + } } + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(RequestDto input) - { - string fileName = $"采购价格单_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtos = ObjectMapper.Map, List>(entities); + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(RequestDto input) + { + string fileName = $"采购价格单_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); - result.ShouldNotBeNull(); + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); - return fileName; - } - #endregion + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - #endregion + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs index d1a598e2..45a9746f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/BeiSeSyncAppService.cs @@ -6,34 +6,35 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 备件发运同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class BeiSeSyncAppService : JitSeSyncAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// 备件发运同步 /// - public BeiSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class BeiSeSyncAppService : JitSeSyncAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public BeiSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) { - SyncTableName = "BeiSeSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.北汽4S备件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "BeiSeSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.北汽4S备件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.北汽4S备件BBAC }, - BusinessType = EnumBusinessType.BeiJian - }; - } + BusinessType = EnumBusinessType.BeiJian + }; + } - [UnitOfWork(IsDisabled = true)] - public virtual async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public virtual async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs index f19bf661..6ab897ee 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/HandSeSyncAppService.cs @@ -9,43 +9,44 @@ using Volo.Abp; using Volo.Abp.Application.Services; using Volo.Abp.Uow; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 手动同步 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class HandSeSyncAppService : ApplicationService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { - private readonly IServiceProvider _applicationServices; - - public HandSeSyncAppService(IHost host) - { - _applicationServices = host.Services ?? throw new ArgumentNullException(); - } - /// - /// 同步 + /// 手动同步 /// - [HttpPost] - [UnitOfWork(IsDisabled = true)] - public virtual async Task SyncAsync([FromBody] EnumBusinessType businessType) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class HandSeSyncAppService : ApplicationService { - using var scope = this._applicationServices.CreateScope(); - IInvocable seSyncAppService = businessType switch + private readonly IServiceProvider _applicationServices; + + public HandSeSyncAppService(IHost host) + { + _applicationServices = host.Services ?? throw new ArgumentNullException(); + } + + /// + /// 同步 + /// + [HttpPost] + [UnitOfWork(IsDisabled = true)] + public virtual async Task SyncAsync([FromBody] EnumBusinessType businessType) { - EnumBusinessType.JisBBAC => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService(), - EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService(), - _ => throw new UserFriendlyException($"{nameof(businessType)}参数值无效", "403") - }; - await seSyncAppService.Invoke().ConfigureAwait(false); - return new JsonResult(new { code = 200, message = "同步成功" }); + using var scope = this._applicationServices.CreateScope(); + IInvocable seSyncAppService = businessType switch + { + EnumBusinessType.JisBBAC => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.JisHBPO => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.MaiDanJianBBAC => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.MaiDanJianHBPO => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.ZhiGongJianBBAC => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.ZhiGongJianHBPO => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.BeiJian => scope.ServiceProvider.GetRequiredService(), + EnumBusinessType.YinDuJian => scope.ServiceProvider.GetRequiredService(), + _ => throw new UserFriendlyException($"{nameof(businessType)}参数值无效", "403") + }; + await seSyncAppService.Invoke().ConfigureAwait(false); + return new JsonResult(new { code = 200, message = "同步成功" }); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index ede1116f..c931c069 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -9,126 +9,127 @@ using Microsoft.Extensions.DependencyInjection; using SettleAccount.Domain.BQ; using Volo.Abp.Application.Services; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// JisBBAC 发运数据与EDI数据对比 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { - private readonly IServiceProvider _serviceProvider; - private readonly EnumBusinessType _businessType; - - public JisBBACSeEdiCompareAppService(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - _businessType = EnumBusinessType.JisBBAC; - } - /// - /// 执行 + /// JisBBAC 发运数据与EDI数据对比 /// - public async Task Invoke() + [ApiExplorerSettings(IgnoreApi = true)] + public class JisBBACSeEdiCompareAppService : ApplicationService, IInvocable { - using var serviceScope = _serviceProvider.CreateScope(); - var db = serviceScope.ServiceProvider.GetRequiredService(); + private readonly IServiceProvider _serviceProvider; + private readonly EnumBusinessType _businessType; - await HandDelEdiDataAsync().ConfigureAwait(false); - - var seDetailGroup = db.Set() - .Where(t => t.BusinessType == _businessType) - .Where(t => t.IsHaveEdiData == false) - .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) - .Select(t => t.Key); - var ediDetailGroup = db.Set() - .Where(t => t.IsDeleted == false && t.IsHaveSeData == false) - .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) - .Select(t => t.Key); + public JisBBACSeEdiCompareAppService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + _businessType = EnumBusinessType.JisBBAC; + } - var keyCodes = (from se in seDetailGroup - from edi in ediDetailGroup - where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace - select new { se.PN, se.CustomerPartCodeNoSpace } - ).Take(5_000).ToList(); - if (keyCodes.Any()) + /// + /// 执行 + /// + public async Task Invoke() { - var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); + using var serviceScope = _serviceProvider.CreateScope(); + var db = serviceScope.ServiceProvider.GetRequiredService(); + + await HandDelEdiDataAsync().ConfigureAwait(false); - var seDetails = db.Set() + var seDetailGroup = db.Set() .Where(t => t.BusinessType == _businessType) .Where(t => t.IsHaveEdiData == false) - .Where(t => pns.Contains(t.PN)) - .AsEnumerable() - .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) - .ToList(); - var ediDetails = db.Set() - .Where(t => t.IsDeleted == false) - .Where(t => t.IsHaveSeData == false) - .Where(t => pns.Contains(t.PN)) - .AsEnumerable() - .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) - .ToList(); - seDetails.ForEach(t => t.IsHaveEdiData = true); - ediDetails.ForEach(t => t.IsHaveSeData = true); - using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); - await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - } - } - } + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); + var ediDetailGroup = db.Set() + .Where(t => t.IsDeleted == false && t.IsHaveSeData == false) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); - /// - /// 处理删除的EDI数据 - /// - private async Task HandDelEdiDataAsync() - { - /* - * 处理有发运数据状态是删除的数据 - * 获取对应的发运数据 - * 设置发运数据状态为无EDI数据 - * 设置EDI数据状态为无发运数据 - */ - using var serviceScope = _serviceProvider.CreateScope(); - var db = serviceScope.ServiceProvider.GetRequiredService(); - var seed = 0; - while (seed < 10) - { - seed++; - //Edi 删除的数据(有发运数据) - var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList(); - if (ediDelKeyCodes.Any()) + var keyCodes = (from se in seDetailGroup + from edi in ediDetailGroup + where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace + select new { se.PN, se.CustomerPartCodeNoSpace } + ).Take(5_000).ToList(); + if (keyCodes.Any()) { + var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); + var seDetails = db.Set() - .Where(t => t.IsHaveEdiData == true) - .Where(t => ediDelKeyCodes.Contains(t.PN)) + .Where(t => t.BusinessType == _businessType) + .Where(t => t.IsHaveEdiData == false) + .Where(t => pns.Contains(t.PN)) + .AsEnumerable() + .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) .ToList(); - if (seDetails.Any()) - { - seDetails.ForEach(t => t.IsHaveEdiData = false); - await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); - } - var ediDetails = db.Set() - .Where(t => t.IsHaveSeData == true) - .Where(t => ediDelKeyCodes.Contains(t.PN)) + .Where(t => t.IsDeleted == false) + .Where(t => t.IsHaveSeData == false) + .Where(t => pns.Contains(t.PN)) + .AsEnumerable() + .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) .ToList(); - if (ediDetails.Any()) + seDetails.ForEach(t => t.IsHaveEdiData = true); + ediDetails.ForEach(t => t.IsHaveSeData = true); + using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false); + try { - ediDetails.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); } } - else + } + + /// + /// 处理删除的EDI数据 + /// + private async Task HandDelEdiDataAsync() + { + /* + * 处理有发运数据状态是删除的数据 + * 获取对应的发运数据 + * 设置发运数据状态为无EDI数据 + * 设置EDI数据状态为无发运数据 + */ + using var serviceScope = _serviceProvider.CreateScope(); + var db = serviceScope.ServiceProvider.GetRequiredService(); + var seed = 0; + while (seed < 10) { - break; + seed++; + //Edi 删除的数据(有发运数据) + var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList(); + if (ediDelKeyCodes.Any()) + { + var seDetails = db.Set() + .Where(t => t.IsHaveEdiData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (seDetails.Any()) + { + seDetails.ForEach(t => t.IsHaveEdiData = false); + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); + } + + var ediDetails = db.Set() + .Where(t => t.IsHaveSeData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (ediDetails.Any()) + { + ediDetails.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + } + } + else + { + break; + } } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs index a9be0342..0cf47d72 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncAppService.cs @@ -7,40 +7,41 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// JisBBAC发运同步 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class JisBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// JisBBAC发运同步 /// - public JisBBACSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - SeSyncExtendManager syncExtendManager - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class JisBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public JisBBACSeSyncAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, + SeSyncExtendManager syncExtendManager + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) { - SyncTableName = "JisBBACSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "JisBBACSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.保险杠BBAC, EnumDeliverSubBillType.小件BBAC }, - BusinessType = EnumBusinessType.JisBBAC - }; - } + BusinessType = EnumBusinessType.JisBBAC + }; + } - [UnitOfWork(IsDisabled = true)] - public async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs index 4824580e..c75a0375 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeSyncBaseAppService.cs @@ -12,191 +12,192 @@ using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// Jis发运数据同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// WMS数据上下文 - /// - private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; - /// - /// 数据上下文 + /// Jis发运数据同步 /// - private readonly SettleAccountDbContext _settleAccountDbContext; - /// - /// 发运同步扩展 - /// - private readonly SeSyncExtendManager _syncExtendManager; - - /// - /// 构造 - /// - public JisBBACSeSyncBaseAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - SeSyncExtendManager syncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class JisBBACSeSyncBaseAppService : ApplicationService, IInvocable { - _wmsBJBMPTContext = wmsBJBMPTContext; - _settleAccountDbContext = settleAccountDbContext; - _syncExtendManager = syncExtendManager; - } - - /// - /// 发运同步配置 - /// - public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// WMS数据上下文 + /// + private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// + /// 发运同步扩展 + /// + private readonly SeSyncExtendManager _syncExtendManager; - [HttpPost] - public async Task Invoke() - { - if (SeSyncConfigInfo == null) + /// + /// 构造 + /// + public JisBBACSeSyncBaseAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, + SeSyncExtendManager syncExtendManager) { - return; + _wmsBJBMPTContext = wmsBJBMPTContext; + _settleAccountDbContext = settleAccountDbContext; + _syncExtendManager = syncExtendManager; } - await SyncJitRecordAsync().ConfigureAwait(false); - await SyncJisRecordAsync().ConfigureAwait(false); - } - /// - /// 同步JitRecord - /// - private async Task SyncJitRecordAsync() - { - //同步表名称 - var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit"; - //同步发运主类型 - var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; - //同步发运子类型 - var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - var seed = 0; - while (seed < 10) - { - seed++; - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - var syncPosition = syncPositionFlag?.Position ?? "0"; + /// + /// 发运同步配置 + /// + public SeSyncConfig SeSyncConfigInfo { get; set; } - //WMS发运记录 - var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD - .Where(t => t.UID > int.Parse(syncPosition)) - .Where(t => t.DeliverBillType == deliverBillType) - .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) - .OrderBy(b => b.UID).Take(100_000).ToList(); - var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); - if (jisSeDetails.Any()) - { - await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); - } - else + [HttpPost] + public async Task Invoke() + { + if (SeSyncConfigInfo == null) { - break; + return; } + await SyncJitRecordAsync().ConfigureAwait(false); + await SyncJisRecordAsync().ConfigureAwait(false); } - } - /// - /// 同步JisRecord - /// - private async Task SyncJisRecordAsync() - { - //同步表名称 - var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis"; - //同步发运主类型 - var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; - //同步发运子类型 - var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - var seed = 0; - while (seed < 10) + /// + /// 同步JitRecord + /// + private async Task SyncJitRecordAsync() { - seed++; - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - var syncPosition = syncPositionFlag?.Position ?? "0"; - - //WMS发运记录 - var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD - .Where(t => t.UID > int.Parse(syncPosition)) - .Where(t => t.DeliverBillType == deliverBillType) - .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) - .OrderBy(b => b.UID).Take(100_000).ToList(); - var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); - if (jisSeDetails.Any()) + //同步表名称 + var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit"; + //同步发运主类型 + var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; + //同步发运子类型 + var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + var seed = 0; + while (seed < 10) { - await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); - } - else - { - break; + seed++; + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + var syncPosition = syncPositionFlag?.Position ?? "0"; + + //WMS发运记录 + var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD + .Where(t => t.UID > int.Parse(syncPosition)) + .Where(t => t.DeliverBillType == deliverBillType) + .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) + .OrderBy(b => b.UID).Take(100_000).ToList(); + var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); + if (jisSeDetails.Any()) + { + await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); + } + else + { + break; + } } } - } - /// - /// 发运数据入库 - /// - private async Task SeDataPutInStorageAsync(List seDetails, bool isJisTable) - { - //同步表名称 - var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + - "_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - - //客户零件号和厂内零件号 - var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); - if (luRePartCodes.Any()) + /// + /// 同步JisRecord + /// + private async Task SyncJisRecordAsync() { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); - await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); + //同步表名称 + var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis"; + //同步发运主类型 + var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; + //同步发运子类型 + var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + var seed = 0; + while (seed < 10) + { + seed++; + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + var syncPosition = syncPositionFlag?.Position ?? "0"; + + //WMS发运记录 + var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD + .Where(t => t.UID > int.Parse(syncPosition)) + .Where(t => t.DeliverBillType == deliverBillType) + .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) + .OrderBy(b => b.UID).Take(100_000).ToList(); + var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); + if (jisSeDetails.Any()) + { + await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); + } + else + { + break; + } + } } - seDetails.ForEach(t => + /// + /// 发运数据入库 + /// + private async Task SeDataPutInStorageAsync(List seDetails, bool isJisTable) { - t.SetId(GuidGenerator.Create()); - t.BusinessType = businessType; - t.CustomerPartCodeNoSpace = t.LU.Replace(" ", ""); - t.KeyCode = t.PN + t.LU; - if (t.BillTime != null) + //同步表名称 + var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + + "_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + + //客户零件号和厂内零件号 + var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + if (luRePartCodes.Any()) { - t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); + await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); } - }); - var syncPosition = seDetails.Last().UID.ToString(); - using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - if (syncPositionFlag != null) + seDetails.ForEach(t => { - syncPositionFlag.Position = syncPosition; - _settleAccountDbContext.Update(syncPositionFlag); - } - else + t.SetId(GuidGenerator.Create()); + t.BusinessType = businessType; + t.CustomerPartCodeNoSpace = t.LU.Replace(" ", ""); + t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } + }); + var syncPosition = seDetails.Last().UID.ToString(); + + using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); + try { - syncPositionFlag = new SyncPositionFlag() + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + if (syncPositionFlag != null) + { + syncPositionFlag.Position = syncPosition; + _settleAccountDbContext.Update(syncPositionFlag); + } + else { - TableName = syncTableName, - Position = syncPosition - }; - _settleAccountDbContext.Add(syncPositionFlag); + syncPositionFlag = new SyncPositionFlag() + { + TableName = syncTableName, + Position = syncPosition + }; + _settleAccountDbContext.Add(syncPositionFlag); + } + await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); + await _syncExtendManager.JisSeDetailsSaveConsignAsync(seDetails, isJisTable).ConfigureAwait(false); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + throw; } - await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); - await _syncExtendManager.JisSeDetailsSaveConsignAsync(seDetails, isJisTable).ConfigureAwait(false); - await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - throw; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs index 993ba794..16837783 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeEdiCompareAppService.cs @@ -10,120 +10,121 @@ using Microsoft.Extensions.DependencyInjection; using SettleAccount.Domain.BQ; using Volo.Abp.Application.Services; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// JisHBPO 发运数据与EDI数据对比 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { - private readonly IServiceProvider _serviceProvider; - private readonly EnumBusinessType _businessType; - - public JisHBPOSeEdiCompareAppService(IServiceProvider serviceProvider) - { - _serviceProvider = serviceProvider; - _businessType = EnumBusinessType.JisHBPO; - } - /// - /// 执行 + /// JisHBPO 发运数据与EDI数据对比 /// - public async Task Invoke() + [ApiExplorerSettings(IgnoreApi = true)] + public class JisHBPOSeEdiCompareAppService : ApplicationService, IInvocable { - using var serviceScope = _serviceProvider.CreateScope(); - var db = serviceScope.ServiceProvider.GetRequiredService(); + private readonly IServiceProvider _serviceProvider; + private readonly EnumBusinessType _businessType; - await HandDelEdiDataAsync().ConfigureAwait(false); - - var seDetailGroup = db.Set() - .Where(t => t.BusinessType == _businessType) - .Where(t => t.IsHaveEdiData == false) - .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) - .Select(t => t.Key); - var ediDetailGroup = db.Set() - .Where(t => t.IsDeleted == false && t.IsHaveSeData == false) - .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) - .Select(t => t.Key); + public JisHBPOSeEdiCompareAppService(IServiceProvider serviceProvider) + { + _serviceProvider = serviceProvider; + _businessType = EnumBusinessType.JisHBPO; + } - var keyCodes = (from se in seDetailGroup - from edi in ediDetailGroup - where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace - select new { se.PN, se.CustomerPartCodeNoSpace } - ).Take(5_000).ToList(); - if (keyCodes.Any()) + /// + /// 执行 + /// + public async Task Invoke() { - var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); + using var serviceScope = _serviceProvider.CreateScope(); + var db = serviceScope.ServiceProvider.GetRequiredService(); + + await HandDelEdiDataAsync().ConfigureAwait(false); - var seDetails = db.Set() + var seDetailGroup = db.Set() .Where(t => t.BusinessType == _businessType) .Where(t => t.IsHaveEdiData == false) - .Where(t => pns.Contains(t.PN)) - .AsEnumerable() - .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) - .ToList(); - var ediDetails = db.Set() - .Where(t => t.IsDeleted == false) - .Where(t => t.IsHaveSeData == false) - .Where(t => pns.Contains(t.PN)) - .AsEnumerable() - .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) - .ToList(); - seDetails.ForEach(t => t.IsHaveEdiData = true); - ediDetails.ForEach(t => t.IsHaveSeData = true); - using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); - await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - } - } - } + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); + var ediDetailGroup = db.Set() + .Where(t => t.IsDeleted == false && t.IsHaveSeData == false) + .GroupBy(t => new { t.PN, t.CustomerPartCodeNoSpace }) + .Select(t => t.Key); - /// - /// 处理删除的EDI数据 - /// - private async Task HandDelEdiDataAsync() - { - using var serviceScope = _serviceProvider.CreateScope(); - var db = serviceScope.ServiceProvider.GetRequiredService(); - var seed = 0; - while (seed < 10) - { - seed++; - //Edi 删除的数据(有发运数据) - var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList(); - if (ediDelKeyCodes.Any()) + var keyCodes = (from se in seDetailGroup + from edi in ediDetailGroup + where se.PN == edi.PN && se.CustomerPartCodeNoSpace == edi.CustomerPartCodeNoSpace + select new { se.PN, se.CustomerPartCodeNoSpace } + ).Take(5_000).ToList(); + if (keyCodes.Any()) { + var pns = keyCodes.Select(t => t.PN).Distinct().ToList(); + var seDetails = db.Set() - .Where(t => t.IsHaveEdiData == true) - .Where(t => ediDelKeyCodes.Contains(t.PN)) + .Where(t => t.BusinessType == _businessType) + .Where(t => t.IsHaveEdiData == false) + .Where(t => pns.Contains(t.PN)) + .AsEnumerable() + .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) .ToList(); - if (seDetails.Any()) - { - seDetails.ForEach(t => t.IsHaveEdiData = false); - await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); - } - var ediDetails = db.Set() - .Where(t => t.IsHaveSeData == true) - .Where(t => ediDelKeyCodes.Contains(t.PN)) + .Where(t => t.IsDeleted == false) + .Where(t => t.IsHaveSeData == false) + .Where(t => pns.Contains(t.PN)) + .AsEnumerable() + .GroupJoin(keyCodes, x => new { x.PN, x.CustomerPartCodeNoSpace }, y => y, (x, y) => x) .ToList(); - if (ediDetails.Any()) + seDetails.ForEach(t => t.IsHaveEdiData = true); + ediDetails.ForEach(t => t.IsHaveSeData = true); + using var transaction = await db.Database.BeginTransactionAsync().ConfigureAwait(false); + try { - ediDetails.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); } } - else + } + + /// + /// 处理删除的EDI数据 + /// + private async Task HandDelEdiDataAsync() + { + using var serviceScope = _serviceProvider.CreateScope(); + var db = serviceScope.ServiceProvider.GetRequiredService(); + var seed = 0; + while (seed < 10) { - break; + seed++; + //Edi 删除的数据(有发运数据) + var ediDelKeyCodes = db.Set().Where(t => t.IsDeleted == true && t.IsHaveSeData == true).GroupBy(t => t.PN).Select(t => t.Key).Take(1000).ToList(); + if (ediDelKeyCodes.Any()) + { + var seDetails = db.Set() + .Where(t => t.IsHaveEdiData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (seDetails.Any()) + { + seDetails.ForEach(t => t.IsHaveEdiData = false); + await db.BulkUpdateAsync(seDetails).ConfigureAwait(false); + } + + var ediDetails = db.Set() + .Where(t => t.IsHaveSeData == true) + .Where(t => ediDelKeyCodes.Contains(t.PN)) + .ToList(); + if (ediDetails.Any()) + { + ediDetails.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(ediDetails).ConfigureAwait(false); + } + } + else + { + break; + } } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs index 86bf1454..d8e0205d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncAppService.cs @@ -6,39 +6,40 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// JisHBPO发运同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// JisHBPO发运同步 /// - public JisHBPOSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - SeSyncExtendManager syncExtendManager - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class JisHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public JisHBPOSeSyncAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, + SeSyncExtendManager syncExtendManager + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) { - SyncTableName = "JisHBPOSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "JisHBPOSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.保险杠HBPO, EnumDeliverSubBillType.小件HBPO }, - BusinessType = EnumBusinessType.JisHBPO - }; - } + BusinessType = EnumBusinessType.JisHBPO + }; + } - [UnitOfWork(IsDisabled = true)] - public virtual async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public virtual async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs index 58628561..610a982d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisHBPOSeSyncBaseAppService.cs @@ -12,192 +12,193 @@ using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// Jis发运数据同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// WMS数据上下文 - /// - private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; - /// - /// 数据上下文 + /// Jis发运数据同步 /// - private readonly SettleAccountDbContext _settleAccountDbContext; - /// - /// 发运同步扩展 - /// - private readonly SeSyncExtendManager _syncExtendManager; - - /// - /// 构造 - /// - public JisHBPOSeSyncBaseAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - SeSyncExtendManager syncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class JisHBPOSeSyncBaseAppService : ApplicationService, IInvocable { - _wmsBJBMPTContext = wmsBJBMPTContext; - _settleAccountDbContext = settleAccountDbContext; - _syncExtendManager = syncExtendManager; - _syncExtendManager._settleAccountDbContext = settleAccountDbContext; - } - - /// - /// 发运同步配置 - /// - public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// WMS数据上下文 + /// + private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// + /// 发运同步扩展 + /// + private readonly SeSyncExtendManager _syncExtendManager; - [HttpPost] - public virtual async Task Invoke() - { - if (SeSyncConfigInfo == null) + /// + /// 构造 + /// + public JisHBPOSeSyncBaseAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, + SeSyncExtendManager syncExtendManager) { - return; + _wmsBJBMPTContext = wmsBJBMPTContext; + _settleAccountDbContext = settleAccountDbContext; + _syncExtendManager = syncExtendManager; + _syncExtendManager._settleAccountDbContext = settleAccountDbContext; } - await SyncJitRecordAsync().ConfigureAwait(false); - await SyncJisRecordAsync().ConfigureAwait(false); - } - /// - /// 同步JitRecord - /// - private async Task SyncJitRecordAsync() - { - //同步表名称 - var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit"; - //同步发运主类型 - var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; - //同步发运子类型 - var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - var seed = 0; - while (seed < 10) - { - seed++; - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - var syncPosition = syncPositionFlag?.Position ?? "0"; + /// + /// 发运同步配置 + /// + public SeSyncConfig SeSyncConfigInfo { get; set; } - //WMS发运记录 - var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD - .Where(t => t.UID > int.Parse(syncPosition)) - .Where(t => t.DeliverBillType == deliverBillType) - .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) - .OrderBy(b => b.UID).Take(100_000).ToList(); - var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); - if (jisSeDetails.Any()) - { - await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); - } - else + [HttpPost] + public virtual async Task Invoke() + { + if (SeSyncConfigInfo == null) { - break; + return; } + await SyncJitRecordAsync().ConfigureAwait(false); + await SyncJisRecordAsync().ConfigureAwait(false); } - } - /// - /// 同步JisRecord - /// - private async Task SyncJisRecordAsync() - { - //同步表名称 - var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis"; - //同步发运主类型 - var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; - //同步发运子类型 - var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - var seed = 0; - while (seed < 10) + /// + /// 同步JitRecord + /// + private async Task SyncJitRecordAsync() { - seed++; - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - var syncPosition = syncPositionFlag?.Position ?? "0"; - - //WMS发运记录 - var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD - .Where(t => t.UID > int.Parse(syncPosition)) - .Where(t => t.DeliverBillType == deliverBillType) - .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) - .OrderBy(b => b.UID).Take(100_000).ToList(); - var jisSeDetails = ObjectMapper.Map, List>(wmsRecords); - if (jisSeDetails.Any()) + //同步表名称 + var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jit"; + //同步发运主类型 + var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; + //同步发运子类型 + var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + var seed = 0; + while (seed < 10) { - await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); - } - else - { - break; + seed++; + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + var syncPosition = syncPositionFlag?.Position ?? "0"; + + //WMS发运记录 + var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_JIT_RECORD + .Where(t => t.UID > int.Parse(syncPosition)) + .Where(t => t.DeliverBillType == deliverBillType) + .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) + .OrderBy(b => b.UID).Take(100_000).ToList(); + var jisSeDetails = ObjectMapper.Map, List>(wmsSeRecords); + if (jisSeDetails.Any()) + { + await SeDataPutInStorageAsync(jisSeDetails, false).ConfigureAwait(false); + } + else + { + break; + } } } - } - /// - /// 发运数据入库 - /// - private async Task SeDataPutInStorageAsync(List seDetails, bool isJisTable) - { - //同步表名称 - var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + - "_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - - //客户零件号和厂内零件号 - var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); - if (luRePartCodes.Any()) + /// + /// 同步JisRecord + /// + private async Task SyncJisRecordAsync() { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); - await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); + //同步表名称 + var syncTableName = $"{SeSyncConfigInfo.SyncTableName}_Jis"; + //同步发运主类型 + var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; + //同步发运子类型 + var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + var seed = 0; + while (seed < 10) + { + seed++; + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + var syncPosition = syncPositionFlag?.Position ?? "0"; + + //WMS发运记录 + var wmsRecords = _wmsBJBMPTContext.TM_BJBMPT_JIS_RECORD + .Where(t => t.UID > int.Parse(syncPosition)) + .Where(t => t.DeliverBillType == deliverBillType) + .Where(t => deliverSubBillTypes.Contains(t.DeliverSubBillType)) + .OrderBy(b => b.UID).Take(100_000).ToList(); + var jisSeDetails = ObjectMapper.Map, List>(wmsRecords); + if (jisSeDetails.Any()) + { + await SeDataPutInStorageAsync(jisSeDetails, true).ConfigureAwait(false); + } + else + { + break; + } + } } - seDetails.ForEach(t => + /// + /// 发运数据入库 + /// + private async Task SeDataPutInStorageAsync(List seDetails, bool isJisTable) { - t.SetId(GuidGenerator.Create()); - t.BusinessType = businessType; - t.CustomerPartCodeNoSpace = t.LU.Replace(" ", ""); - t.KeyCode = t.PN + t.LU; - if (t.BillTime != null) + //同步表名称 + var syncTableName = isJisTable ? SeSyncConfigInfo.SyncTableName + + "_Jis" : SeSyncConfigInfo.SyncTableName + "_Jit"; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + + //客户零件号和厂内零件号 + var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + if (luRePartCodes.Any()) { - t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); + await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); } - }); - var syncPosition = seDetails.Last().UID.ToString(); - using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - if (syncPositionFlag != null) + seDetails.ForEach(t => { - syncPositionFlag.Position = syncPosition; - _settleAccountDbContext.Update(syncPositionFlag); - } - else + t.SetId(GuidGenerator.Create()); + t.BusinessType = businessType; + t.CustomerPartCodeNoSpace = t.LU.Replace(" ", ""); + t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } + }); + var syncPosition = seDetails.Last().UID.ToString(); + + using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); + try { - syncPositionFlag = new SyncPositionFlag() + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + if (syncPositionFlag != null) + { + syncPositionFlag.Position = syncPosition; + _settleAccountDbContext.Update(syncPositionFlag); + } + else { - TableName = syncTableName, - Position = syncPosition - }; - _settleAccountDbContext.Add(syncPositionFlag); + syncPositionFlag = new SyncPositionFlag() + { + TableName = syncTableName, + Position = syncPosition + }; + _settleAccountDbContext.Add(syncPositionFlag); + } + await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); + await _syncExtendManager.JisSeDetailsSaveConsignAsync(seDetails, isJisTable).ConfigureAwait(false); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + throw; } - await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); - await _syncExtendManager.JisSeDetailsSaveConsignAsync(seDetails, isJisTable).ConfigureAwait(false); - await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - throw; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs index 72db204a..9a634f4d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JitSeSyncAppService.cs @@ -13,144 +13,145 @@ using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// Jit发运数据同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class JitSeSyncAppService : ApplicationService, IInvocable +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// WMS数据上下文 - /// - private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; - /// - /// 数据上下文 - /// - private readonly SettleAccountDbContext _settleAccountDbContext; - /// - /// 发运同步扩展 + /// Jit发运数据同步 /// - private readonly SeSyncExtendManager _syncExtendManager; - - /// - /// 构造 - /// - public JitSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class JitSeSyncAppService : ApplicationService, IInvocable { - _wmsBJBMPTContext = wmsBJBMPTContext; - _settleAccountDbContext = settleAccountDbContext; - _syncExtendManager = seSyncExtendManager; - _syncExtendManager._settleAccountDbContext = settleAccountDbContext; - } - - /// - /// 发运同步配置 - /// - public SeSyncConfig SeSyncConfigInfo { get; set; } + /// + /// WMS数据上下文 + /// + private readonly WMSBJBMPTDbContext _wmsBJBMPTContext; + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// + /// 发运同步扩展 + /// + private readonly SeSyncExtendManager _syncExtendManager; - [HttpPost] - public async Task Invoke() - { - if (SeSyncConfigInfo == null) + /// + /// 构造 + /// + public JitSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) { - return; + _wmsBJBMPTContext = wmsBJBMPTContext; + _settleAccountDbContext = settleAccountDbContext; + _syncExtendManager = seSyncExtendManager; + _syncExtendManager._settleAccountDbContext = settleAccountDbContext; } - //同步表名称 - var syncTableName = SeSyncConfigInfo.SyncTableName; - //同步发运主类型 - var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; - //同步发运子类型 - var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; - //业务类别 - var businessType = SeSyncConfigInfo.BusinessType; - var seed = 0; - while (seed < 10) - { - seed++; - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - var syncPosition = syncPositionFlag?.Position ?? "0"; - Expression> predicate = (t) => t.DeliverBillType == deliverBillType && t.UID > int.Parse(syncPosition) && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); - //WMS发运记录 - var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).Take(100_000).OrderBy(b => b.UID).ToList(); - var pubSeDetails = ObjectMapper.Map, List>(wmsSeRecords); - if (pubSeDetails.Any()) + /// + /// 发运同步配置 + /// + public SeSyncConfig SeSyncConfigInfo { get; set; } + + [HttpPost] + public async Task Invoke() + { + if (SeSyncConfigInfo == null) { - await SeDataPutInStorageAsync(pubSeDetails).ConfigureAwait(false); + return; } - else + //同步表名称 + var syncTableName = SeSyncConfigInfo.SyncTableName; + //同步发运主类型 + var deliverBillType = SeSyncConfigInfo.SyncDeliverBillType; + //同步发运子类型 + var deliverSubBillTypes = SeSyncConfigInfo.SyncDeliverSubBillTypes; + //业务类别 + var businessType = SeSyncConfigInfo.BusinessType; + var seed = 0; + while (seed < 10) { - break; + seed++; + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + var syncPosition = syncPositionFlag?.Position ?? "0"; + + Expression> predicate = (t) => t.DeliverBillType == deliverBillType && t.UID > int.Parse(syncPosition) && (!deliverSubBillTypes.Any() || deliverSubBillTypes.Contains(t.DeliverSubBillType)); + //WMS发运记录 + var wmsSeRecords = _wmsBJBMPTContext.TM_BJBMPT_OTHER_RECORD.Where(predicate).Take(100_000).OrderBy(b => b.UID).ToList(); + var pubSeDetails = ObjectMapper.Map, List>(wmsSeRecords); + if (pubSeDetails.Any()) + { + await SeDataPutInStorageAsync(pubSeDetails).ConfigureAwait(false); + } + else + { + break; + } } } - } - #region 私有方法 - /// - /// 发运数据入库 - /// - private async Task SeDataPutInStorageAsync(List seDetails) - { - var syncTableName = SeSyncConfigInfo.SyncTableName; - var businessType = SeSyncConfigInfo.BusinessType; - if (seDetails.Any()) + #region 私有方法 + /// + /// 发运数据入库 + /// + private async Task SeDataPutInStorageAsync(List seDetails) { - if (businessType != EnumBusinessType.BeiJian) + var syncTableName = SeSyncConfigInfo.SyncTableName; + var businessType = SeSyncConfigInfo.BusinessType; + if (seDetails.Any()) { - //备件以外其他业务添加客户零件号与厂内零件号关系 - //客户零件号和厂内零件号 - var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); - if (luRePartCodes.Any()) + if (businessType != EnumBusinessType.BeiJian) { - var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); - await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); + //备件以外其他业务添加客户零件号与厂内零件号关系 + //客户零件号和厂内零件号 + var luRePartCodes = seDetails.Where(t => !string.IsNullOrEmpty(t.LU) && !string.IsNullOrEmpty(t.FactoryPartCode)).Select(t => new { t.LU, t.FactoryPartCode }).Distinct().ToList(); + if (luRePartCodes.Any()) + { + var materialRelationships = luRePartCodes.Select(t => new MaterialRelationship(GuidGenerator.Create(), t.FactoryPartCode, "", t.LU, businessType)); + await _syncExtendManager.AddNewMaterialRelationshipsAsync(materialRelationships).ConfigureAwait(false); + } } - } - seDetails.ForEach(t => - { - t.SetId(GuidGenerator.Create()); - t.BusinessType = businessType; - t.CustomerPartCodeNoSpace = t.LU.Replace(" ", ""); - t.KeyCode = t.PN + t.LU; - if (t.BillTime != null) + seDetails.ForEach(t => { - t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); - } - }); - var syncPosition = seDetails.Last().UID.ToString(); + t.SetId(GuidGenerator.Create()); + t.BusinessType = businessType; + t.CustomerPartCodeNoSpace = t.LU.Replace(" ", ""); + t.KeyCode = t.PN + t.LU; + if (t.BillTime != null) + { + t.Version = int.Parse(t.BillTime?.ToString("yyyyMM")); + } + }); + var syncPosition = seDetails.Last().UID.ToString(); - using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); - if (syncPositionFlag != null) + using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); + try { - syncPositionFlag.Position = syncPosition; - _settleAccountDbContext.Update(syncPositionFlag); + var syncPositionFlag = await _settleAccountDbContext.Set().FirstOrDefaultAsync(t => t.TableName == syncTableName).ConfigureAwait(false); + if (syncPositionFlag != null) + { + syncPositionFlag.Position = syncPosition; + _settleAccountDbContext.Update(syncPositionFlag); + } + else + { + syncPositionFlag = new SyncPositionFlag() + { + TableName = syncTableName, + Position = syncPosition + }; + _settleAccountDbContext.Add(syncPositionFlag); + } + await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); + await _syncExtendManager.PubSeDetailsSaveConsignAsync(seDetails).ConfigureAwait(false); + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); } - else + catch (Exception) { - syncPositionFlag = new SyncPositionFlag() - { - TableName = syncTableName, - Position = syncPosition - }; - _settleAccountDbContext.Add(syncPositionFlag); + await transaction.RollbackAsync().ConfigureAwait(false); + throw; } - await _settleAccountDbContext.BulkInsertAsync(seDetails).ConfigureAwait(false); - await _syncExtendManager.PubSeDetailsSaveConsignAsync(seDetails).ConfigureAwait(false); - await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - throw; } } + #endregion } - #endregion } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs index 607ac8c5..b48ef4e6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanBBACSeSyncAppService.cs @@ -7,40 +7,41 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 买单件BBAC发运同步 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class MaiDanBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// 买单件BBAC发运同步 /// - public MaiDanBBACSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - SeSyncExtendManager syncExtendManager - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class MaiDanBBACSeSyncAppService : JisBBACSeSyncBaseAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public MaiDanBBACSeSyncAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, + SeSyncExtendManager syncExtendManager + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) { - SyncTableName = "MaiDanBBACSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "MaiDanBBACSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.买单件保险杠BBAC, EnumDeliverSubBillType.买单件小件BBAC }, - BusinessType = EnumBusinessType.MaiDanJianBBAC - }; - } + BusinessType = EnumBusinessType.MaiDanJianBBAC + }; + } - [UnitOfWork(IsDisabled = true)] - public async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs index a9837c7e..22f49bfd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MaiDanHBPOSeSyncAppService.cs @@ -6,39 +6,40 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 买单件HBPO发运同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class MaiDanHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// 买单件HBPO发运同步 /// - public MaiDanHBPOSeSyncAppService( - WMSBJBMPTDbContext wmsBJBMPTContext, - SettleAccountDbContext settleAccountDbContext, - SeSyncExtendManager syncExtendManager - ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class MaiDanHBPOSeSyncAppService : JisHBPOSeSyncBaseAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public MaiDanHBPOSeSyncAppService( + WMSBJBMPTDbContext wmsBJBMPTContext, + SettleAccountDbContext settleAccountDbContext, + SeSyncExtendManager syncExtendManager + ) : base(wmsBJBMPTContext, settleAccountDbContext, syncExtendManager) { - SyncTableName = "MaiDanHBPOSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "MaiDanHBPOSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.JIS件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.买单件保险杠HBPO, EnumDeliverSubBillType.买单件小件HBPO }, - BusinessType = EnumBusinessType.MaiDanJianHBPO - }; - } + BusinessType = EnumBusinessType.MaiDanJianHBPO + }; + } - [UnitOfWork(IsDisabled = true)] - public async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index c582bd3f..b68e0b09 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -1,376 +1,358 @@ using System; using System.Collections.Generic; using System.Linq; -using System.ServiceModel.Channels; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using DocumentFormat.OpenXml.Office2010.Excel; using EFCore.BulkExtensions; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.EntityFrameworkCore.Metadata.Conventions; -using Newtonsoft.Json; -using Nito.AsyncEx; -using NPOI.HSSF.Util; -using NPOI.OpenXmlFormats; -using NPOI.SS.Formula.Functions; using SettleAccount.Bases; using SettleAccount.Domain.BQ; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.Application.Services; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Emailing; using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.CodeSettings; -using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; -public class PendingDeductionService : ApplicationService, ITransientDependency, IExportJob +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { + public class PendingDeductionService : ApplicationService, ITransientDependency, IExportJob + { - protected readonly SettleAccountDbContext _dbcontext; - - private readonly IEmailSender _emailSender; + protected readonly SettleAccountDbContext _dbcontext; - public PendingDeductionService( - SettleAccountDbContext dbcontext, - IEmailSender emailSender - ) - { - _emailSender = emailSender; - _dbcontext = dbcontext; + private readonly IEmailSender _emailSender; - } - [UnitOfWork(false)] - public string ExportFile(Guid id, List exportName, List property) - { + public PendingDeductionService( + SettleAccountDbContext dbcontext, + IEmailSender emailSender + ) + { + _emailSender = emailSender; + _dbcontext = dbcontext; - var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; - var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; - var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value; - var email = string.Empty; - // property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value; - var list = billList.Split(","); - var projectList = _dbcontext.Set().Where(p => p.Project == "库位"); - if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian") + } + [UnitOfWork(false)] + public string ExportFile(Guid id, List exportName, List property) { - var jisdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis - if (jisdetail != null && jisdetail.Count() > 0) + + var billList = property.Where(p => p.Name == "BillNumList").FirstOrDefault().Value; + var type = property.Where(p => p.Name == "Type").FirstOrDefault().Value; + var isout = property.Where(p => p.Name == "IsOut").FirstOrDefault().Value; + var email = string.Empty; + // property.Where(p => p.Name == "CurrentUserEmail").FirstOrDefault().Value; + var list = billList.Split(","); + var projectList = _dbcontext.Set().Where(p => p.Project == "库位"); + if (type == "JisBBAC" || type == "ZhiGongJianBBAC" || type == "MaiDanJianBBAC" || type == "BeiJian") { - foreach (var itm in jisdetail) + var jisdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisBBAC);//jis + if (jisdetail != null && jisdetail.Any()) { - if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) + foreach (var itm in jisdetail) { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; - } - else - { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; + if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; + } + else + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; + } } + Sync(jisdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); } - Sync(jisdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); - } - var mdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件 - if (mdetail != null && mdetail.Count() > 0) - { - foreach (var itm in jisdetail) + var mdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianBBAC);//买单件 + if (mdetail != null && mdetail.Any()) { - if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) + foreach (var itm in jisdetail) { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; - } - else - { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; + if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC").Description; + } + else + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "JisBBAC顺义").Description; + } } + Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); } - Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); - } - var detailist1 = _dbcontext.Set().Where(p => list.Contains(p.BillNum)).ToList(); + var detailist1 = _dbcontext.Set().Where(p => list.Contains(p.BillNum)).ToList(); - if (detailist1.Count > 0) - { - var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianBBAC).ToList(); - foreach (var itm in zgbbaclist) + if (detailist1.Count > 0) { - if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) - { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "ZhiGongJianBBAC").Description; - } - else + var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianBBAC).ToList(); + foreach (var itm in zgbbaclist) { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "ZhiGongJianBBAC顺义").Description; + if (itm.Site == "1040" && string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "ZhiGongJianBBAC").Description; + } + else + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "ZhiGongJianBBAC顺义").Description; + } } - } - Sync(zgbbaclist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); - var ydlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.YinDuJian).ToList(); - if (ydlist.Count > 0) - { - foreach (var itm in zgbbaclist) + Sync(zgbbaclist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); + var ydlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.YinDuJian).ToList(); + if (ydlist.Count > 0) { - if (string.IsNullOrEmpty(itm.Extend2)) + foreach (var itm in zgbbaclist) { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description; + if (string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "YinDuJian").Description; + } } + Sync(ydlist, EnumDeliverBjBmpBillType.印度件, email, isout == "out" ? true : false); } - Sync(ydlist, EnumDeliverBjBmpBillType.印度件, email, isout == "out" ? true : false); - } - var bjlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.BeiJian).ToList(); - if (bjlist.Count > 0) - { - foreach (var itm in bjlist) + var bjlist = detailist1.Where(p => p.BusinessType == EnumBusinessType.BeiJian).ToList(); + if (bjlist.Count > 0) { - if (string.IsNullOrEmpty(itm.Extend2)) + foreach (var itm in bjlist) { - itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description; + if (string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = projectList.FirstOrDefault(p => p.Value == "BeiJian").Description; + } } + Sync(bjlist, EnumDeliverBjBmpBillType.北汽4S备件, email, isout == "out" ? true : false); } - Sync(bjlist, EnumDeliverBjBmpBillType.北汽4S备件, email, isout == "out" ? true : false); } } - } - else if (type == "JisHBPO" || type == "ZhiGongJianHBPO" || type == "MaiDanJianHBPO") - { - var detailist = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisHBPO).ToList(); - foreach (var itm in detailist) + else if (type == "JisHBPO" || type == "ZhiGongJianHBPO" || type == "MaiDanJianHBPO") { - if (string.IsNullOrEmpty(itm.Extend2)) + var detailist = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.JisHBPO).ToList(); + foreach (var itm in detailist) { - itm.Extend2 = "CC017"; + if (string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = "CC017"; + } } - } - Sync(detailist, EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); - var mdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO);//买单件 - foreach (var itm in mdetail) - { - if (string.IsNullOrEmpty(itm.Extend2)) + Sync(detailist, EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); + var mdetail = _dbcontext.Set().Where(p => list.Contains(p.BillNum) && p.BusinessType == EnumBusinessType.MaiDanJianHBPO);//买单件 + foreach (var itm in mdetail) { - itm.Extend2 = "CC017"; + if (string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = "CC017"; + } } - } - Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); - var detailist1 = _dbcontext.Set().Where(p => list.Contains(p.BillNum)).ToList(); - var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianHBPO).ToList(); - foreach (var itm in zgbbaclist) - { - if (string.IsNullOrEmpty(itm.Extend2)) + Sync(mdetail.ToList(), EnumDeliverBjBmpBillType.JIS件, email, isout == "out" ? true : false); + var detailist1 = _dbcontext.Set().Where(p => list.Contains(p.BillNum)).ToList(); + var zgbbaclist = detailist1.Where(p => p.BusinessType == EnumBusinessType.ZhiGongJianHBPO).ToList(); + foreach (var itm in zgbbaclist) { - itm.Extend2 = "CC017"; + if (string.IsNullOrEmpty(itm.Extend2)) + { + itm.Extend2 = "CC017"; + } } + Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); } - Sync(detailist, EnumDeliverBjBmpBillType.JIT直供件, email, isout == "out" ? true : false); + return id.ToString(); } - return id.ToString(); - } - //public List GetPagedData(List dataList, int pageNumber, int pageSize) - //{ - // int startIndex = (pageNumber - 1) * pageSize; + //public List GetPagedData(List dataList, int pageNumber, int pageSize) + //{ + // int startIndex = (pageNumber - 1) * pageSize; - // return dataList.Skip(startIndex).Take(pageSize).ToList(); - //} - //public int CalculatePageCount(int totalCount, int pageSize) - //{ - // int pageCount = totalCount / pageSize; - // if (totalCount % pageSize != 0) - // { - // pageCount += 1; - // } - // return pageCount; - //} + // return dataList.Skip(startIndex).Take(pageSize).ToList(); + //} + //public int CalculatePageCount(int totalCount, int pageSize) + //{ + // int pageCount = totalCount / pageSize; + // if (totalCount % pageSize != 0) + // { + // pageCount += 1; + // } + // return pageCount; + //} - public void Sync(List p_ls, EnumDeliverBjBmpBillType bussinessType, string p_email, bool flag = true) where T : PD_BASE, new() - { - var query = from itm in p_ls - select new VmiLog() - { - - CodeType = string.Empty, - BillTime = DateTime.Now, - ChangedTime = DateTime.Now, - Qty = itm.Qty, - RealPartCode = itm.RELU,//替换件 结算数据 RealPartCode->RELU - RealCode = itm.RELU, - LogType = Entities.BQ.Vmi.VmiLogType.Type200, - ChangedQty = (flag == true) ? -itm.Qty : itm.Qty, - ChangedType = VmiType.Out, - //SubBillType = EnumDeliverSubBillType.小件BBAC, - //BillType = EnumDeliverBjBmpBillType.JIS件, - CustPartCode = itm.LU, - SettlementVinCode = itm.PN, - DeliverBillType = bussinessType, - VinCode = itm.PN, - OrderNum = itm.GroupNum, - ErpToLoc = itm.Extend2, //寄售库 - }; - var ls = query.ToList(); - foreach (var itm in ls) + public void Sync(List p_ls, EnumDeliverBjBmpBillType bussinessType, string p_email, bool flag = true) where T : PD_BASE, new() { - itm.SetId(GuidGenerator.Create()); - } - var _first = p_ls.FirstOrDefault(); + var query = from itm in p_ls + select new VmiLog() + { - bool issucess = true; + CodeType = string.Empty, + BillTime = DateTime.Now, + ChangedTime = DateTime.Now, + Qty = itm.Qty, + RealPartCode = itm.RELU,//替换件 结算数据 RealPartCode->RELU + RealCode = itm.RELU, + LogType = Entities.BQ.Vmi.VmiLogType.Type200, + ChangedQty = (flag == true) ? -itm.Qty : itm.Qty, + ChangedType = VmiType.Out, + //SubBillType = EnumDeliverSubBillType.小件BBAC, + //BillType = EnumDeliverBjBmpBillType.JIS件, + CustPartCode = itm.LU, + SettlementVinCode = itm.PN, + DeliverBillType = bussinessType, + VinCode = itm.PN, + OrderNum = itm.GroupNum, + ErpToLoc = itm.Extend2, //寄售库 + }; + var ls = query.ToList(); + foreach (var itm in ls) + { + itm.SetId(GuidGenerator.Create()); + } + var _first = p_ls.FirstOrDefault(); - using (var transaction = _dbcontext.Database.BeginTransaction()) - { - try + bool issucess = true; + + using (var transaction = _dbcontext.Database.BeginTransaction()) { - // 执行批量数据操作 - if (ls != null && ls.Count > 0) + try { - var messagelist = new List(); - foreach (var item in ls) - { - var message = new VmiMessage - { - Message = System.Text.Json.JsonSerializer.Serialize(item), - }; - messagelist.Add(message); - } - _dbcontext.BulkInsert(messagelist); - _dbcontext.BulkInsert(ls, new BulkConfig() { }); - var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); - var pdList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); - if (pdList.Count > 0) + // 执行批量数据操作 + if (ls != null && ls.Count > 0) { - foreach (var item in pdList) + var messagelist = new List(); + foreach (var item in ls) { - if (flag == true) - { - item.State = SettleBillState.已扣减; - } - else + var message = new VmiMessage { - item.State = SettleBillState.客户已收票; - } - + Message = System.Text.Json.JsonSerializer.Serialize(item), + }; + messagelist.Add(message); } - _dbcontext.BulkUpdate(pdList); - } - var bbacList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); - if (bbacList.Count > 0) - { - foreach (var item in bbacList) + _dbcontext.BulkInsert(messagelist); + _dbcontext.BulkInsert(ls, new BulkConfig() { }); + var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); + var pdList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); + if (pdList.Count > 0) { - if (flag == true) + foreach (var item in pdList) { - item.State = SettleBillState.已扣减; - } - else - { - item.State = SettleBillState.客户已收票; + if (flag == true) + { + item.State = SettleBillState.已扣减; + } + else + { + item.State = SettleBillState.客户已收票; + } + } + _dbcontext.BulkUpdate(pdList); } - _dbcontext.BulkUpdate(bbacList); - } - var hbpoList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); - if (hbpoList.Count > 0) - { - foreach (var item in hbpoList) + var bbacList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); + if (bbacList.Count > 0) { - if (flag == true) + foreach (var item in bbacList) { - item.State = SettleBillState.已扣减; + if (flag == true) + { + item.State = SettleBillState.已扣减; + } + else + { + item.State = SettleBillState.客户已收票; + } } - else + _dbcontext.BulkUpdate(bbacList); + } + var hbpoList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); + if (hbpoList.Count > 0) + { + foreach (var item in hbpoList) { - item.State = SettleBillState.客户已收票; + if (flag == true) + { + item.State = SettleBillState.已扣减; + } + else + { + item.State = SettleBillState.客户已收票; + } } + _dbcontext.BulkUpdate(hbpoList); } - _dbcontext.BulkUpdate(hbpoList); - } - var invoiceList = _dbcontext.Set().Where(p => billList.Contains(p.InvbillNum)).ToList(); - if (invoiceList.Count > 0) - { - foreach (var item in invoiceList) + var invoiceList = _dbcontext.Set().Where(p => billList.Contains(p.InvbillNum)).ToList(); + if (invoiceList.Count > 0) { - if (flag == true) + foreach (var item in invoiceList) { - item.State = SettleBillState.已扣减; + if (flag == true) + { + item.State = SettleBillState.已扣减; + } } + _dbcontext.BulkUpdate(invoiceList); } - _dbcontext.BulkUpdate(invoiceList); } + // _emailSender.SendAsync(e) + // 提交事务 + transaction.Commit(); + } + catch (Exception) + { + issucess = false; + // 回滚事务 + transaction.Rollback(); + } - // _emailSender.SendAsync(e) - // 提交事务 - transaction.Commit(); } - catch (Exception) + if (issucess == false) { - issucess = false; - // 回滚事务 - transaction.Rollback(); - - } - } - if (issucess ==false) - { - var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); - var pdList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); - if (pdList.Count > 0) - { - foreach (var item in pdList) + var billList = p_ls.Select(p => p.BillNum).Distinct().ToList(); + var pdList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); + if (pdList.Count > 0) { - if (flag == true) + foreach (var item in pdList) { - item.State = SettleBillState.客户已收票; - } - else - { - item.State = SettleBillState.已扣减; + if (flag == true) + { + item.State = SettleBillState.客户已收票; + } + else + { + item.State = SettleBillState.已扣减; - } + } + } + _dbcontext.BulkUpdate(pdList); } - _dbcontext.BulkUpdate(pdList); - } - var bbacList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); - if (bbacList.Count > 0) - { - foreach (var item in bbacList) + var bbacList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); + if (bbacList.Count > 0) { - if (flag == true) - { - item.State = SettleBillState.客户已收票; - } - else + foreach (var item in bbacList) { - item.State = SettleBillState.已扣减; + if (flag == true) + { + item.State = SettleBillState.客户已收票; + } + else + { + item.State = SettleBillState.已扣减; + } } + _dbcontext.BulkUpdate(bbacList); } - _dbcontext.BulkUpdate(bbacList); - } - var hbpoList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); - if (hbpoList.Count > 0) - { - foreach (var item in hbpoList) + var hbpoList = _dbcontext.Set().Where(p => billList.Contains(p.BillNum)).ToList(); + if (hbpoList.Count > 0) { - if (flag == true) - { - item.State = SettleBillState.客户已收票; - } - else + foreach (var item in hbpoList) { - item.State = SettleBillState.已扣减; + if (flag == true) + { + item.State = SettleBillState.客户已收票; + } + else + { + item.State = SettleBillState.已扣减; + } } + _dbcontext.BulkUpdate(hbpoList); } - _dbcontext.BulkUpdate(hbpoList); } } - } - + } } - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs index 27e64885..9b8d1b95 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncConfig.cs @@ -1,29 +1,30 @@ using System.Collections.Generic; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 发运同步配置 -/// -public class SeSyncConfig +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 同步表名称 + /// 发运同步配置 /// - public string SyncTableName { get; set; } + public class SeSyncConfig + { + /// + /// 同步表名称 + /// + public string SyncTableName { get; set; } - /// - /// 同步发运主类型 - /// - public EnumDeliverBjBmpBillType SyncDeliverBillType { get; set; } + /// + /// 同步发运主类型 + /// + public EnumDeliverBjBmpBillType SyncDeliverBillType { get; set; } - /// - /// 同步发运子类型 - /// - public List SyncDeliverSubBillTypes { get; set; } + /// + /// 同步发运子类型 + /// + public List SyncDeliverSubBillTypes { get; set; } - /// - /// 业务类别 - /// - public EnumBusinessType BusinessType { get; set; } + /// + /// 业务类别 + /// + public EnumBusinessType BusinessType { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs index e03aea72..24ce3ad3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/SeSyncExtendManager.cs @@ -11,182 +11,183 @@ using Volo.Abp.Domain.Services; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.MaterialRelationships; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 发运同步扩展 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class SeSyncExtendManager : DomainService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// DbContext + /// 发运同步扩展 /// - public SettleAccountDbContext _settleAccountDbContext; - - public SeSyncExtendManager(SettleAccountDbContext settleAccountDbContext) + [ApiExplorerSettings(IgnoreApi = true)] + public class SeSyncExtendManager : DomainService { - _settleAccountDbContext = settleAccountDbContext; - } + /// + /// DbContext + /// + public SettleAccountDbContext _settleAccountDbContext; - /// - /// 添加零件关系 - /// - public async Task AddNewMaterialRelationshipsAsync(IEnumerable materialRelationships) - { - //新客户零件号和厂内零件号 - var noHaveLuRePartCodes = from item1 in materialRelationships - join item2 in _settleAccountDbContext.Set() - on new { item1.ErpMaterialCode, item1.SettleMaterialCode, item1.BusinessType } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode, item2.BusinessType } - into temp - from item3 in temp.DefaultIfEmpty() - where item3 == null - select item1; - - if (noHaveLuRePartCodes.Any()) + public SeSyncExtendManager(SettleAccountDbContext settleAccountDbContext) { - await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); + _settleAccountDbContext = settleAccountDbContext; } - } - /// - /// Jis发运数据保存寄售库 - /// - public async Task JisSeDetailsSaveConsignAsync(List seDetails, bool isJisTable) where T : JisSeBase - { - var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); - var returnSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.退货); - var dateTimeNow = DateTime.Now; - - var vmiLogList = deliverSeDetails.Select(t => new VmiLog - { - LogType = VmiLogType.Type100, - ChangedQty = t.Qty, - ChangedType = VmiType.In, - ChangedBy = "WMS", - ChangedNumber = t.PN, - ChangedTime = dateTimeNow, - AssembleData = t.AssembleData, - BillTime = t.BillTime, - CodeType = t.CodeType, - Configcode = t.MESConfigCode, - CustPartCode = t.CustPartCode, - DeliverBillType = t.DeliverBillType, - DeliverSubBillType = t.DeliverSubBillType, - ErpToLoc = t.ErpToLoc, - MatchNumber = t.MatchNumber, - OrderNum = isJisTable ? t.OrderNum : t.JISNum, - PjsNum = t.PjsNum, - Qty = t.Qty, - ReMark = t.Remark, - RealCode = t.RealCode, - RealPartCode = t.PartCode, - Seq = t.Seq, - UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, - VinCode = t.VinCode, - factory = t.Factory - }).ToList(); - var returnVmiLogList = returnSeDetails.Select(t => new VmiLog + /// + /// 添加零件关系 + /// + public async Task AddNewMaterialRelationshipsAsync(IEnumerable materialRelationships) { - LogType = VmiLogType.Type400, - ChangedQty = t.Qty, - ChangedType = VmiType.Out, - ChangedBy = "WMS", - ChangedNumber = t.PN, - ChangedTime = dateTimeNow, - AssembleData = t.AssembleData, - BillTime = t.BillTime, - CodeType = t.CodeType, - Configcode = t.MESConfigCode, - CustPartCode = t.CustPartCode, - DeliverBillType = t.DeliverBillType, - DeliverSubBillType = t.DeliverSubBillType, - ErpToLoc = t.ErpToLoc, - MatchNumber = t.MatchNumber, - OrderNum = isJisTable ? t.OrderNum : t.JISNum, - PjsNum = t.PjsNum, - Qty = -t.Qty, - ReMark = t.Remark, - RealCode = t.RealCode, - RealPartCode = t.PartCode, - Seq = t.Seq, - UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, - VinCode = t.VinCode, - factory = t.Factory - }).ToList(); - vmiLogList.AddRange(returnVmiLogList); - await SaveVmiLogsAsync(vmiLogList).ConfigureAwait(false); - } + //新客户零件号和厂内零件号 + var noHaveLuRePartCodes = from item1 in materialRelationships + join item2 in _settleAccountDbContext.Set() + on new { item1.ErpMaterialCode, item1.SettleMaterialCode, item1.BusinessType } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode, item2.BusinessType } + into temp + from item3 in temp.DefaultIfEmpty() + where item3 == null + select item1; - /// - /// Pub发运数据保存寄售库 - /// - public async Task PubSeDetailsSaveConsignAsync(List seDetails) - { - var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); - var returnSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.退货); - var dateTimeNow = DateTime.Now; + if (noHaveLuRePartCodes.Any()) + { + await _settleAccountDbContext.BulkInsertAsync(noHaveLuRePartCodes.ToList()).ConfigureAwait(false); + } + } - var vmiLogList = deliverSeDetails.Select(t => new VmiLog + /// + /// Jis发运数据保存寄售库 + /// + public async Task JisSeDetailsSaveConsignAsync(List seDetails, bool isJisTable) where T : JisSeBase { - LogType = VmiLogType.Type100, - ChangedQty = t.Qty, - ChangedType = VmiType.In, - ChangedBy = "WMS", - ChangedNumber = t.PN, - ChangedTime = dateTimeNow, - AssembleData = t.AssembleData, - BillTime = t.BillTime, - CustPartCode = t.CustPartCode, - DeliverBillType = t.DeliverBillType, - DeliverSubBillType = t.DeliverSubBillType, - ErpToLoc = t.ToErpLocCode, - OrderNum = t.DeliveryIndex, - Qty = t.Qty, - ReMark = t.Remark, - RealPartCode = t.PartCode - }).ToList(); - var returnVmiLogList = returnSeDetails.Select(t => new VmiLog + var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); + var returnSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.退货); + var dateTimeNow = DateTime.Now; + + var vmiLogList = deliverSeDetails.Select(t => new VmiLog + { + LogType = VmiLogType.Type100, + ChangedQty = t.Qty, + ChangedType = VmiType.In, + ChangedBy = "WMS", + ChangedNumber = t.PN, + ChangedTime = dateTimeNow, + AssembleData = t.AssembleData, + BillTime = t.BillTime, + CodeType = t.CodeType, + Configcode = t.MESConfigCode, + CustPartCode = t.CustPartCode, + DeliverBillType = t.DeliverBillType, + DeliverSubBillType = t.DeliverSubBillType, + ErpToLoc = t.ErpToLoc, + MatchNumber = t.MatchNumber, + OrderNum = isJisTable ? t.OrderNum : t.JISNum, + PjsNum = t.PjsNum, + Qty = t.Qty, + ReMark = t.Remark, + RealCode = t.RealCode, + RealPartCode = t.PartCode, + Seq = t.Seq, + UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, + VinCode = t.VinCode, + factory = t.Factory + }).ToList(); + var returnVmiLogList = returnSeDetails.Select(t => new VmiLog + { + LogType = VmiLogType.Type400, + ChangedQty = t.Qty, + ChangedType = VmiType.Out, + ChangedBy = "WMS", + ChangedNumber = t.PN, + ChangedTime = dateTimeNow, + AssembleData = t.AssembleData, + BillTime = t.BillTime, + CodeType = t.CodeType, + Configcode = t.MESConfigCode, + CustPartCode = t.CustPartCode, + DeliverBillType = t.DeliverBillType, + DeliverSubBillType = t.DeliverSubBillType, + ErpToLoc = t.ErpToLoc, + MatchNumber = t.MatchNumber, + OrderNum = isJisTable ? t.OrderNum : t.JISNum, + PjsNum = t.PjsNum, + Qty = -t.Qty, + ReMark = t.Remark, + RealCode = t.RealCode, + RealPartCode = t.PartCode, + Seq = t.Seq, + UniqueCode = isJisTable ? t.UniqueCode : t.DeliverCode, + VinCode = t.VinCode, + factory = t.Factory + }).ToList(); + vmiLogList.AddRange(returnVmiLogList); + await SaveVmiLogsAsync(vmiLogList).ConfigureAwait(false); + } + + /// + /// Pub发运数据保存寄售库 + /// + public async Task PubSeDetailsSaveConsignAsync(List seDetails) { - LogType = VmiLogType.Type400, - ChangedQty = t.Qty, - ChangedType = VmiType.Out, - ChangedBy = "WMS", - ChangedNumber = t.PN, - ChangedTime = dateTimeNow, - AssembleData = t.AssembleData, - BillTime = t.BillTime, - CustPartCode = t.CustPartCode, - DeliverBillType = t.DeliverBillType, - DeliverSubBillType = t.DeliverSubBillType, - ErpToLoc = t.ToErpLocCode, - OrderNum = t.DeliveryIndex, - Qty = -t.Qty, - ReMark = t.Remark, - RealPartCode = t.PartCode - }).ToList(); - vmiLogList.AddRange(returnVmiLogList); - await SaveVmiLogsAsync(vmiLogList).ConfigureAwait(false); - } + var deliverSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.发货); + var returnSeDetails = seDetails.FindAll(t => t.TransType == EnumDelTransType.退货); + var dateTimeNow = DateTime.Now; - /// - /// 保存寄售库Log - /// - private async Task SaveVmiLogsAsync(List vmiLogs) - { - await SaveVmiMessagesAsync(vmiLogs).ConfigureAwait(false); - await _settleAccountDbContext.BulkInsertAsync(vmiLogs).ConfigureAwait(false); - } + var vmiLogList = deliverSeDetails.Select(t => new VmiLog + { + LogType = VmiLogType.Type100, + ChangedQty = t.Qty, + ChangedType = VmiType.In, + ChangedBy = "WMS", + ChangedNumber = t.PN, + ChangedTime = dateTimeNow, + AssembleData = t.AssembleData, + BillTime = t.BillTime, + CustPartCode = t.CustPartCode, + DeliverBillType = t.DeliverBillType, + DeliverSubBillType = t.DeliverSubBillType, + ErpToLoc = t.ToErpLocCode, + OrderNum = t.DeliveryIndex, + Qty = t.Qty, + ReMark = t.Remark, + RealPartCode = t.PartCode + }).ToList(); + var returnVmiLogList = returnSeDetails.Select(t => new VmiLog + { + LogType = VmiLogType.Type400, + ChangedQty = t.Qty, + ChangedType = VmiType.Out, + ChangedBy = "WMS", + ChangedNumber = t.PN, + ChangedTime = dateTimeNow, + AssembleData = t.AssembleData, + BillTime = t.BillTime, + CustPartCode = t.CustPartCode, + DeliverBillType = t.DeliverBillType, + DeliverSubBillType = t.DeliverSubBillType, + ErpToLoc = t.ToErpLocCode, + OrderNum = t.DeliveryIndex, + Qty = -t.Qty, + ReMark = t.Remark, + RealPartCode = t.PartCode + }).ToList(); + vmiLogList.AddRange(returnVmiLogList); + await SaveVmiLogsAsync(vmiLogList).ConfigureAwait(false); + } - /// - /// 保存寄售库Message - /// - private async Task SaveVmiMessagesAsync(List vmiLogs) - { - var vmiMessages = vmiLogs.Select(t => new VmiMessage + /// + /// 保存寄售库Log + /// + private async Task SaveVmiLogsAsync(List vmiLogs) { - Message = JsonConvert.SerializeObject(t) - }).ToList(); - await _settleAccountDbContext.BulkInsertAsync(vmiMessages).ConfigureAwait(false); + await SaveVmiMessagesAsync(vmiLogs).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(vmiLogs).ConfigureAwait(false); + } + + /// + /// 保存寄售库Message + /// + private async Task SaveVmiMessagesAsync(List vmiLogs) + { + var vmiMessages = vmiLogs.Select(t => new VmiMessage + { + Message = JsonConvert.SerializeObject(t) + }).ToList(); + await _settleAccountDbContext.BulkInsertAsync(vmiMessages).ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs index fb9ac422..22fabaf9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/YinDuSeSyncAppService.cs @@ -6,34 +6,35 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 印度件发运同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// 印度件发运同步 /// - public YinDuSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class YinDuSeSyncAppService : JitSeSyncAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public YinDuSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) { - SyncTableName = "YinDuSeSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.印度件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "YinDuSeSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.印度件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.印度件BBAC }, - BusinessType = EnumBusinessType.YinDuJian - }; - } + BusinessType = EnumBusinessType.YinDuJian + }; + } - [UnitOfWork(IsDisabled = true)] - public virtual async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public virtual async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs index 961c5ee7..acb4f39e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongBBACSeSyncAppService.cs @@ -6,34 +6,35 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 直供件BBAC发运同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// 直供件BBAC发运同步 /// - public ZhiGongBBACSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class ZhiGongBBACSeSyncAppService : JitSeSyncAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public ZhiGongBBACSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) { - SyncTableName = "ZhiGongBBACSeSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "ZhiGongBBACSeSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.JIT直供件BBAC }, - BusinessType = EnumBusinessType.ZhiGongJianBBAC - }; - } + BusinessType = EnumBusinessType.ZhiGongJianBBAC + }; + } - [UnitOfWork(IsDisabled = true)] - public virtual async Task Invoke(IServiceProvider serviceProvider) - { - await this.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public virtual async Task Invoke(IServiceProvider serviceProvider) + { + await this.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs index 9f949af4..67f76f59 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/ZhiGongHBPOSeSyncAppService.cs @@ -6,34 +6,35 @@ using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.EntityFrameworkCore; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 直供件HBPO发运同步 -/// -[ApiExplorerSettings(IgnoreApi = true)] -public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 构造 + /// 直供件HBPO发运同步 /// - public ZhiGongHBPOSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) + [ApiExplorerSettings(IgnoreApi = true)] + public class ZhiGongHBPOSeSyncAppService : JitSeSyncAppService, IJobService { - base.SeSyncConfigInfo = new SeSyncConfig() + /// + /// 构造 + /// + public ZhiGongHBPOSeSyncAppService(WMSBJBMPTDbContext wmsBJBMPTContext, SettleAccountDbContext settleAccountDbContext, SeSyncExtendManager seSyncExtendManager) : base(wmsBJBMPTContext, settleAccountDbContext, seSyncExtendManager) { - SyncTableName = "ZhiGongHBPOSeSync", - SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件, - SyncDeliverSubBillTypes = new List + base.SeSyncConfigInfo = new SeSyncConfig() + { + SyncTableName = "ZhiGongHBPOSeSync", + SyncDeliverBillType = EnumDeliverBjBmpBillType.JIT直供件, + SyncDeliverSubBillTypes = new List { EnumDeliverSubBillType.JIT直供件HBPO }, - BusinessType = EnumBusinessType.ZhiGongJianHBPO - }; - } + BusinessType = EnumBusinessType.ZhiGongJianHBPO + }; + } - [UnitOfWork(IsDisabled = true)] - public virtual async Task Invoke(IServiceProvider serviceProvider) - { - await base.Invoke().ConfigureAwait(false); + [UnitOfWork(IsDisabled = true)] + public virtual async Task Invoke(IServiceProvider serviceProvider) + { + await base.Invoke().ConfigureAwait(false); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs index 0fb06f74..4ef53ff4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/TB_RePartsRelationship_SERVICE.cs @@ -20,126 +20,127 @@ using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// 厂内物料替换件关系 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.BQ { /// - /// 厂内物料替换件关系仓储 - /// - private readonly INormalEfCoreRepository _repository; - - /// - /// 客户零件关系仓储 + /// 厂内物料替换件关系 /// - private readonly INormalEfCoreRepository _materialRelationshipRepository; - - public TB_RePartsRelationship_SERVICE( - INormalEfCoreRepository repository, - INormalEfCoreRepository materialRelationshipRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class TB_RePartsRelationship_SERVICE : SettleAccountApplicationBase { - _repository = repository; - _materialRelationshipRepository = materialRelationshipRepository; - } + /// + /// 厂内物料替换件关系仓储 + /// + private readonly INormalEfCoreRepository _repository; - #region 导入、导出 - /// - /// 导入 - /// - [HttpPost] - public async Task ImportAsync([FromForm] IFormFileCollection files) - { - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); - var _ls = ObjectMapper.Map, List>(result); - List _errorList = new List(); - var checkList = new List(); + /// + /// 客户零件关系仓储 + /// + private readonly INormalEfCoreRepository _materialRelationshipRepository; - if (_ls.Count > 0) + public TB_RePartsRelationship_SERVICE( + INormalEfCoreRepository repository, + INormalEfCoreRepository materialRelationshipRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - //导入文件中的厂内零件号 - var tbRePartsRelationshipLus = _ls.Select(t => new { lu = new List { t.LU, t.RepLU } }).SelectMany(t => t.lu).Distinct(); - var haveLus = _materialRelationshipRepository.Where(t => tbRePartsRelationshipLus.Contains(t.ErpMaterialCode)).Select(t => t.ErpMaterialCode).Distinct().ToList(); + _repository = repository; + _materialRelationshipRepository = materialRelationshipRepository; + } - //导入不存在的厂内零件号 - var exceptLus = tbRePartsRelationshipLus.Except(haveLus); - exceptLus.ForEach(exceptLu => - { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("厂内零件号{0}不存在", exceptLu), string.Empty)); - }); + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] IFormFileCollection files) + { + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); + var _ls = ObjectMapper.Map, List>(result); + List _errorList = new List(); + var checkList = new List(); - var query = from arc in _ls - group arc by new { arc.LU } - into g - where g.Count() > 1 - select g; - foreach (var itm in query) + if (_ls.Count > 0) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("厂内零件号{0}有重复", itm.Key.LU), string.Empty)); + //导入文件中的厂内零件号 + var tbRePartsRelationshipLus = _ls.Select(t => new { lu = new List { t.LU, t.RepLU } }).SelectMany(t => t.lu).Distinct(); + var haveLus = _materialRelationshipRepository.Where(t => tbRePartsRelationshipLus.Contains(t.ErpMaterialCode)).Select(t => t.ErpMaterialCode).Distinct().ToList(); + + //导入不存在的厂内零件号 + var exceptLus = tbRePartsRelationshipLus.Except(haveLus); + exceptLus.ForEach(exceptLu => + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("厂内零件号{0}不存在", exceptLu), string.Empty)); + }); + + var query = from arc in _ls + group arc by new { arc.LU } + into g + where g.Count() > 1 + select g; + foreach (var itm in query) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("厂内零件号{0}有重复", itm.Key.LU), string.Empty)); + } } - } - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); - } - foreach (var itm in _ls) - { - var _first = _repository.FirstOrDefault(p => p.LU == itm.LU); - if (_first != null) + if (checkList.Count > 0) { - _first.Update(itm.LU, itm.RepLU, itm.ClientCode, itm.BusinessType); - await _repository.UpdateAsync(_first).ConfigureAwait(false); + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } - else + foreach (var itm in _ls) { - await _repository.InsertAsync(itm).ConfigureAwait(false); + var _first = _repository.FirstOrDefault(p => p.LU == itm.LU); + if (_first != null) + { + _first.Update(itm.LU, itm.RepLU, itm.ClientCode, itm.BusinessType); + await _repository.UpdateAsync(_first).ConfigureAwait(false); + } + else + { + await _repository.InsertAsync(itm).ConfigureAwait(false); + } } + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(RequestDto input) - { - string fileName = $"客户替换件关系_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(RequestDto input) + { + string fileName = $"客户替换件关系_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); - result.ShouldNotBeNull(); + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); - return fileName; - } - #endregion + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } - #endregion + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index d2a9e314..bf063116 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -42,623 +42,624 @@ using Win.Sfs.Shared; using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class VmiAppService : Controller, IApplicationService, IJobService, ITransientDependency +namespace Win.Sfs.SettleAccount.Entities.BQ { - public static object backupLock = new object(); - private readonly IConfiguration _cfg; - private readonly IGuidGenerator _guidGenerator; - private readonly IServiceProvider _serviceProvider; - private readonly INormalEfCoreRepository _balanceRepository; - private readonly INormalEfCoreRepository _logRepository; - private readonly IBlobContainer _fileContainer; - private readonly IHubContext _hubContext; - private readonly ICurrentUser _currentUser; - private readonly ILogger _logger; - - public VmiAppService(IConfiguration cfg, - IServiceProvider serviceProvider, - IGuidGenerator guidGenerator, - INormalEfCoreRepository balanceRepository, - INormalEfCoreRepository logRepository, - IBlobContainer fileContainer, - IHubContext hubContext, - ICurrentUser currentUser, - ILogger logger) - { - this._cfg = cfg; - this._guidGenerator = guidGenerator; - this._serviceProvider = serviceProvider; - this._balanceRepository = balanceRepository; - this._logRepository = logRepository; - this._fileContainer = fileContainer; - this._hubContext = hubContext; - this._currentUser = currentUser; - this._logger = logger; - LinqToDBForEFTools.Initialize(); - } - - /// - /// Excel 转 JSON - /// - [HttpPost, Consumes("multipart/form-data")] - public async Task> ExcelToJSONAsync(List files) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class VmiAppService : Controller, IApplicationService, IJobService, ITransientDependency { - using var ms = new MemoryStream(); - await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); - return this.ImportInternal(ms.ToArray()).Select(o => o.Item1).ToList(); - } + public static object backupLock = new object(); + private readonly IConfiguration _cfg; + private readonly IGuidGenerator _guidGenerator; + private readonly IServiceProvider _serviceProvider; + private readonly INormalEfCoreRepository _balanceRepository; + private readonly INormalEfCoreRepository _logRepository; + private readonly IBlobContainer _fileContainer; + private readonly IHubContext _hubContext; + private readonly ICurrentUser _currentUser; + private readonly ILogger _logger; - /// - /// 定时备份:0 0 8 26 * ? - /// - [NonAction] - [DisableValidation] - public virtual Task Invoke(IServiceProvider serviceProvider) - { - using var scope = serviceProvider.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - using var transaction = db.Database.BeginTransaction(); - try + public VmiAppService(IConfiguration cfg, + IServiceProvider serviceProvider, + IGuidGenerator guidGenerator, + INormalEfCoreRepository balanceRepository, + INormalEfCoreRepository logRepository, + IBlobContainer fileContainer, + IHubContext hubContext, + ICurrentUser currentUser, + ILogger logger) { - var now = DateTime.Now; - var table = $"Set_VmiBalance_{now.ToString("yyyy_MM_dd_HH_mm_ss")}"; - var snapshot = db.Set().Where(o => o.Name == table).FirstOrDefault(); - if (snapshot == null) - { - snapshot = new VmiSnapshot { Name = now.ToString("yyyy-MM-dd HH:mm:ss"), Start = now, Description = table }; - db.Set().Add(snapshot); - db.SaveChanges(); - db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;"); - db.Database.ExecuteSqlRaw($"alter table {table} add constraint PK_{table} primary key (Id);"); - snapshot.End = DateTime.Now; - transaction.Commit(); - return Task.CompletedTask; - } - throw new UserFriendlyException("备份程序正在运行", "500"); + this._cfg = cfg; + this._guidGenerator = guidGenerator; + this._serviceProvider = serviceProvider; + this._balanceRepository = balanceRepository; + this._logRepository = logRepository; + this._fileContainer = fileContainer; + this._hubContext = hubContext; + this._currentUser = currentUser; + this._logger = logger; + LinqToDBForEFTools.Initialize(); } - catch (Exception ex) + + /// + /// Excel 转 JSON + /// + [HttpPost, Consumes("multipart/form-data")] + public async Task> ExcelToJSONAsync(List files) { - transaction.Rollback(); - throw new UserFriendlyException(ex.ToString(), "500"); + using var ms = new MemoryStream(); + await files.FirstOrDefault().OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); + return this.ImportInternal(ms.ToArray()).Select(o => o.Item1).ToList(); } - } - /// - /// 定时备份:0 0 8 26 * ? - /// - [HttpPost("invoke")] - [DisableValidation] - public virtual IActionResult VmiBackup() - { - lock (backupLock) + /// + /// 定时备份:0 0 8 26 * ? + /// + [NonAction] + [DisableValidation] + public virtual Task Invoke(IServiceProvider serviceProvider) { + using var scope = serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + using var transaction = db.Database.BeginTransaction(); try { - Invoke(_serviceProvider).Wait(); - return new JsonResult(new { Code = 200, Message = "备份成功" }); + var now = DateTime.Now; + var table = $"Set_VmiBalance_{now.ToString("yyyy_MM_dd_HH_mm_ss")}"; + var snapshot = db.Set().Where(o => o.Name == table).FirstOrDefault(); + if (snapshot == null) + { + snapshot = new VmiSnapshot { Name = now.ToString("yyyy-MM-dd HH:mm:ss"), Start = now, Description = table }; + db.Set().Add(snapshot); + db.SaveChanges(); + db.Database.ExecuteSqlRaw($"select * into {table} from Set_VmiBalance;"); + db.Database.ExecuteSqlRaw($"alter table {table} add constraint PK_{table} primary key (Id);"); + snapshot.End = DateTime.Now; + transaction.Commit(); + return Task.CompletedTask; + } + throw new UserFriendlyException("备份程序正在运行", "500"); } catch (Exception ex) { - return new JsonResult(new { Code = 500, Message = ex.Message, Data = ex.ToString() }); + transaction.Rollback(); + throw new UserFriendlyException(ex.ToString(), "500"); } } - } - - /// - /// 1.库存余额查询 - /// - /// - /// - [HttpPost] - public async Task> Balance(RequestDto input) - { - var entities = await _balanceRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _balanceRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - return new PagedResultDto(totalCount, entities); - } - - /// - /// 1.1库存余额导出 - /// - [HttpPost] - public async Task BalanceExport(RequestDto input) - { - var entities = await _balanceRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); - var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - var content = this.GetContent(entities, "库存余额"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); - return fileName; - } - /// - /// 1.2库存余额汇总查询 - /// - /// - /// - [HttpPost] - public async Task> BalanceSum(RequestDto input) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var db = new SettleAccountDbContext(options); - var query = db.Set().FromSqlRaw("select * from Set_VmiBalance"); - var filters = input.Filters.ToLambda(); - if (input.Filters.Count > 0) + /// + /// 定时备份:0 0 8 26 * ? + /// + [HttpPost("invoke")] + [DisableValidation] + public virtual IActionResult VmiBackup() { - query = query.Where(input.Filters.ToLambda()); + lock (backupLock) + { + try + { + Invoke(_serviceProvider).Wait(); + return new JsonResult(new { Code = 200, Message = "备份成功" }); + } + catch (Exception ex) + { + return new JsonResult(new { Code = 500, Message = ex.Message, Data = ex.ToString() }); + } + } } - var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) }); - var totalCount = query2.Count(); - query2 = string.IsNullOrEmpty(input.Sorting) ? query2 : DynamicQueryableExtensions.OrderBy(query2, input.Sorting); - var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); - return new PagedResultDto(totalCount, entities); - } - /// - /// 1.2库存余额汇总导出 - /// - [HttpPost] - public async Task BalanceSumExport(RequestDto input) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var db = new SettleAccountDbContext(options); - var query = db.Set().FromSqlRaw("select * from Set_VmiBalance"); - var filters = input.Filters.ToLambda(); - if (input.Filters.Count > 0) + /// + /// 1.库存余额查询 + /// + /// + /// + [HttpPost] + public async Task> Balance(RequestDto input) { - query = query.Where(input.Filters.ToLambda()); + var entities = await _balanceRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _balanceRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + return new PagedResultDto(totalCount, entities); } - query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); - var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) }); - var totalCount = query2.Count(); - var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - var content = this.GetContent(entities, "库存汇总"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); - return fileName; - } - /// - /// 快照列表 - /// - [HttpPost] - public ListResultDto Snapshot() - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var db = new SettleAccountDbContext(options); - var list = db.Set().AsNoTracking().OrderByDescending(o => o.Start).ToList(); - return new ListResultDto(list); - } - - /// - /// 2.时点库存查询 - /// - [HttpPost] - public async Task> Backup(BackupListRequest input) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var db = new SettleAccountDbContext(options); - var name = input.Name; - var sql = $"select * from {name}"; - var query = db.Set().FromSqlRaw(sql); - var filters = input.Filters.ToLambda(); - if (input.Filters.Count > 0) + /// + /// 1.1库存余额导出 + /// + [HttpPost] + public async Task BalanceExport(RequestDto input) { - query = query.Where(input.Filters.ToLambda()); + var entities = await _balanceRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); + var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; + var content = this.GetContent(entities, "库存余额"); + await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + return fileName; } - var totalCount = query.Count(); - query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); - var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); - return new PagedResultDto(totalCount, entities); - } - /// - /// 2.1时点库存导出 - /// - [HttpPost] - public async Task BackupExport(BackupListRequest input) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var db = new SettleAccountDbContext(options); - var name = input.Name; - var sql = $"select * from {name}"; - var query = db.Set().FromSqlRaw(sql); - var filters = input.Filters.ToLambda(); - if (input.Filters.Count > 0) + /// + /// 1.2库存余额汇总查询 + /// + /// + /// + [HttpPost] + public async Task> BalanceSum(RequestDto input) { - query = query.Where(input.Filters.ToLambda()); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var db = new SettleAccountDbContext(options); + var query = db.Set().FromSqlRaw("select * from Set_VmiBalance"); + var filters = input.Filters.ToLambda(); + if (input.Filters.Count > 0) + { + query = query.Where(input.Filters.ToLambda()); + } + var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) }); + var totalCount = query2.Count(); + query2 = string.IsNullOrEmpty(input.Sorting) ? query2 : DynamicQueryableExtensions.OrderBy(query2, input.Sorting); + var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); + return new PagedResultDto(totalCount, entities); } - var totalCount = query.Count(); - query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); - var entities = await query.ToListAsync().ConfigureAwait(false); - var fileName = $"库存快照_{input.Name}.xlsx"; - var content = this.GetContent(entities, "库存快照"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); - return fileName; - } - /// - /// 3.库存事务查询 - /// - /// - /// - [HttpPost] - public async Task> Log(LogRequestDto input) - { - //按季度计算查询需要 union 的表名 - var start = DateTime.Parse(input.Filters.FirstOrDefault(o => o.Column == "changedTime" && o.Action == EnumFilterAction.BiggerThanOrEqual).Value); - var end = DateTime.Parse(input.Filters.FirstOrDefault(o => o.Column == "changedTime" && o.Action == EnumFilterAction.SmallThan).Value); - var tables = new List(); - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - connection.Open(); - for (var time = start; time <= end; time = time.AddMonths(1)) + /// + /// 1.2库存余额汇总导出 + /// + [HttpPost] + public async Task BalanceSumExport(RequestDto input) { - var tableName = $"Set_VmiLog_{time.Year}_{(time.Month - 1) / 3 + 1}"; - if (!tables.Contains(tableName)) + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var db = new SettleAccountDbContext(options); + var query = db.Set().FromSqlRaw("select * from Set_VmiBalance"); + var filters = input.Filters.ToLambda(); + if (input.Filters.Count > 0) { - var command = connection.CreateCommand(); - command.CommandText = $"select OBJECT_ID('{tableName}', 'U')"; - var result = command.ExecuteScalar().ToString(); - if (result != string.Empty) - { - tables.Add(tableName); - } - else - { - this._logger.LogInformation($"{tableName}不存在"); - } + query = query.Where(input.Filters.ToLambda()); } + query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); + var query2 = query.GroupBy(o => new { o.ErpToLoc, o.RealPartCode }).Select(o => new VmiBalanceSumDto { ErpToLoc = o.Key.ErpToLoc, RealPartCode = o.Key.RealPartCode, Qty = o.Sum(o => o.Qty) }); + var totalCount = query2.Count(); + var entities = await query2.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; + var content = this.GetContent(entities, "库存汇总"); + await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + return fileName; } - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var db = new SettleAccountDbContext(options); - var sql = string.Empty; - if (tables.Any()) - { - //生成 union all 的 SQL使用 FromSqlRaw 查询,如果没有分表则使用原始表 - sql = $"select * from {tables.First()} WITH(NOLOCK)"; - tables.Skip(1).ForEach(o => sql += $" union all select * from ${o} WITH(NOLOCK)"); - } - else - { - sql = "select * from Set_VmiLog WITH(NOLOCK)"; - } - var query = string.IsNullOrEmpty(sql) ? db.Set().AsQueryable() : db.Set().FromSqlRaw(sql); - var filters = input.Filters.ToLambda(); - if (input.Filters.Count > 0) + + /// + /// 快照列表 + /// + [HttpPost] + public ListResultDto Snapshot() { - query = query.Where(input.Filters.ToLambda()); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var db = new SettleAccountDbContext(options); + var list = db.Set().AsNoTracking().OrderByDescending(o => o.Start).ToList(); + return new ListResultDto(list); } - if (input.LogTypes.Count > 0) + + /// + /// 2.时点库存查询 + /// + [HttpPost] + public async Task> Backup(BackupListRequest input) { - query = query.Where(o => input.LogTypes.Contains(o.LogType)); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var db = new SettleAccountDbContext(options); + var name = input.Name; + var sql = $"select * from {name}"; + var query = db.Set().FromSqlRaw(sql); + var filters = input.Filters.ToLambda(); + if (input.Filters.Count > 0) + { + query = query.Where(input.Filters.ToLambda()); + } + var totalCount = query.Count(); + query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); + var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); + return new PagedResultDto(totalCount, entities); } - var totalCount = query.Count(); - query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); - var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); - return new PagedResultDto(totalCount, entities); - } - /// - /// 3.1库存事务导出 - /// - [HttpPost] - public async Task LogExport(RequestDto input) - { - var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting).ConfigureAwait(false); - var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - var content = this.GetContent(entities, "库存事务_"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); - return fileName; - } - - /// - /// 补货数据导出 - /// - [HttpPost] - public async Task ReplenishedExportAsync(RequestDto input) - { - var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); - //IQueryable query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda()); - var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; - var content = this.GetContent(entities, "补货数据_"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); - return fileName; - } - - /// - /// 4.寄售库存调整 - /// - /// - /// - [HttpPost] - public IActionResult Adjust([FromBody] VmiLog log) - { - var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - using var connection = new SqlConnection(connectionString); - connection.Open(); - using var transaction = connection.BeginTransaction(); - try + /// + /// 2.1时点库存导出 + /// + [HttpPost] + public async Task BackupExport(BackupListRequest input) { - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var context = new SettleAccountDbContext(options); - context.Database.UseTransaction(transaction); - Update(log); - context.Set().Add(log); - context.Set().Add(new VmiMessage { Message = JsonSerializer.Serialize(log) }); - context.SaveChanges(); - transaction.Commit(); - return new OkResult(); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var db = new SettleAccountDbContext(options); + var name = input.Name; + var sql = $"select * from {name}"; + var query = db.Set().FromSqlRaw(sql); + var filters = input.Filters.ToLambda(); + if (input.Filters.Count > 0) + { + query = query.Where(input.Filters.ToLambda()); + } + var totalCount = query.Count(); + query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); + var entities = await query.ToListAsync().ConfigureAwait(false); + var fileName = $"库存快照_{input.Name}.xlsx"; + var content = this.GetContent(entities, "库存快照"); + await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + return fileName; } - catch (Exception ex) + + /// + /// 3.库存事务查询 + /// + /// + /// + [HttpPost] + public async Task> Log(LogRequestDto input) { - this._logger.LogError(ex.ToString()); - return new JsonResult(new { code = 400, data = ex.ToString(), message = ex.Message }); ; + //按季度计算查询需要 union 的表名 + var start = DateTime.Parse(input.Filters.FirstOrDefault(o => o.Column == "changedTime" && o.Action == EnumFilterAction.BiggerThanOrEqual).Value); + var end = DateTime.Parse(input.Filters.FirstOrDefault(o => o.Column == "changedTime" && o.Action == EnumFilterAction.SmallThan).Value); + var tables = new List(); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + using var connection = new SqlConnection(connectionString); + connection.Open(); + for (var time = start; time <= end; time = time.AddMonths(1)) + { + var tableName = $"Set_VmiLog_{time.Year}_{(time.Month - 1) / 3 + 1}"; + if (!tables.Contains(tableName)) + { + var command = connection.CreateCommand(); + command.CommandText = $"select OBJECT_ID('{tableName}', 'U')"; + var result = command.ExecuteScalar().ToString(); + if (result != string.Empty) + { + tables.Add(tableName); + } + else + { + this._logger.LogInformation($"{tableName}不存在"); + } + } + } + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var db = new SettleAccountDbContext(options); + var sql = string.Empty; + if (tables.Any()) + { + //生成 union all 的 SQL使用 FromSqlRaw 查询,如果没有分表则使用原始表 + sql = $"select * from {tables.First()} WITH(NOLOCK)"; + tables.Skip(1).ForEach(o => sql += $" union all select * from ${o} WITH(NOLOCK)"); + } + else + { + sql = "select * from Set_VmiLog WITH(NOLOCK)"; + } + var query = string.IsNullOrEmpty(sql) ? db.Set().AsQueryable() : db.Set().FromSqlRaw(sql); + var filters = input.Filters.ToLambda(); + if (input.Filters.Count > 0) + { + query = query.Where(input.Filters.ToLambda()); + } + if (input.LogTypes.Count > 0) + { + query = query.Where(o => input.LogTypes.Contains(o.LogType)); + } + var totalCount = query.Count(); + query = string.IsNullOrEmpty(input.Sorting) ? query : DynamicQueryableExtensions.OrderBy(query, input.Sorting); + var entities = await query.PageBy(input.SkipCount, input.MaxResultCount).ToListAsync().ConfigureAwait(false); + return new PagedResultDto(totalCount, entities); } - } - private void Update(VmiLog log) - { - log.ChangedTime = log.Id.ToDateTime().Value.ToLocalTime(); - if (log.ChangedQty >= decimal.Zero) + /// + /// 3.1库存事务导出 + /// + [HttpPost] + public async Task LogExport(RequestDto input) { - log.Qty = log.ChangedQty; - log.LogType = VmiLogType.Type500; - log.ChangedType = VmiType.In; + var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting).ConfigureAwait(false); + var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; + var content = this.GetContent(entities, "库存事务_"); + await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + return fileName; } - else + + /// + /// 补货数据导出 + /// + [HttpPost] + public async Task ReplenishedExportAsync(RequestDto input) { - log.Qty = -log.Qty; - log.LogType = VmiLogType.Type600; - log.ChangedType = VmiType.Out; + var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); + //IQueryable query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda()); + var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; + var content = this.GetContent(entities, "补货数据_"); + await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + return fileName; } - log.ChangedBy = this._currentUser.UserName; - } - /// - /// 库存调整导入 - /// - /// - [HttpPost] - public async Task Import(List files) - { - try + /// + /// 4.寄售库存调整 + /// + /// + /// + [HttpPost] + public IActionResult Adjust([FromBody] VmiLog log) { - using var ms = new MemoryStream(); - var file = files.FirstOrDefault(); - await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); - var data = ms.ToArray(); - var tupleList = this.ImportInternal(data); - if (tupleList.Any(o => o.Item2.Count > 0)) - { - using var workbook = new XLWorkbook(new MemoryStream(data)); - var ws = workbook.Worksheets.FirstOrDefault(); - var header = ws.Row(1); - var errorIndex = ws.ColumnsUsed().Count() + 1; - header.Cell(errorIndex).Value = "提示信息"; - for (int i = 0; i < ws.RowsUsed().Count() - 1; i++) - { - ws.Row(i + 2).Cell(errorIndex).Value = string.Join(',', tupleList[i].Item2.Select(o => o.ErrorMessage)); - } - SetStyle(ws); - using var stream = new MemoryStream(); - workbook.SaveAs(stream); - stream.Seek(0, SeekOrigin.Begin); - var fileName = $"{file.Name}_错误信息.xlsx"; - await this._fileContainer.SaveAsync(fileName, stream, true).ConfigureAwait(false); - return new JsonResult(new { code = 400, message = "输入异常", fileName }); - } - var logList = tupleList.Select(o => o.Item1).ToList(); - logList.AsParallel().ForEach(Update); - var messageList = logList.Select(log => new VmiMessage { Message = JsonSerializer.Serialize(log) }).ToList(); var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; - using var context = new SettleAccountDbContext(options); - var st = new Stopwatch(); - st.Start(); + using var connection = new SqlConnection(connectionString); + connection.Open(); + using var transaction = connection.BeginTransaction(); try { - using var transaction = context.Database.BeginTransaction(); - await context.BulkInsertAsync(logList).ConfigureAwait(false); - await context.BulkInsertAsync(messageList).ConfigureAwait(false); + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var context = new SettleAccountDbContext(options); + context.Database.UseTransaction(transaction); + Update(log); + context.Set().Add(log); + context.Set().Add(new VmiMessage { Message = JsonSerializer.Serialize(log) }); + context.SaveChanges(); transaction.Commit(); + return new OkResult(); } catch (Exception ex) { - _logger.LogError(ex.ToString()); - return new JsonResult(new { code = 500, message = ex.ToString() }); + this._logger.LogError(ex.ToString()); + return new JsonResult(new { code = 400, data = ex.ToString(), message = ex.Message }); ; } - finally + } + + private void Update(VmiLog log) + { + log.ChangedTime = log.Id.ToDateTime().Value.ToLocalTime(); + if (log.ChangedQty >= decimal.Zero) + { + log.Qty = log.ChangedQty; + log.LogType = VmiLogType.Type500; + log.ChangedType = VmiType.In; + } + else { - st.Stop(); - this._logger.LogInformation($"事务结束,耗时 ${st.ElapsedMilliseconds / 1000 / 60}分钟"); + log.Qty = -log.Qty; + log.LogType = VmiLogType.Type600; + log.ChangedType = VmiType.Out; } - return new JsonResult(new { code = 200, message = "ok" }); + log.ChangedBy = this._currentUser.UserName; } - catch (Exception ex) + + /// + /// 库存调整导入 + /// + /// + [HttpPost] + public async Task Import(List files) { - this._logger.LogError(ex.ToString()); - return new JsonResult(new { code = 500, data = ex.ToString(), message = ex.Message }); ; + try + { + using var ms = new MemoryStream(); + var file = files.FirstOrDefault(); + await file.OpenReadStream().CopyToAsync(ms).ConfigureAwait(false); + var data = ms.ToArray(); + var tupleList = this.ImportInternal(data); + if (tupleList.Any(o => o.Item2.Count > 0)) + { + using var workbook = new XLWorkbook(new MemoryStream(data)); + var ws = workbook.Worksheets.FirstOrDefault(); + var header = ws.Row(1); + var errorIndex = ws.ColumnsUsed().Count() + 1; + header.Cell(errorIndex).Value = "提示信息"; + for (int i = 0; i < ws.RowsUsed().Count() - 1; i++) + { + ws.Row(i + 2).Cell(errorIndex).Value = string.Join(',', tupleList[i].Item2.Select(o => o.ErrorMessage)); + } + SetStyle(ws); + using var stream = new MemoryStream(); + workbook.SaveAs(stream); + stream.Seek(0, SeekOrigin.Begin); + var fileName = $"{file.Name}_错误信息.xlsx"; + await this._fileContainer.SaveAsync(fileName, stream, true).ConfigureAwait(false); + return new JsonResult(new { code = 400, message = "输入异常", fileName }); + } + var logList = tupleList.Select(o => o.Item1).ToList(); + logList.AsParallel().ForEach(Update); + var messageList = logList.Select(log => new VmiMessage { Message = JsonSerializer.Serialize(log) }).ToList(); + var connectionString = this._serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + var options = new DbContextOptionsBuilder().UseSqlServer(connectionString).Options; + using var context = new SettleAccountDbContext(options); + var st = new Stopwatch(); + st.Start(); + try + { + using var transaction = context.Database.BeginTransaction(); + await context.BulkInsertAsync(logList).ConfigureAwait(false); + await context.BulkInsertAsync(messageList).ConfigureAwait(false); + transaction.Commit(); + } + catch (Exception ex) + { + _logger.LogError(ex.ToString()); + return new JsonResult(new { code = 500, message = ex.ToString() }); + } + finally + { + st.Stop(); + this._logger.LogInformation($"事务结束,耗时 ${st.ElapsedMilliseconds / 1000 / 60}分钟"); + } + return new JsonResult(new { code = 200, message = "ok" }); + } + catch (Exception ex) + { + this._logger.LogError(ex.ToString()); + return new JsonResult(new { code = 500, data = ex.ToString(), message = ex.Message }); ; + } } - } - private List>> ImportInternal(byte[] data) - { - var list = new List>>(); - try + private List>> ImportInternal(byte[] data) { - using var workbook = new XLWorkbook(new MemoryStream(data)); - var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty) - .Where(o => o.GetAttributes().Any() || o.GetAttributes().Any()) - .ToDictionary(o => o.GetAttribute()?.Name ?? o.GetAttribute()?.Name, o => o); - var ws = workbook.Worksheets.FirstOrDefault(); - var rowsUsedCount = ws.RowsUsed().Count(); - var columnsUsedCount = ws.ColumnsUsed().Count(); - for (int rowIndex = 2; rowIndex <= rowsUsedCount; rowIndex++) + var list = new List>>(); + try { - var row = ws.Row(rowIndex); - var model = Activator.CreateInstance(); - for (var columnIndex = 1; columnIndex < columnsUsedCount + 1; columnIndex++) + using var workbook = new XLWorkbook(new MemoryStream(data)); + var properties = typeof(T).GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty) + .Where(o => o.GetAttributes().Any() || o.GetAttributes().Any()) + .ToDictionary(o => o.GetAttribute()?.Name ?? o.GetAttribute()?.Name, o => o); + var ws = workbook.Worksheets.FirstOrDefault(); + var rowsUsedCount = ws.RowsUsed().Count(); + var columnsUsedCount = ws.ColumnsUsed().Count(); + for (int rowIndex = 2; rowIndex <= rowsUsedCount; rowIndex++) { - var cell = row.Cell(columnIndex); - var headerName = ws.Cell(1, columnIndex).Value.ToString().Trim(); - if (properties.TryGetValue(headerName, out var property)) + var row = ws.Row(rowIndex); + var model = Activator.CreateInstance(); + for (var columnIndex = 1; columnIndex < columnsUsedCount + 1; columnIndex++) { - var propertyType = property.PropertyType; - var value = cell.Value.ToString(); - if (!string.IsNullOrEmpty(value)) - {//值非空 - if (propertyType.IsValueType()) - {//值类型 - if (propertyType.IsGenericType() && propertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) - {//可空值类型 - propertyType = propertyType.GetGenericArguments()[0];//取原始类型 - } - if (propertyType.IsEnum) - {//枚举 - var enumValue = Enum.GetNames(propertyType) - .Select(o => new KeyValuePair(o, (Enum)Enum.Parse(propertyType, o))) - .Where(o => o.Value.GetDisplayName() == value.ToString()) - .Select(o => o.Value) - .FirstOrDefault(); - property.SetValue(model, enumValue); - } - else if (propertyType == typeof(DateTime)) - { - property.SetValue(model, DateTime.Parse(value)); + var cell = row.Cell(columnIndex); + var headerName = ws.Cell(1, columnIndex).Value.ToString().Trim(); + if (properties.TryGetValue(headerName, out var property)) + { + var propertyType = property.PropertyType; + var value = cell.Value.ToString(); + if (!string.IsNullOrEmpty(value)) + {//值非空 + if (propertyType.IsValueType()) + {//值类型 + if (propertyType.IsGenericType() && propertyType.GetGenericTypeDefinition() == typeof(Nullable<>)) + {//可空值类型 + propertyType = propertyType.GetGenericArguments()[0];//取原始类型 + } + if (propertyType.IsEnum) + {//枚举 + var enumValue = Enum.GetNames(propertyType) + .Select(o => new KeyValuePair(o, (Enum)Enum.Parse(propertyType, o))) + .Where(o => o.Value.GetDisplayName() == value.ToString()) + .Select(o => o.Value) + .FirstOrDefault(); + property.SetValue(model, enumValue); + } + else if (propertyType == typeof(DateTime)) + { + property.SetValue(model, DateTime.Parse(value)); + } + else + { + property.SetValue(model, Convert.ChangeType(value, property.PropertyType)); + } } else - { + {//引用类型 property.SetValue(model, Convert.ChangeType(value, property.PropertyType)); } } - else - {//引用类型 - property.SetValue(model, Convert.ChangeType(value, property.PropertyType)); - } } } + var results = new List(); + Validator.TryValidateObject(model, new ValidationContext(model, null, null), results); + list.Add(new Tuple>(model, results)); } - var results = new List(); - Validator.TryValidateObject(model, new ValidationContext(model, null, null), results); - list.Add(new Tuple>(model, results)); + return list; + } + catch (Exception ex) + { + this._logger.LogError(ex.ToString()); + throw new UserFriendlyException(ex.ToString(), "500"); } - return list; - } - catch (Exception ex) - { - this._logger.LogError(ex.ToString()); - throw new UserFriendlyException(ex.ToString(), "500"); } - } - private byte[] GetContent(List entities, string name = "sheet1") - { - using var workbook = new XLWorkbook(); - var ws = workbook.Worksheets.Add(name); - var type = typeof(TExport); - var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty) - .Where(o => o.GetAttributes().Any()) - .ToList(); - var rowIndex = 1; - for (var i = 0; i < properties.Count; i++) - { - var property = properties[i]; - var columnIndex = i + 1; - var cell = ws.Cell(1, columnIndex); - cell.Value = property.GetAttributes().Any() ? property.GetAttribute().Name : property.Name; - } - foreach (var item in entities) + private byte[] GetContent(List entities, string name = "sheet1") { - rowIndex++; + using var workbook = new XLWorkbook(); + var ws = workbook.Worksheets.Add(name); + var type = typeof(TExport); + var properties = type.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.GetProperty) + .Where(o => o.GetAttributes().Any()) + .ToList(); + var rowIndex = 1; for (var i = 0; i < properties.Count; i++) { var property = properties[i]; var columnIndex = i + 1; - var cell = ws.Cell(rowIndex, columnIndex); - SetCell(item, cell, property); + var cell = ws.Cell(1, columnIndex); + cell.Value = property.GetAttributes().Any() ? property.GetAttribute().Name : property.Name; } + foreach (var item in entities) + { + rowIndex++; + for (var i = 0; i < properties.Count; i++) + { + var property = properties[i]; + var columnIndex = i + 1; + var cell = ws.Cell(rowIndex, columnIndex); + SetCell(item, cell, property); + } + } + SetStyle(ws); + using var stream = new MemoryStream(); + workbook.SaveAs(stream); + stream.Seek(0, SeekOrigin.Begin); + return stream.ToArray(); } - SetStyle(ws); - using var stream = new MemoryStream(); - workbook.SaveAs(stream); - stream.Seek(0, SeekOrigin.Begin); - return stream.ToArray(); - } - - private static void SetStyle(IXLWorksheet ws) - { - ws.RangeUsed().Style.Border.TopBorder = - ws.RangeUsed().Style.Border.RightBorder = - ws.RangeUsed().Style.Border.BottomBorder = - ws.RangeUsed().Style.Border.LeftBorder = XLBorderStyleValues.Thin; - ws.RangeUsed().Style.Border.TopBorderColor = - ws.RangeUsed().Style.Border.RightBorderColor = - ws.RangeUsed().Style.Border.BottomBorderColor = - ws.RangeUsed().Style.Border.LeftBorderColor = XLColor.Black; - ws.RangeUsed().SetAutoFilter(); - ws.ColumnsUsed().AdjustToContents(); - ws.RowsUsed().AdjustToContents(); - } - private static void SetCell(TExportModel? model, IXLCell cell, PropertyInfo property) - { - var propertyType = property.PropertyType; - var value = property.GetValue(model)?.ToString()?.Trim(); - if (string.IsNullOrEmpty(value)) + private static void SetStyle(IXLWorksheet ws) { - return; + ws.RangeUsed().Style.Border.TopBorder = + ws.RangeUsed().Style.Border.RightBorder = + ws.RangeUsed().Style.Border.BottomBorder = + ws.RangeUsed().Style.Border.LeftBorder = XLBorderStyleValues.Thin; + ws.RangeUsed().Style.Border.TopBorderColor = + ws.RangeUsed().Style.Border.RightBorderColor = + ws.RangeUsed().Style.Border.BottomBorderColor = + ws.RangeUsed().Style.Border.LeftBorderColor = XLColor.Black; + ws.RangeUsed().SetAutoFilter(); + ws.ColumnsUsed().AdjustToContents(); + ws.RowsUsed().AdjustToContents(); } - if (propertyType == typeof(bool)) - { - cell.Value = (bool)property.GetValue(model)! ? "是" : "否"; - } - else if (propertyType.IsEnum) - { - cell.Value = (Enum.Parse(propertyType, value) as Enum)?.GetDisplayName(); - } - else if (propertyType == typeof(DateTime)) + + private static void SetCell(TExportModel? model, IXLCell cell, PropertyInfo property) { - cell.Value = ((DateTime)property.GetValue(model)!).ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); + var propertyType = property.PropertyType; + var value = property.GetValue(model)?.ToString()?.Trim(); + if (string.IsNullOrEmpty(value)) + { + return; + } + if (propertyType == typeof(bool)) + { + cell.Value = (bool)property.GetValue(model)! ? "是" : "否"; + } + else if (propertyType.IsEnum) + { + cell.Value = (Enum.Parse(propertyType, value) as Enum)?.GetDisplayName(); + } + else if (propertyType == typeof(DateTime)) + { + cell.Value = ((DateTime)property.GetValue(model)!).ToString("yyyy-MM-dd HH:mm:ss", CultureInfo.InvariantCulture); + } + else + { + cell.Value = value; + } } - else + + internal Task Out(VmiLogType type200, string v, VmiLog vmiLog) { - cell.Value = value; + throw new NotImplementedException(); } } - internal Task Out(VmiLogType type200, string v, VmiLog vmiLog) + public class BackupListRequest : RequestDto { - throw new NotImplementedException(); + [Required] + public string Name { get; set; } } -} - -public class BackupListRequest : RequestDto -{ - [Required] - public string Name { get; set; } -} -public class LogRequestDto : RequestDto -{ - public List LogTypes { get; set; } = new List(); -} + public class LogRequestDto : RequestDto + { + public List LogTypes { get; set; } = new List(); + } -public class VmiBalanceSumDto -{ - [Display(Name = "ERP库位", Order = 13)] - public string ErpToLoc { get; set; } + public class VmiBalanceSumDto + { + [Display(Name = "ERP库位", Order = 13)] + public string ErpToLoc { get; set; } - [Display(Name = "厂内零件号", Order = 6)] - public string RealPartCode { get; set; }//原始 + [Display(Name = "厂内零件号", Order = 6)] + public string RealPartCode { get; set; }//原始 - [Display(Name = "数量", Order = 10)] - public decimal Qty { get; set; } + [Display(Name = "数量", Order = 10)] + public decimal Qty { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs index 3e792ab2..754128f6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncBalanceService.cs @@ -21,254 +21,255 @@ using Volo.Abp.DependencyInjection; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// 异步更新库存 -/// -[Route("[controller]/[action]")] -public class VmiAsyncBalanceService : Controller, IApplicationService, IJobService, ITransientDependency +namespace Win.Sfs.SettleAccount.Entities.BQ { - private readonly IServiceProvider _serviceProvider; - private readonly ILogger _logger; - private static readonly SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); - - public VmiAsyncBalanceService(IServiceProvider serviceProvider, ILogger logger) - { - this._serviceProvider = serviceProvider; - this._logger = logger; - LinqToDBForEFTools.Initialize(); - } - /// - /// 异步更新库存,手动测试 + /// 异步更新库存 /// - /// - [HttpPost] - public async Task Test() + [Route("[controller]/[action]")] + public class VmiAsyncBalanceService : Controller, IApplicationService, IJobService, ITransientDependency { - var now = DateTime.Now; - await Invoke(_serviceProvider).ConfigureAwait(false); - return (DateTime.Now - now).TotalMinutes; - } + private readonly IServiceProvider _serviceProvider; + private readonly ILogger _logger; + private static readonly SemaphoreSlim semaphoreSlim = new SemaphoreSlim(1, 1); - [NonAction] - public async Task Invoke(IServiceProvider serviceProvider) - { - await semaphoreSlim.WaitAsync().ConfigureAwait(false); - try + public VmiAsyncBalanceService(IServiceProvider serviceProvider, ILogger logger) { - await InvokeInternal(serviceProvider).ConfigureAwait(false); + this._serviceProvider = serviceProvider; + this._logger = logger; + LinqToDBForEFTools.Initialize(); } - finally + + /// + /// 异步更新库存,手动测试 + /// + /// + [HttpPost] + public async Task Test() { - semaphoreSlim.Release(); + var now = DateTime.Now; + await Invoke(_serviceProvider).ConfigureAwait(false); + return (DateTime.Now - now).TotalMinutes; } - } - private async Task InvokeInternal(IServiceProvider serviceProvider) - { - var batchSize = 10000; - var fetchSize = 0; - var connectionString = serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); - for (var i = 0; i < 1000; i++) + [NonAction] + public async Task Invoke(IServiceProvider serviceProvider) { - var balanceList = new List>(); - var vmiReplenishedList = new List(); - var sw = new Stopwatch(); - sw.Start(); - using var connection = new Microsoft.Data.SqlClient.SqlConnection(connectionString); - connection.Open(); - using var transaction = connection.BeginTransaction(); + await semaphoreSlim.WaitAsync().ConfigureAwait(false); try { - var command = connection.CreateCommand(); - command.Transaction = transaction; - var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; - using var context = new SettleAccountDbContext(options); - context.Database.UseTransaction(transaction); - var vmiMessageRepo = context.Set(); - var vmiLogRepo = context.Set(); - var vmiBalanceRepo = context.Set(); - var vmiReplenishedRepo = context.Set(); - //读取可消费消息列表 - var messages = vmiMessageRepo.AsNoTracking().Where(o => !o.isConsumed).OrderBy(o => o.Number).Take(batchSize).ToList(); - //没有可消费消息则返回 - if (!messages.Any()) - { - transaction.Commit(); - break; - } - //设置数量为实际返回数量 - fetchSize = messages.Count; - //反序列化获取库存事务 - var list = messages.Select(o => - { - var log = JsonSerializer.Deserialize(o.Message); - var jsonElement = JsonSerializer.Deserialize(o.Message); - var property = jsonElement.GetProperty("Id"); - Console.WriteLine(jsonElement); - var id = Guid.Parse(property.GetString()); - log.SetId(id); - return new LogToBalance { VmiMessage = o, Log = log, Table = $"Set_VmiLog_{log.ChangedTime.Year}_{(log.ChangedTime.Month - 1) / 3 + 1}" }; - }); - //获取分表名称 - var tables = list.Select(o => o.Table).Distinct().ToList(); - //创建分表 - foreach (var table in tables) + await InvokeInternal(serviceProvider).ConfigureAwait(false); + } + finally + { + semaphoreSlim.Release(); + } + } + + private async Task InvokeInternal(IServiceProvider serviceProvider) + { + var batchSize = 10000; + var fetchSize = 0; + var connectionString = serviceProvider.GetRequiredService().GetConnectionString("SettleAccountService"); + for (var i = 0; i < 1000; i++) + { + var balanceList = new List>(); + var vmiReplenishedList = new List(); + var sw = new Stopwatch(); + sw.Start(); + using var connection = new Microsoft.Data.SqlClient.SqlConnection(connectionString); + connection.Open(); + using var transaction = connection.BeginTransaction(); + try { - command.CommandText = $"select OBJECT_ID('{table}', 'U')"; - var result = command.ExecuteScalar().ToString(); - if (result == string.Empty) + var command = connection.CreateCommand(); + command.Transaction = transaction; + var options = new DbContextOptionsBuilder().UseSqlServer(connection).Options; + using var context = new SettleAccountDbContext(options); + context.Database.UseTransaction(transaction); + var vmiMessageRepo = context.Set(); + var vmiLogRepo = context.Set(); + var vmiBalanceRepo = context.Set(); + var vmiReplenishedRepo = context.Set(); + //读取可消费消息列表 + var messages = vmiMessageRepo.AsNoTracking().Where(o => !o.isConsumed).OrderBy(o => o.Number).Take(batchSize).ToList(); + //没有可消费消息则返回 + if (!messages.Any()) { - command.CommandText = $"select * into {table} from Set_VmiLog where 1=0;"; - command.ExecuteNonQuery(); - command.CommandText = $"alter table {table} add constraint PK_{table} primary key (Id);"; - command.ExecuteNonQuery(); + transaction.Commit(); + break; } - } - foreach (var item in list) - { - var message = item.VmiMessage; - message.isConsumed = true; - var log = item.Log; - //本地查找 - var balance = balanceList.Select(o => o.Item1).FirstOrDefault( - o => o.DeliverBillType == log.DeliverBillType && - o.CodeType == log.CodeType && - o.DeliverBillType == log.DeliverBillType && - o.VinCode == log.VinCode && - o.ErpToLoc == log.ErpToLoc && - o.OrderNum == log.OrderNum && - o.factory == log.factory && - o.Configcode == log.Configcode); - - //数据库查找 - if (balance == null) + //设置数量为实际返回数量 + fetchSize = messages.Count; + //反序列化获取库存事务 + var list = messages.Select(o => + { + var log = JsonSerializer.Deserialize(o.Message); + var jsonElement = JsonSerializer.Deserialize(o.Message); + var property = jsonElement.GetProperty("Id"); + Console.WriteLine(jsonElement); + var id = Guid.Parse(property.GetString()); + log.SetId(id); + return new LogToBalance { VmiMessage = o, Log = log, Table = $"Set_VmiLog_{log.ChangedTime.Year}_{(log.ChangedTime.Month - 1) / 3 + 1}" }; + }); + //获取分表名称 + var tables = list.Select(o => o.Table).Distinct().ToList(); + //创建分表 + foreach (var table in tables) { - balance = vmiBalanceRepo.FirstOrDefault( - o => o.DeliverBillType == log.DeliverBillType && - o.CodeType == log.CodeType && - o.DeliverBillType == log.DeliverBillType && - o.VinCode == log.VinCode && - o.ErpToLoc == log.ErpToLoc && - o.OrderNum == log.OrderNum && - o.factory == log.factory && - o.Configcode == log.Configcode); + command.CommandText = $"select OBJECT_ID('{table}', 'U')"; + var result = command.ExecuteScalar().ToString(); + if (result == string.Empty) + { + command.CommandText = $"select * into {table} from Set_VmiLog where 1=0;"; + command.ExecuteNonQuery(); + command.CommandText = $"alter table {table} add constraint PK_{table} primary key (Id);"; + command.ExecuteNonQuery(); + } } - if (balance == null) - {//不存在库存记录 - //新建库存记录 - balance = new VmiBalance(); - balanceList.Add(new Tuple(balance, 1)); - if (log.LogType == VmiLogType.Type300) - {//反结算入库,重建库存 - var logHistory = vmiLogRepo.AsNoTracking().FirstOrDefault( - o => o.LogType == VmiLogType.Type100 && - o.DeliverBillType == log.DeliverBillType && - o.CodeType == log.CodeType && - o.DeliverBillType == log.DeliverBillType && - o.VinCode == log.VinCode && - o.ErpToLoc == log.ErpToLoc && - o.OrderNum == log.OrderNum && - o.factory == log.factory && - o.Configcode == log.Configcode); - if (logHistory != null) - { - balance.InjectFrom(logHistory); + foreach (var item in list) + { + var message = item.VmiMessage; + message.isConsumed = true; + var log = item.Log; + //本地查找 + var balance = balanceList.Select(o => o.Item1).FirstOrDefault( + o => o.DeliverBillType == log.DeliverBillType && + o.CodeType == log.CodeType && + o.DeliverBillType == log.DeliverBillType && + o.VinCode == log.VinCode && + o.ErpToLoc == log.ErpToLoc && + o.OrderNum == log.OrderNum && + o.factory == log.factory && + o.Configcode == log.Configcode); + + //数据库查找 + if (balance == null) + { + balance = vmiBalanceRepo.FirstOrDefault( + o => o.DeliverBillType == log.DeliverBillType && + o.CodeType == log.CodeType && + o.DeliverBillType == log.DeliverBillType && + o.VinCode == log.VinCode && + o.ErpToLoc == log.ErpToLoc && + o.OrderNum == log.OrderNum && + o.factory == log.factory && + o.Configcode == log.Configcode); + } + if (balance == null) + {//不存在库存记录 + //新建库存记录 + balance = new VmiBalance(); + balanceList.Add(new Tuple(balance, 1)); + if (log.LogType == VmiLogType.Type300) + {//反结算入库,重建库存 + var logHistory = vmiLogRepo.AsNoTracking().FirstOrDefault( + o => o.LogType == VmiLogType.Type100 && + o.DeliverBillType == log.DeliverBillType && + o.CodeType == log.CodeType && + o.DeliverBillType == log.DeliverBillType && + o.VinCode == log.VinCode && + o.ErpToLoc == log.ErpToLoc && + o.OrderNum == log.OrderNum && + o.factory == log.factory && + o.Configcode == log.Configcode); + if (logHistory != null) + { + balance.InjectFrom(logHistory); + } + else + { + balance.InjectFrom(log); + } } else { balance.InjectFrom(log); } + balance.Qty = log.ChangedQty; } else - { - balance.InjectFrom(log); - } - balance.Qty = log.ChangedQty; - } - else - {//存在库存记录 - if (!balanceList.Any(o => o.Item1.Id == balance.Id)) - { - balanceList.Add(new Tuple(balance, 2)); - } - var logType = log.LogType; - var currentQty = balance.Qty;// + log.ty - if (logType == VmiLogType.Type100) - { - //发运入库,负库存字段需要更新 - if (balance.Qty < decimal.Zero) + {//存在库存记录 + if (!balanceList.Any(o => o.Item1.Id == balance.Id)) { + balanceList.Add(new Tuple(balance, 2)); + } + var logType = log.LogType; + var currentQty = balance.Qty;// + log.ty + if (logType == VmiLogType.Type100) + { + //发运入库,负库存字段需要更新 + if (balance.Qty < decimal.Zero) + { + balance.InjectFrom(log); + } + } + else if (logType == VmiLogType.Type300) + { + //反结入库,只更新库存 + } + else if (logType == VmiLogType.Type500) + { + //调整入库,更新库存和其他字段 balance.InjectFrom(log); } - } - else if (logType == VmiLogType.Type300) - { - //反结入库,只更新库存 - } - else if (logType == VmiLogType.Type500) - { - //调整入库,更新库存和其他字段 - balance.InjectFrom(log); - } - if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero) - { - //添加负库存补货记录 - var log2 = new VmiReplenished(); - log2.InjectFrom(log); - vmiReplenishedList.Add(log2); - } - // 更新库存 - balance.Qty = currentQty + log.ChangedQty; - if (balance.Qty == decimal.Zero) - { - //删除0库存 - vmiBalanceRepo.Remove(balance); + if (logType == VmiLogType.Type100 && balance.Qty < decimal.Zero) + { + //添加负库存补货记录 + var log2 = new VmiReplenished(); + log2.InjectFrom(log); + vmiReplenishedList.Add(log2); + } + // 更新库存 + balance.Qty = currentQty + log.ChangedQty; + if (balance.Qty == decimal.Zero) + { + //删除0库存 + vmiBalanceRepo.Remove(balance); + } } } - } - //更新事务分表 - foreach (var item in tables) + //更新事务分表 + foreach (var item in tables) + { + var logs = list.Where(o => o.Table == item).Select(o => o.Log).ToList(); + //await context.BulkInsertAsync(logs, new BulkConfig { CustomDestinationTableName = item, }).ConfigureAwait(false); + await context.BulkCopyAsync(new LinqToDB.Data.BulkCopyOptions { TableName = item }, logs).ConfigureAwait(false); + } + //批量更新消息 + await context.BulkUpdateAsync(messages, new BulkConfig + { + PropertiesToExclude = new List { nameof(VmiMessage.Number) } + }).ConfigureAwait(false); + //批量插入负库存补货记录 + await context.BulkInsertAsync(vmiReplenishedList).ConfigureAwait(false); + //批量插入库存余额 + await context.BulkInsertAsync(balanceList.Where(o => o.Item2 == 1 && o.Item1.Qty != decimal.Zero).Select(o => o.Item1).ToList()).ConfigureAwait(false); + //批量更新库存余额 + await context.BulkUpdateAsync(balanceList.Where(o => o.Item2 == 2 && o.Item1.Qty != decimal.Zero).Select(o => o.Item1).ToList()).ConfigureAwait(false); + //批量删除库存余额 + await context.BulkDeleteAsync(balanceList.Where(o => o.Item2 == 2 && o.Item1.Qty == decimal.Zero).Select(o => o.Item1).ToList()).ConfigureAwait(false); + transaction.Commit(); + } + catch (Exception ex) { - var logs = list.Where(o => o.Table == item).Select(o => o.Log).ToList(); - //await context.BulkInsertAsync(logs, new BulkConfig { CustomDestinationTableName = item, }).ConfigureAwait(false); - await context.BulkCopyAsync(new LinqToDB.Data.BulkCopyOptions { TableName = item }, logs).ConfigureAwait(false); + this._logger.LogError(ex.ToString()); + throw new UserFriendlyException(ex.ToString(), "500"); } - //批量更新消息 - await context.BulkUpdateAsync(messages, new BulkConfig + finally { - PropertiesToExclude = new List { nameof(VmiMessage.Number) } - }).ConfigureAwait(false); - //批量插入负库存补货记录 - await context.BulkInsertAsync(vmiReplenishedList).ConfigureAwait(false); - //批量插入库存余额 - await context.BulkInsertAsync(balanceList.Where(o => o.Item2 == 1 && o.Item1.Qty != decimal.Zero).Select(o => o.Item1).ToList()).ConfigureAwait(false); - //批量更新库存余额 - await context.BulkUpdateAsync(balanceList.Where(o => o.Item2 == 2 && o.Item1.Qty != decimal.Zero).Select(o => o.Item1).ToList()).ConfigureAwait(false); - //批量删除库存余额 - await context.BulkDeleteAsync(balanceList.Where(o => o.Item2 == 2 && o.Item1.Qty == decimal.Zero).Select(o => o.Item1).ToList()).ConfigureAwait(false); - transaction.Commit(); - } - catch (Exception ex) - { - this._logger.LogError(ex.ToString()); - throw new UserFriendlyException(ex.ToString(), "500"); - } - finally - { - sw.Stop(); - this._logger.LogInformation($"处理{fetchSize}条,耗时 {sw.ElapsedMilliseconds / 1000 / 60}分钟,{sw.ElapsedMilliseconds / 1000}秒"); + sw.Stop(); + this._logger.LogInformation($"处理{fetchSize}条,耗时 {sw.ElapsedMilliseconds / 1000 / 60}分钟,{sw.ElapsedMilliseconds / 1000}秒"); + } } } } -} -public class LogToBalance -{ - public VmiMessage VmiMessage { get; set; } - public VmiLog Log { get; set; } - public string Table { get; set; } + public class LogToBalance + { + public VmiMessage VmiMessage { get; set; } + public VmiLog Log { get; set; } + public string Table { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs index 789c2501..127dfb40 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAsyncMessageService.cs @@ -11,41 +11,42 @@ using Volo.Abp.Application.Services; using Volo.Abp.DependencyInjection; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; -namespace Win.Sfs.SettleAccount.Entities.BQ; - -/// -/// 消息表定时清理 -/// -public class VmiAsyncMessageService : Controller, IApplicationService, IJobService, ITransientDependency +namespace Win.Sfs.SettleAccount.Entities.BQ { - private readonly IServiceProvider _serviceProvider; - - public VmiAsyncMessageService(IServiceProvider serviceProvider) - { - this._serviceProvider = serviceProvider; - } - - [NonAction] - public Task Invoke(IServiceProvider serviceProvider) - { - using var scope = serviceProvider.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - db.Set().Where(o => o.isConsumed).BatchDelete(); - var count = db.Set().Where(o => !o.isConsumed).Count(); - scope.ServiceProvider.GetService>().Clients.All.ServerToClient("VmiBalance", count.ToString(), ""); - return Task.CompletedTask; - } - /// - /// 未处理消息数量 + /// 消息表定时清理 /// - /// - [HttpPost] - public int GetMessageCount() + public class VmiAsyncMessageService : Controller, IApplicationService, IJobService, ITransientDependency { - using var scope = this._serviceProvider.CreateScope(); - var db = scope.ServiceProvider.GetRequiredService(); - var count = db.Set().Where(o => !o.isConsumed).Count(); - return count; + private readonly IServiceProvider _serviceProvider; + + public VmiAsyncMessageService(IServiceProvider serviceProvider) + { + this._serviceProvider = serviceProvider; + } + + [NonAction] + public Task Invoke(IServiceProvider serviceProvider) + { + using var scope = serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + db.Set().Where(o => o.isConsumed).BatchDelete(); + var count = db.Set().Where(o => !o.isConsumed).Count(); + scope.ServiceProvider.GetService>().Clients.All.ServerToClient("VmiBalance", count.ToString(), ""); + return Task.CompletedTask; + } + + /// + /// 未处理消息数量 + /// + /// + [HttpPost] + public int GetMessageCount() + { + using var scope = this._serviceProvider.CreateScope(); + var db = scope.ServiceProvider.GetRequiredService(); + var count = db.Set().Where(o => !o.isConsumed).Count(); + return count; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs index 29eb69cf..e2ea6a59 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Boms/BomAppService.cs @@ -1,19 +1,15 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Shouldly; -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Shouldly; using Volo.Abp.Application.Dtos; using Volo.Abp.Caching; -using Volo.Abp.Guids; -using Volo.Abp.ObjectMapping; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.Boms; -using Win.Sfs.SettleAccount.Entities.ImportMap; -using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.RepositoryBase; @@ -54,13 +50,13 @@ namespace Win.Sfs.SettleAccount.Boms { string _fileName = string.Format("BOM_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtoDetails); + var result = await _exportImporter.ExcelExporter(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -71,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Boms Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } #endregion @@ -83,8 +79,8 @@ namespace Win.Sfs.SettleAccount.Boms [HttpPost] public async Task> GetListAsync(BomRequestDto input) { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -146,9 +142,6 @@ namespace Win.Sfs.SettleAccount.Boms // return ApplicationConsts.SuccessStr; // } - - - // /// // /// 导入功能 // /// @@ -271,20 +264,17 @@ namespace Win.Sfs.SettleAccount.Boms // return dto; // } - // private async Task GetFromCacheAsync(Guid id) // { // var result = await _repository.GetAsync(id); // return result; // } - // private async Task GetCountAsync(BomRequestDto input) // { // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); // } - // private async Task GetCountAsync(BomVersionRequestDto input) // { // return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); @@ -302,8 +292,6 @@ namespace Win.Sfs.SettleAccount.Boms // return await _repository.GetCountAsync(branchId); // } - - // /// // /// 删除实体 // /// @@ -338,7 +326,6 @@ namespace Win.Sfs.SettleAccount.Boms // return await _repository.DeleteListAsync(ids); // } - // ///// // /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs index 7dc40219..8bf7b75a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/CodeSettingTables/CodeSettingAppService.cs @@ -1,35 +1,25 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading.Tasks; using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Distributed; -using SettleAccount.Domain.BQ; 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.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.CodeSettings; -using Win.Sfs.SettleAccount.Entities.Controls; -using Win.Sfs.SettleAccount.Entities.ImportMap; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.CacheBase; using Win.Sfs.Shared.RepositoryBase; -using Win.Utils; namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables { @@ -55,7 +45,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _repository = repository; } @@ -68,7 +58,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables public async Task CodeSettingUploadExcelImport([FromForm] IFormFileCollection files) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var _ls = ObjectMapper.Map, List>(result); foreach (var itm in _ls) { @@ -76,14 +66,14 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables if (_first != null) { _first.Update(_first.Project, _first.Value, itm.Description); - await _repository.UpdateAsync(_first); + await _repository.UpdateAsync(_first).ConfigureAwait(false); } else { itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); - await _repository.InsertAsync(itm); + await _repository.InsertAsync(itm).ConfigureAwait(false); } - + } var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; //_repository.GetDbContext().BulkInsert(_ls, bulkConfig); @@ -95,17 +85,16 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables /// [HttpPost] [Route("{id}")] - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } @@ -115,7 +104,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables [HttpPost] public async Task> GetAllAsync() { - var entities = await _repository.GetAllAsync(true); + var entities = await _repository.GetAllAsync(true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new ListResultDto(dtos); } @@ -126,8 +115,8 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables [HttpPost] public async Task> GetListAsync(RequestDto input) { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -139,16 +128,15 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables /// 实体DTO [HttpPost] - virtual public async Task CreateAsync(CodeSettingCreateDto input) + public virtual async Task CreateAsync(CodeSettingCreateDto input) { - var _first = _repository.Where(p => p.Project == input.Project && p.Value==input.Value).FirstOrDefault(); + var _first = _repository.Where(p => p.Project == input.Project && p.Value == input.Value).FirstOrDefault(); if (_first != null) { throw new BusinessException("001", "已经存数据请修改后创建"); } - var entity = new CodeSetting( GuidGenerator.Create(), input.BranchId, @@ -156,10 +144,9 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables input.Value, input.Description - ); - await _repository.InsertAsync(entity); + await _repository.InsertAsync(entity).ConfigureAwait(false); //create cache //await Cache.SetAsync(entity.Id.ToString(), entity,CacheStrategyConst.FIVE_MINUTES); @@ -169,21 +156,19 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables } - - [HttpPost] - virtual public async Task ExportAsync(CodeSettingRequestDto input) + public virtual async Task ExportAsync(CodeSettingRequestDto input) { - string _fileName = string.Format("通用代码设置_{0}.xlsx",DateTime.Now.ToString("yyyyMMdd")); + string _fileName = string.Format("通用代码设置_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtoDetails); + var result = await _exportImporter.ExcelExporter(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -194,11 +179,10 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } - /// /// 修改实体 /// @@ -207,7 +191,7 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables /// 实体DTO [HttpPost] [Route("{id}")] - virtual public async Task UpdateAsync(Guid id, CodeSettingUpdateDto input) + public virtual async Task UpdateAsync(Guid id, CodeSettingUpdateDto input) { var _first = _repository.Where(p => p.Project == input.Project && p.Value == input.Value).FirstOrDefault(); @@ -215,9 +199,9 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables { throw new BusinessException("001", "已经存数据请修改!"); } - var entity = await _repository.GetAsync(id); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); entity.Update(input.Project, input.Value, input.Description); - await _repository.UpdateAsync(entity); + await _repository.UpdateAsync(entity).ConfigureAwait(false); //update cache //await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); var dto = ObjectMapper.Map(entity); @@ -231,11 +215,11 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables /// [HttpPost] [Route("{id}")] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -244,18 +228,17 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettingTables /// IDs /// 是否执行成功 [HttpPost] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { var _query = _repository.Where(p => ids.Contains(p.Id)); - int i= await _query.BatchDeleteAsync(); + int i = await _query.BatchDeleteAsync().ConfigureAwait(false); if (i == 0) { - return false; + return false; } return true; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs index 6e877370..5fa9fbe5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Controls/CentralizedControlAppService.cs @@ -15,419 +15,403 @@ using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.Controls; - -/// -/// 期间设置 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class CentralizedControlAppService : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.Controls { /// - /// 期间设置仓储 + /// 期间设置 /// - private readonly INormalEfCoreRepository _repository; - - /// - /// 构造 - /// - public CentralizedControlAppService( - INormalEfCoreRepository repository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) - { - _repository = repository; - } - - #region 导出 - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(CentralizedControlRequestDto input) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class CentralizedControlAppService : SettleAccountApplicationBase { - string fileName = $"期间设置_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtos = ObjectMapper.Map, List>(entities); - - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); - result.ShouldNotBeNull(); - - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); - return fileName; - } - #endregion + /// + /// 期间设置仓储 + /// + private readonly INormalEfCoreRepository _repository; + + /// + /// 构造 + /// + public CentralizedControlAppService( + INormalEfCoreRepository repository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _repository = repository; + } - #region CURD - /// - /// 获取全部 - /// - [HttpPost] - public async Task> GetAllAsync() - { - var entities = await _repository.GetAllAsync(true); - var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); - } + #region 导出 + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(CentralizedControlRequestDto input) + { + string fileName = $"期间设置_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(CentralizedControlRequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - /// - /// 添加 - /// - [HttpPost] - public async Task CreateAsync(CentralizedControlCreateDto input) - { - var _first = _repository.Where(p => p.Version == input.Version).FirstOrDefault(); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion + + #region CURD + /// + /// 获取全部 + /// + [HttpPost] + public async Task> GetAllAsync() + { + var entities = await _repository.GetAllAsync(true).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new ListResultDto(dtos); + } - if (_first != null) + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(CentralizedControlRequestDto input) { - throw new BusinessException("001", "已经存在该期间,不能重复添加!"); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); } - var entity = new CentralizedControl( - GuidGenerator.Create(), - input.BranchId, - input.Year, - input.Period, - input.Year + input.Period, - input.State - ); + /// + /// 添加 + /// + [HttpPost] + public async Task CreateAsync(CentralizedControlCreateDto input) + { + var _first = _repository.Where(p => p.Version == input.Version).FirstOrDefault(); - await _repository.InsertAsync(entity); + if (_first != null) + { + throw new BusinessException("001", "已经存在该期间,不能重复添加!"); + } - var dto = ObjectMapper.Map(entity); - return dto; + var entity = new CentralizedControl( + GuidGenerator.Create(), + input.BranchId, + input.Year, + input.Period, + input.Year + input.Period, + input.State + ); - } + await _repository.InsertAsync(entity).ConfigureAwait(false); - /// - /// 删除实体 - /// - /// ID - /// - [HttpDelete] - public async Task DeleteAsync(Guid id) - { - var entity = await _repository.GetAsync(id); - await _repository.DeleteAsync(id); - } + var dto = ObjectMapper.Map(entity); + return dto; - /// - /// 按IDs删除实体列表 - /// - [HttpPost] - public async Task DeleteListAsync(List ids) - { - var _query = _repository.Where(p => ids.Contains(p.Id)); - int i = await _query.BatchDeleteAsync(); + } - return i == 0; - } - #endregion + /// + /// 删除实体 + /// + /// ID + /// + [HttpDelete] + public async Task DeleteAsync(Guid id) + { + var entity = await _repository.GetAsync(id).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); + } - #region 开启、关闭 - /// - /// 开启版本 - /// - [HttpPost] - public async Task OpenVersion(List ids) - { - var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id)); - foreach (var entity in entitys) + /// + /// 按IDs删除实体列表 + /// + [HttpPost] + public async Task DeleteListAsync(List ids) { - entity.OpenVersion(); + var _query = _repository.Where(p => ids.Contains(p.Id)); + int i = await _query.BatchDeleteAsync().ConfigureAwait(false); + + return i == 0; + } + #endregion + + #region 开启、关闭 + /// + /// 开启版本 + /// + [HttpPost] + public async Task OpenVersion(List ids) + { + var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id)).ConfigureAwait(false); + foreach (var entity in entitys) + { + entity.OpenVersion(); + } + return true; } - return true; - } - /// - /// 关闭版本 - /// - [HttpPost] - public async Task ClosedVersion(List ids) - { - var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id)); - foreach (var entity in entitys) + /// + /// 关闭版本 + /// + [HttpPost] + public async Task ClosedVersion(List ids) { - entity.ClosedVersion(); + var entitys = await _repository.GetListAsync(p => ids.Contains(p.Id)).ConfigureAwait(false); + foreach (var entity in entitys) + { + entity.ClosedVersion(); + } + return true; } - return true; - } - #endregion - - #region 原方法(废弃) - // /// - // /// 导入功能 - // /// - // /// 上传的文件(前端已经限制只能上传一个附件) - // /// - // [HttpPost] - // [Route("ExcelImport")] - // [DisableRequestSizeLimit] - // [Authorize(SettleAccountPermissions.CentralizedControls.Create)] - // public async Task CentralizedControlUploadExcelImport([FromForm] IFormFileCollection files,Guid branchId) - // { - // ExportImporter _exportImporter = new ExportImporter(); - // var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - // var _ls = ObjectMapper.Map, List>(result); - // foreach (var itm in _ls) - // { - // itm.SetValue(GuidGenerator.Create(), branchId); - // } - // var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; - // _repository.GetDbContext().BulkInsert(_ls, bulkConfig); - // return ApplicationConsts.SuccessStr; - // } - - - - // /// - // /// 按ID获取唯一实体 - // /// - // /// - // /// 返回实体全部属性 - // /// - // /// ID - // /// 实体DTO - // [HttpGet] - // [Route("{id}")] - // virtual public async Task GetAsync(Guid id) - // { - // var result = await GetFromCacheAsync(id); - // var dto = ObjectMapper.Map(result); - // return dto; - // } - - - // private async Task GetFromCacheAsync(Guid id) - // { - // var result = - // await _repository.GetAsync(id); - - - // return result; - // } - - - // private async Task GetCountAsync(CentralizedControlRequestDto input) - // { - // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); - // } - - - - - // ///// - - // /// - // /// 根据筛选条件获取实体列表 - // /// - // /// - // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - // /// - // /// 请求条件 - // /// 实体DTO列表 - // [HttpPost] - // [Route("list")] - // virtual public async Task> GetListAsync(CentralizedControlRequestDto input) - // { - // 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>(entities); - - // return new PagedResultDto(totalCount, dtos); - // } - - - // /// - // /// 获取实体总数 - // /// - // /// 实体总数 - // [HttpGet] - // [Route("count")] - // virtual public async Task GetTotalCountAsync(Guid branchId) - // { - // return await _repository.GetCountAsync(branchId); - // } - - // /// - // /// 获取全部实体列表 - // /// - // /// 实体DTO列表 - // [HttpGet] - // [Route("all")] - // virtual public async Task> GetAllAsync(Guid branchId) - // { - // var entities = await _repository.GetAllAsync(branchId, true); - - - // var dtos = ObjectMapper.Map, List>(entities); - - - // return new ListResultDto(dtos); - // } - - - - - // /// - // /// 新增实体 - // /// - // /// 新增实体DTO - // /// 实体DTO - - // [HttpPost] - // [Route("")] - //[Authorize(SettleAccountPermissions.CentralizedControls.Create)] - // virtual public async Task CreateAsync(CentralizedControlCreateDto input) - // { - // var _first= _repository.Where(p => p.Version == input.Version).FirstOrDefault(); - - // if (_first != null) - // { - // throw new BusinessException("001", "已经存在该期间,不能重复添加!"); - // } - - // var entity = new CentralizedControl( - // GuidGenerator.Create(), - // input.BranchId, - // input.Year, - // input.Period, - // input.Year+input.Period, - // input.State - - - // ); - - // await _repository.InsertAsync(entity); - - // //create cache - // //await Cache.SetAsync(entity.Id.ToString(), entity,CacheStrategyConst.FIVE_MINUTES); - - // var dto = ObjectMapper.Map(entity); - // return dto; - - // } - - // /// - // /// 修改实体 - // /// - // /// ID - // /// 修改实体DTO - // /// 实体DTO - // [HttpPut] - // [Route("{id}")] - //[Authorize(SettleAccountPermissions.CentralizedControls.Update)] - // virtual public async Task UpdateAsync(Guid id, CentralizedControlUpdateDto input) - // { - // var entity = await _repository.GetAsync(id); - // entity.Update(input.Remark); - // await _repository.UpdateAsync(entity); - // //update cache - // //await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); - // var dto = ObjectMapper.Map(entity); - // return dto; - - - - // } - - // /// - // /// 删除实体 - // /// - // /// ID - // /// - // [HttpDelete] - // [Route("{id}")] - //[Authorize(SettleAccountPermissions.CentralizedControls.Delete)] - // virtual public async Task DeleteAsync(Guid id) - // { - // var entity = await GetFromCacheAsync(id); - // await Cache.DeleteAsync(id.ToString()); - // await _repository.DeleteAsync(id); - // } - - // /// - // /// 按IDs删除实体列表 - // /// - // /// IDs - // /// 是否执行成功 - // [HttpPost] - // [Route("delete")] - //[Authorize(SettleAccountPermissions.CentralizedControls.Delete)] - // virtual public async Task DeleteListAsync(List ids) - // { - // var _query = _repository.Where(p => ids.Contains(p.Id)); - // int i = await _query.BatchDeleteAsync(); - - // if (i == 0) - // { - // return false; - // } - // return true; - // } - // [HttpPost] - // [Route("open")] - // [Authorize(SettleAccountPermissions.CentralizedControls.Create)] - // public async Task OpenVersion(List ids) - // { - // foreach (var id in ids) - // { - // var _entity = await _repository.GetAsync(id); - // _entity.OpenVersion(); - - // } - // return true; - // } - // [HttpPost] - // [Route("close")] - // [Authorize(SettleAccountPermissions.CentralizedControls.Create)] - // /// - // /// 关闭版本 - // /// - // /// 选择要关闭的ID - // /// - // public async Task ClosedVersion(List ids) - // { - // foreach (var id in ids) - // { - // var _entity = await _repository.GetAsync(id); - // _entity.ClosedVersion(); - // } - // return true; - // } - // [HttpPost] - // [Route("openlist")] - // /// - // /// 获得开放的版本列表 - // /// - // /// - // public async Task> GetOpenVersionList() - // { - // var _list = await _repository.Where(p => p.State == 0).ToListAsync(); - - // var dtos = ObjectMapper.Map, List>(_list); - - // return dtos; - // } - #endregion + #endregion + + #region 原方法(废弃) + // /// + // /// 导入功能 + // /// + // /// 上传的文件(前端已经限制只能上传一个附件) + // /// + // [HttpPost] + // [Route("ExcelImport")] + // [DisableRequestSizeLimit] + // [Authorize(SettleAccountPermissions.CentralizedControls.Create)] + // public async Task CentralizedControlUploadExcelImport([FromForm] IFormFileCollection files,Guid branchId) + // { + // ExportImporter _exportImporter = new ExportImporter(); + // var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + // var _ls = ObjectMapper.Map, List>(result); + // foreach (var itm in _ls) + // { + // itm.SetValue(GuidGenerator.Create(), branchId); + // } + // var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; + // _repository.GetDbContext().BulkInsert(_ls, bulkConfig); + // return ApplicationConsts.SuccessStr; + // } + + // /// + // /// 按ID获取唯一实体 + // /// + // /// + // /// 返回实体全部属性 + // /// + // /// ID + // /// 实体DTO + // [HttpGet] + // [Route("{id}")] + // virtual public async Task GetAsync(Guid id) + // { + // var result = await GetFromCacheAsync(id); + // var dto = ObjectMapper.Map(result); + // return dto; + // } + + // private async Task GetFromCacheAsync(Guid id) + // { + // var result = + // await _repository.GetAsync(id); + + // return result; + // } + + // private async Task GetCountAsync(CentralizedControlRequestDto input) + // { + // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + // } + + // ///// + + // /// + // /// 根据筛选条件获取实体列表 + // /// + // /// + // /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + // /// + // /// 请求条件 + // /// 实体DTO列表 + // [HttpPost] + // [Route("list")] + // virtual public async Task> GetListAsync(CentralizedControlRequestDto input) + // { + // 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>(entities); + + // return new PagedResultDto(totalCount, dtos); + // } + + // /// + // /// 获取实体总数 + // /// + // /// 实体总数 + // [HttpGet] + // [Route("count")] + // virtual public async Task GetTotalCountAsync(Guid branchId) + // { + // return await _repository.GetCountAsync(branchId); + // } + + // /// + // /// 获取全部实体列表 + // /// + // /// 实体DTO列表 + // [HttpGet] + // [Route("all")] + // virtual public async Task> GetAllAsync(Guid branchId) + // { + // var entities = await _repository.GetAllAsync(branchId, true); + + // var dtos = ObjectMapper.Map, List>(entities); + + // return new ListResultDto(dtos); + // } + + // /// + // /// 新增实体 + // /// + // /// 新增实体DTO + // /// 实体DTO + + // [HttpPost] + // [Route("")] + //[Authorize(SettleAccountPermissions.CentralizedControls.Create)] + // virtual public async Task CreateAsync(CentralizedControlCreateDto input) + // { + // var _first= _repository.Where(p => p.Version == input.Version).FirstOrDefault(); + + // if (_first != null) + // { + // throw new BusinessException("001", "已经存在该期间,不能重复添加!"); + // } + + // var entity = new CentralizedControl( + // GuidGenerator.Create(), + // input.BranchId, + // input.Year, + // input.Period, + // input.Year+input.Period, + // input.State + + // ); + + // await _repository.InsertAsync(entity); + + // //create cache + // //await Cache.SetAsync(entity.Id.ToString(), entity,CacheStrategyConst.FIVE_MINUTES); + + // var dto = ObjectMapper.Map(entity); + // return dto; + + // } + + // /// + // /// 修改实体 + // /// + // /// ID + // /// 修改实体DTO + // /// 实体DTO + // [HttpPut] + // [Route("{id}")] + //[Authorize(SettleAccountPermissions.CentralizedControls.Update)] + // virtual public async Task UpdateAsync(Guid id, CentralizedControlUpdateDto input) + // { + // var entity = await _repository.GetAsync(id); + // entity.Update(input.Remark); + // await _repository.UpdateAsync(entity); + // //update cache + // //await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); + // var dto = ObjectMapper.Map(entity); + // return dto; + + // } + + // /// + // /// 删除实体 + // /// + // /// ID + // /// + // [HttpDelete] + // [Route("{id}")] + //[Authorize(SettleAccountPermissions.CentralizedControls.Delete)] + // virtual public async Task DeleteAsync(Guid id) + // { + // var entity = await GetFromCacheAsync(id); + // await Cache.DeleteAsync(id.ToString()); + // await _repository.DeleteAsync(id); + // } + + // /// + // /// 按IDs删除实体列表 + // /// + // /// IDs + // /// 是否执行成功 + // [HttpPost] + // [Route("delete")] + //[Authorize(SettleAccountPermissions.CentralizedControls.Delete)] + // virtual public async Task DeleteListAsync(List ids) + // { + // var _query = _repository.Where(p => ids.Contains(p.Id)); + // int i = await _query.BatchDeleteAsync(); + + // if (i == 0) + // { + // return false; + // } + // return true; + // } + // [HttpPost] + // [Route("open")] + // [Authorize(SettleAccountPermissions.CentralizedControls.Create)] + // public async Task OpenVersion(List ids) + // { + // foreach (var id in ids) + // { + // var _entity = await _repository.GetAsync(id); + // _entity.OpenVersion(); + + // } + // return true; + // } + // [HttpPost] + // [Route("close")] + // [Authorize(SettleAccountPermissions.CentralizedControls.Create)] + // /// + // /// 关闭版本 + // /// + // /// 选择要关闭的ID + // /// + // public async Task ClosedVersion(List ids) + // { + // foreach (var id in ids) + // { + // var _entity = await _repository.GetAsync(id); + // _entity.ClosedVersion(); + // } + // return true; + // } + // [HttpPost] + // [Route("openlist")] + // /// + // /// 获得开放的版本列表 + // /// + // /// + // public async Task> GetOpenVersionList() + // { + // var _list = await _repository.Where(p => p.State == 0).ToListAsync(); + + // var dtos = ObjectMapper.Map, List>(_list); + + // return dtos; + // } + #endregion + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs index a94034d5..03b8f4d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ErpShipping/ErpShippingAppService.cs @@ -1,9 +1,6 @@ - - using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using EFCore.BulkExtensions; @@ -13,17 +10,12 @@ 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; @@ -33,10 +25,7 @@ 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 { @@ -56,10 +45,8 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails private readonly IExcelImportAppService _excelImportService; - private readonly ISettleAccountBranchEfCoreRepository _repository; - private readonly ISettleAccountBranchEfCoreRepository _materialRepository; private readonly ISettleAccountBranchEfCoreRepository _importColumnMapRepository; @@ -82,7 +69,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails ISettleAccountBranchEfCoreRepository materialRepository, ISettleAccountBranchEfCoreRepository importColumnMapRepository, IDistributedCache cache - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _guidGenerator = guidGenerator; _objectMapper = objectMapper; @@ -148,9 +135,6 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails // return ApplicationConsts.SuccessStr; //} - - - /// /// 빦 /// @@ -159,18 +143,17 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails [HttpPost] [Route("ExcelImport")] [DisableRequestSizeLimit] - - public async Task ERPShippingDetailUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory) + public async Task 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(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var entityList = ObjectMapper.Map, List>(result); - var _versionQuery = _versionRepository.Where(p => p.Version == version ); - await _versionQuery.BatchDeleteAsync(); - var _query = _repository.Where(p => p.Version == version ); - await _query.BatchDeleteAsync(); + var _versionQuery = _versionRepository.Where(p => p.Version == version); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); + var _query = _repository.Where(p => p.Version == version); + await _query.BatchDeleteAsync().ConfigureAwait(false); //var checkList = new List(); //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 }); @@ -197,10 +180,10 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails //{ // return await ExportErrorReportAsync(checkList); //} - await _repository.GetDbContext().BulkInsertAsync(entityList); - - await _versionRepository.GetDbContext().BulkInsertAsync(new List { new ERPShippingVersion(Guid.NewGuid(), branchId, year, period, version, customerCode, factory) }); - + await _repository.GetDbContext().BulkInsertAsync(entityList).ConfigureAwait(false); + + await _versionRepository.GetDbContext().BulkInsertAsync(new List { new ERPShippingVersion(Guid.NewGuid(), branchId, year, period, version, customerCode, factory) }).ConfigureAwait(false); + //st.Stop(); return ApplicationConsts.SuccessStr; } @@ -212,12 +195,12 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails [HttpPost] [Route("Export")] - virtual public async Task ExportAsync(ERPShippingDetailRequestDto input) + public virtual async Task ExportAsync(ERPShippingDetailRequestDto input) { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); //ϰ汾ȫ - if (!string.IsNullOrEmpty(input.Version )) + if (!string.IsNullOrEmpty(input.Version)) { input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version.ToString() }); } @@ -226,14 +209,12 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails // return new PagedResultDto(0, new List()); //} var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); - string _fileName = string.Empty; + var _fileName = string.Format("ERP_{0}.xlsx", Guid.NewGuid().ToString("N")); // - byte[] result = null; - _fileName = string.Format("ERP_{0}.xlsx", Guid.NewGuid().ToString("N")); - result = await _excel.ExportAsByteArray(dtoDetails); + var result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -244,7 +225,7 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } #endregion @@ -259,31 +240,22 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails /// ʵDTO [HttpGet] [Route("{id}")] - - virtual public async Task GetAsync(Guid id) + + public virtual async Task GetAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); var dto = _objectMapper.Map(result); return dto; } - - private async Task GetFromCacheAsync(Guid id) - { - var result = await _repository.GetAsync(id); - return result; - } - - private async Task GetCountAsync(ERPShippingDetailRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - private async Task GetCountAsync(ERPShippingVersionRequestDto input) { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } /// @@ -292,14 +264,12 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails /// ʵ [HttpGet] [Route("count")] - - virtual public async Task GetTotalCountAsync(Guid branchId) + + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } - - /// /// ɾʵ /// @@ -307,12 +277,12 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails /// [HttpDelete] [Route("{id}")] - - virtual public async Task DeleteAsync(Guid id) + + public virtual async Task DeleteAsync(Guid id) { //var entity = await GetFromCacheAsync(id); //await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -322,19 +292,18 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails /// Ƿִгɹ [HttpPost] [Route("delete")] - - virtual public async Task DeleteListAsync(List ids) + + public virtual async Task DeleteListAsync(List ids) { //foreach (var id in ids) //{ // var entity = await GetFromCacheAsync(id); - + //} - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - ///// /// @@ -350,17 +319,17 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails public async Task> GetListAsync(Guid parentId, ERPShippingDetailRequestDto input) { - if (!string.IsNullOrEmpty(input.Version) ) + 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(0,new List()); + return new PagedResultDto(0, new List()); } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); - var totalCount = await GetCountAsync(input); + input.SkipCount, true).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = _objectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -381,15 +350,15 @@ namespace Win.Sfs.SettleAccount.ERPShippingDetails public async Task> GetVersionListAsync(ERPShippingVersionRequestDto input) { var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = _objectMapper.Map, List>(entities); //foreach (var itm in dtos) //{ // itm.Version = itm.Version + string.Format("({0})", itm.Factory); //} return new PagedResultDto(totalCount, dtos); - } + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Errors/ErrorDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Errors/ErrorDto.cs index e4cc68d5..7f59f35a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Errors/ErrorDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Errors/ErrorDto.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.Errors { public class ErrorDto diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs index 1f80c2c3..def84764 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Factories/FactoryAppService.cs @@ -1,31 +1,24 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Threading.Tasks; using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -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.Factories; -using Win.Sfs.SettleAccount.Entities.ImportMap; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.Shared.CacheBase; -using Win.Utils; namespace Win.Sfs.SettleAccount.Entities.Factories { @@ -38,8 +31,6 @@ namespace Win.Sfs.SettleAccount.Entities.Factories [Route("api/settleaccount/Factory")] public class FactoryAppService : SettleAccountApplicationBase, IFactoryAppService { - - private readonly ISettleAccountBranchEfCoreRepository _mapRepository; private readonly IExcelImportAppService _excelImportService; private readonly ISettleAccountBranchEfCoreRepository _repository; /// @@ -56,7 +47,7 @@ namespace Win.Sfs.SettleAccount.Entities.Factories IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _repository = repository; @@ -75,9 +66,8 @@ namespace Win.Sfs.SettleAccount.Entities.Factories public async Task FactoryUploadExcelImport([FromForm] IFormFileCollection files) { - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var _ls = ObjectMapper.Map, List>(result); foreach (var itm in _ls) { @@ -85,11 +75,9 @@ namespace Win.Sfs.SettleAccount.Entities.Factories } var bulkConfig = new BulkConfig { SetOutputIdentity = true, BatchSize = 10000 }; _repository.GetDbContext().BulkInsert(_ls, bulkConfig); - return ApplicationConsts.SuccessStr; + return ApplicationConsts.SuccessStr; } - - /// /// 按ID获取唯一实体 /// @@ -100,51 +88,43 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// 实体DTO [HttpGet] [Route("{id}")] - [Authorize(SettleAccountPermissions.Factorys.Default)] - virtual public async Task GetAsync(Guid id) + [Authorize(SettleAccountPermissions.Factorys.Default)] + public virtual async Task GetAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); - + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } - private async Task GetCountAsync(FactoryRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - - //导出文件名称 - - - - [HttpPost] - [Route("Export")] - [Authorize(SettleAccountPermissions.Factorys.Default)] - virtual public async Task ExportAsync(FactoryRequestDto input) - { - string _fileName = string.Format("工厂_{0}.xlsx",input.UserId.ToString()); + [HttpPost] + [Route("Export")] + [Authorize(SettleAccountPermissions.Factorys.Default)] + public virtual async Task ExportAsync(FactoryRequestDto input) + { + string _fileName = string.Format("工厂_{0}.xlsx", input.UserId.ToString()); var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtoDetails); + var result = await _exportImporter.ExcelExporter(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -155,48 +135,42 @@ namespace Win.Sfs.SettleAccount.Entities.Factories Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; - } - - - - - + } - /// - /// 根据筛选条件获取实体列表 - /// - /// - /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - /// - /// 请求条件 - /// 实体DTO列表 - [HttpPost] + /// + /// 根据筛选条件获取实体列表 + /// + /// + /// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + /// + /// 请求条件 + /// 实体DTO列表 + [HttpPost] [Route("list")] - [Authorize(SettleAccountPermissions.Factorys.Default)] - virtual public async Task> GetListAsync(FactoryRequestDto input) + [Authorize(SettleAccountPermissions.Factorys.Default)] + public virtual async Task> GetListAsync(FactoryRequestDto input) { var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - /// /// 获取实体总数 /// /// 实体总数 [HttpGet] [Route("count")] - [Authorize(SettleAccountPermissions.Factorys.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + [Authorize(SettleAccountPermissions.Factorys.Default)] + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } /// @@ -205,20 +179,16 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// 实体DTO列表 [HttpGet] [Route("all")] - [Authorize(SettleAccountPermissions.Factorys.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + [Authorize(SettleAccountPermissions.Factorys.Default)] + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId, true); - + var entities = await _repository.GetAllAsync(branchId, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); } - - /// /// 创建工厂 /// @@ -226,9 +196,9 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// [HttpPost] [Route("")] - [Authorize(SettleAccountPermissions.Factorys.Create)] - - virtual public async Task CreateAsync(FactoryCreateDto input) + [Authorize(SettleAccountPermissions.Factorys.Create)] + + public virtual async Task CreateAsync(FactoryCreateDto input) { var _first = _repository.FirstOrDefault(p => p.Code == input.Code); @@ -237,7 +207,6 @@ namespace Win.Sfs.SettleAccount.Entities.Factories throw new BusinessException("001", "已经存数据请修改后创建"); } - var entity = new Factory( GuidGenerator.Create(), input.BranchId, @@ -247,7 +216,7 @@ namespace Win.Sfs.SettleAccount.Entities.Factories ); - await _repository.InsertAsync(entity); + await _repository.InsertAsync(entity).ConfigureAwait(false); //create cache //await Cache.SetAsync(entity.Id.ToString(), entity,CacheStrategyConst.FIVE_MINUTES); @@ -265,19 +234,17 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// 实体DTO [HttpPut] [Route("{id}")] - [Authorize(SettleAccountPermissions.Factorys.Update)] - virtual public async Task UpdateAsync(Guid id, FactoryUpdateDto input) + [Authorize(SettleAccountPermissions.Factorys.Update)] + public virtual async Task UpdateAsync(Guid id, FactoryUpdateDto input) { - var entity = await _repository.GetAsync(id); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); entity.Update(input.Desc); - await _repository.UpdateAsync(entity); + await _repository.UpdateAsync(entity).ConfigureAwait(false); //update cache //await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); var dto = ObjectMapper.Map(entity); return dto; - - } /// @@ -287,12 +254,12 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// [HttpDelete] [Route("{id}")] - [Authorize(SettleAccountPermissions.Factorys.Delete)] - virtual public async Task DeleteAsync(Guid id) + [Authorize(SettleAccountPermissions.Factorys.Delete)] + public virtual async Task DeleteAsync(Guid id) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -302,11 +269,11 @@ namespace Win.Sfs.SettleAccount.Entities.Factories /// 是否执行成功 [HttpPost] [Route("delete")] - [Authorize(SettleAccountPermissions.Factorys.Delete)] - virtual public async Task DeleteListAsync(List ids) + [Authorize(SettleAccountPermissions.Factorys.Delete)] + public virtual async Task DeleteListAsync(List ids) { var _query = _repository.Where(p => ids.Contains(p.Id)); - int i = await _query.BatchDeleteAsync(); + int i = await _query.BatchDeleteAsync().ConfigureAwait(false); if (i == 0) { @@ -317,11 +284,4 @@ namespace Win.Sfs.SettleAccount.Entities.Factories } - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs index eaf038b1..be9d124c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Inventories/InventoryDetailAppService.cs @@ -11,13 +11,9 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; 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 Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; @@ -30,7 +26,6 @@ using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.Inventories; using Win.Sfs.Shared.CacheBase; using Win.Sfs.Shared.Filter; -using Win.Utils; namespace Win.Sfs.SettleAccount.InventoryDetails { @@ -62,7 +57,7 @@ namespace Win.Sfs.SettleAccount.InventoryDetails IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _materialRepository = materialRepository; _versionRepository = versionRepository; @@ -78,10 +73,10 @@ namespace Win.Sfs.SettleAccount.InventoryDetails [Route("ExcelImport")] [DisableRequestSizeLimit] [Authorize(SettleAccountPermissions.InventoryDetails.Default)] - public async Task InventoryDetailUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory) + public async Task InventoryDetailUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExtendExcelImport(files, _excelImportService); + var result = await _exportImporter.ExtendExcelImport(files, _excelImportService).ConfigureAwait(false); List _list = new List(); var checkList = new List(); var _id = GuidGenerator.Create(); @@ -92,19 +87,19 @@ namespace Win.Sfs.SettleAccount.InventoryDetails _list.Add(itm); } } - // List errorList = new List(); + // List errorList = new List(); - var _group =_list.GroupBy(x => new { x.MaterialCode, x.StorageLocation}).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode, StorageLocation = p.Key.StorageLocation }); + var _group = _list.GroupBy(x => new { x.MaterialCode, x.StorageLocation }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode, StorageLocation = p.Key.StorageLocation }); foreach (var itm in _group) { if (itm.Count > 1) { - checkList.Add(new ErrorExportDto(version,factory,string.Empty,string.Empty,string.Empty,string.Empty, string.Format("ܵϱ{0},洢ص{1}ظ", itm.MaterialCode, itm.StorageLocation),string.Empty)); + checkList.Add(new ErrorExportDto(version, factory, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ܵϱ{0},洢ص{1}ظ", itm.MaterialCode, itm.StorageLocation), string.Empty)); } } - var _matList= await _materialRepository.GetAllAsync(GuidGenerator.Create()); + var _matList = await _materialRepository.GetAllAsync(GuidGenerator.Create()).ConfigureAwait(false); foreach (var itm in _list) { @@ -114,25 +109,25 @@ namespace Win.Sfs.SettleAccount.InventoryDetails continue; } - itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id,factory); + itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id, factory); } if (checkList.Count > 0) { - return await ExportErrorReportAsync(checkList); + return await ExportErrorReportAsync(checkList).ConfigureAwait(false); } var _versionQuery = _versionRepository.Where(p => p.Version == version && p.Factory == factory); - await _versionQuery.BatchDeleteAsync(); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); var _query = _repository.Where(p => p.Version == version && p.Factory == factory); - await _query.BatchDeleteAsync(); - + await _query.BatchDeleteAsync().ConfigureAwait(false); + _repository.GetDbContext().BulkInsert(_list); var versionList = new List(); versionList.Add(new InventoryDetailVersion(_id, branchId, year, period, version, customerCode, factory)); - await _versionRepository.GetDbContext().BulkInsertAsync(versionList); + await _versionRepository.GetDbContext().BulkInsertAsync(versionList).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } @@ -146,35 +141,31 @@ namespace Win.Sfs.SettleAccount.InventoryDetails /// ʵDTO [HttpGet] [Route("{id}")] - [Authorize(SettleAccountPermissions.InventoryDetails.Default)] - virtual public async Task GetAsync(Guid id) + [Authorize(SettleAccountPermissions.InventoryDetails.Default)] + public virtual async Task GetAsync(Guid id) { - var result = await GetFromCacheAsync(id); + var result = await GetFromCacheAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); - + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } - private async Task GetCountAsync(InventoryDetailRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } private async Task GetCountAsync(InventoryDetialVersionRequestDto input) { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - ///// /// @@ -187,8 +178,8 @@ namespace Win.Sfs.SettleAccount.InventoryDetails /// ʵDTOб [HttpPost] [Route("list")] - [Authorize(SettleAccountPermissions.InventoryDetails.Default)] - virtual public async Task> GetListAsync(Guid parentId, InventoryDetailRequestDto input) + [Authorize(SettleAccountPermissions.InventoryDetails.Default)] + public virtual async Task> GetListAsync(Guid parentId, InventoryDetailRequestDto input) { if (input.ParentId != Guid.Empty) @@ -201,25 +192,24 @@ namespace Win.Sfs.SettleAccount.InventoryDetails } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - /// /// ȡʵ /// /// ʵ [HttpGet] [Route("count")] - [Authorize(SettleAccountPermissions.InventoryDetails.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + [Authorize(SettleAccountPermissions.InventoryDetails.Default)] + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } /// @@ -228,21 +218,16 @@ namespace Win.Sfs.SettleAccount.InventoryDetails /// ʵDTOб [HttpGet] [Route("all")] - [Authorize(SettleAccountPermissions.InventoryDetails.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + [Authorize(SettleAccountPermissions.InventoryDetails.Default)] + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId, true); - + var entities = await _repository.GetAllAsync(branchId, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); } - - - /// /// ޸ʵ /// @@ -251,10 +236,10 @@ namespace Win.Sfs.SettleAccount.InventoryDetails /// ʵDTO [HttpPut] [Route("{id}")] - [Authorize(SettleAccountPermissions.InventoryDetails.Update)] - virtual public async Task UpdateAsync(Guid id, InventoryDetailUpdateDto input) + [Authorize(SettleAccountPermissions.InventoryDetails.Update)] + public virtual async Task UpdateAsync(Guid id, InventoryDetailUpdateDto input) { - var entity = await _repository.GetAsync(id); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); if (entity != null) { //var _inventory = new InventoryDetail( @@ -279,7 +264,7 @@ namespace Win.Sfs.SettleAccount.InventoryDetails //await _repository.UpdateAsync(_inventory); //update cache - await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); + await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; @@ -298,12 +283,12 @@ namespace Win.Sfs.SettleAccount.InventoryDetails /// [HttpDelete] [Route("{id}")] - [Authorize(SettleAccountPermissions.InventoryDetails.Delete)] - virtual public async Task DeleteAsync(Guid id) + [Authorize(SettleAccountPermissions.InventoryDetails.Delete)] + public virtual async Task DeleteAsync(Guid id) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -313,20 +298,18 @@ namespace Win.Sfs.SettleAccount.InventoryDetails /// Ƿִгɹ [HttpPost] [Route("delete")] - [Authorize(SettleAccountPermissions.InventoryDetails.Delete)] - virtual public async Task DeleteListAsync(List ids) + [Authorize(SettleAccountPermissions.InventoryDetails.Delete)] + public virtual async Task DeleteListAsync(List ids) { foreach (var id in ids) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); } - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - - [HttpPost] [Route("listversion")] [Authorize(SettleAccountPermissions.InventoryDetails.Default)] @@ -338,9 +321,9 @@ namespace Win.Sfs.SettleAccount.InventoryDetails public async Task> GetVersionListAsync(InventoryDetialVersionRequestDto input) { var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); foreach (var itm in dtos) { @@ -349,7 +332,6 @@ namespace Win.Sfs.SettleAccount.InventoryDetails return new PagedResultDto(totalCount, dtos); } - /// /// ļ /// @@ -358,7 +340,7 @@ namespace Win.Sfs.SettleAccount.InventoryDetails [HttpPost] [Route("Export")] [Authorize(SettleAccountPermissions.InventoryDetails.Default)] - virtual public async Task ExportAsync(InventoryDetailRequestDto input) + public virtual async Task ExportAsync(InventoryDetailRequestDto input) { IExporter _csv = new CsvExporter(); @@ -370,7 +352,7 @@ namespace Win.Sfs.SettleAccount.InventoryDetails 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); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); @@ -382,11 +364,11 @@ namespace Win.Sfs.SettleAccount.InventoryDetails { case 0: _fileName = string.Format("ڿϸ_{0}.csv", input.UserId.ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: _fileName = string.Format("ڿϸ_{0}.xlsx", input.UserId.ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -398,7 +380,7 @@ namespace Win.Sfs.SettleAccount.InventoryDetails Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs index 7fc58cd3..f2ef2ebb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Invoices/InvoiceAppService.cs @@ -11,30 +11,19 @@ using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Caching.Distributed; using Shouldly; -using TaskJob.EventArgs; -using TaskJob.Services; -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 Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; -using Win.Sfs.SettleAccount.Entities.Inventories; -using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion; using Win.Sfs.SettleAccount.Entities.Invoices.Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.TaskJobs; using Win.Sfs.SettleAccount.ExcelImporter; -using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.Inventories; using Win.Sfs.Shared.CacheBase; using Win.Sfs.Shared.Filter; -using Win.Utils; namespace Win.Sfs.SettleAccount.Entities.Invoices { @@ -44,9 +33,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [ApiExplorerSettings(IgnoreApi = true)] [Route("api/settleaccount/Invoices")] [Authorize(SettleAccountPermissions.Invoices.Default)] - public class InvoiceAppService : SettleAccountApplicationBase,IInvoiceAppService + public class InvoiceAppService : SettleAccountApplicationBase, IInvoiceAppService { - + private readonly ISettleAccountBranchEfCoreRepository _repository; private readonly ISettleAccountBranchEfCoreRepository _versionRepository; @@ -68,9 +57,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices TaskJobService service ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - + _versionRepository = versionRepository; - + _repository = repository; _service = service; } @@ -86,14 +75,14 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public async Task InvoiceUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var entityList = ObjectMapper.Map, List>(result); //删除版本 var _versionQuery = _versionRepository.Where(p => p.Version == version); - await _versionQuery.BatchDeleteAsync(); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); //删除明细 var _query = _repository.Where(p => p.Version == version); - await _query.BatchDeleteAsync(); + await _query.BatchDeleteAsync().ConfigureAwait(false); var _id = GuidGenerator.Create(); var _bomList = new List(); @@ -103,8 +92,8 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, _id); } //批量插入操作 - await _repository.GetDbContext().BulkInsertAsync(entityList); - await _versionRepository.GetDbContext().BulkInsertAsync(_bomList); + await _repository.GetDbContext().BulkInsertAsync(entityList).ConfigureAwait(false); + await _versionRepository.GetDbContext().BulkInsertAsync(_bomList).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } @@ -135,9 +124,6 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices // return _taskid; //} - - - /// /// 按ID获取唯一实体 /// @@ -149,34 +135,29 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpGet] [Route("{id}")] //[Authorize(SettleAccountPermissions.Invoices.Default)] - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - var result = await GetFromCacheAsync(id); + var result = await GetFromCacheAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } - private async Task GetCountAsync(InvoiceRequestDto input) { - return await _repository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); + return await _repository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters).ConfigureAwait(false); } private async Task GetCountAsync(InvoiceVersionRequestDto input) { - return await _versionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); + return await _versionRepository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters).ConfigureAwait(false); } - - - /// /// 根据筛选条件获取实体列表 /// @@ -188,7 +169,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpPost] [Route("list")] //[Authorize(SettleAccountPermissions.Invoices.Default)] - virtual public async Task> GetListAsync(InvoiceRequestDto input) + public virtual async Task> GetListAsync(InvoiceRequestDto input) { if (!string.IsNullOrEmpty(input.Version)) { @@ -199,13 +180,12 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices return new PagedResultDto(0, new List()); } var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); - var totalCount = await GetCountAsync(input); + input.SkipCount, true).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - /// /// 获取实体总数 /// @@ -213,9 +193,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpGet] [Route("count")] //[Authorize(SettleAccountPermissions.Invoices.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } /// @@ -225,9 +205,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpGet] [Route("all")] [Authorize(SettleAccountPermissions.Invoices.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId, true); + var entities = await _repository.GetAllAsync(branchId, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new ListResultDto(dtos); } @@ -241,13 +221,13 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpPut] [Route("{id}")] //[Authorize(SettleAccountPermissions.Invoices.Update)] - virtual public async Task UpdateAsync(Guid id, InvoiceDto input) + public virtual async Task UpdateAsync(Guid id, InvoiceDto input) { - var entity = await _repository.GetAsync(id); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); if (entity != null) { - - await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); + + await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; @@ -267,11 +247,11 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpDelete] [Route("{id}")] //[Authorize(SettleAccountPermissions.Invoices.Delete)] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -282,18 +262,16 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpPost] [Route("delete")] //[Authorize(SettleAccountPermissions.Invoices.Delete)] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { foreach (var id in ids) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); } - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - - [HttpPost] [Route("listversion")] //[Authorize(SettleAccountPermissions.Invoices.Default)] @@ -305,9 +283,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices public async Task> GetVersionListAsync(InvoiceVersionRequestDto input) { var entities = await _versionRepository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); //foreach (var itm in dtos) //{ @@ -316,7 +294,6 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices return new PagedResultDto(totalCount, dtos); } - /// /// 导出文件 /// @@ -325,7 +302,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [HttpPost] [Route("Export")] //[Authorize(SettleAccountPermissions.Invoices.Default)] - virtual public async Task ExportAsync(InvoiceRequestDto input) + public virtual async Task ExportAsync(InvoiceRequestDto input) { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); @@ -335,7 +312,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); } var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); @@ -348,11 +325,11 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices { case 0: _fileName = string.Format("大众发票汇总_{0}.csv", input.UserId.ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: _fileName = string.Format("大众发票汇总_{0}.xlsx", input.UserId.ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } //string _fileName = string.Format("大众发票汇总_{0}.xlsx", _snowflakeIdGenerator.Create().ToString()); @@ -367,9 +344,7 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices Name = _fileName, Content = result } - ); - - + ).ConfigureAwait(false); return _fileName; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs index a3d8b078..9f848873 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/ItemInvoicePrices/ItemInvoicePriceAppService.cs @@ -1,44 +1,33 @@ - - 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.ItemInvoicePrices; using Win.Sfs.SettleAccount.Entities.ImportMap; +using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices; +using Win.Sfs.SettleAccount.Entities.MaterialRelationships; using Win.Sfs.SettleAccount.Entities.Materials; +using Win.Sfs.SettleAccount.Entities.SettlementParts; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.Shared.CacheBase; using Win.Sfs.Shared.Filter; -using Win.Utils; -using Win.Sfs.SettleAccount.MaterialRelationships; -using Win.Sfs.SettleAccount.Entities.MaterialRelationships; -using Win.Sfs.SettleAccount.Entities.SettlementParts; namespace Win.Sfs.SettleAccount.ItemInvoicePrices { @@ -58,10 +47,8 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices private readonly IExcelImportAppService _excelImportService; - private readonly ISettleAccountBranchEfCoreRepository _repository; - private readonly ISettleAccountBranchEfCoreRepository _materialRepository; private readonly ISettleAccountBranchEfCoreRepository _relationRepository; private readonly ISettleAccountBranchEfCoreRepository _priceRepository; @@ -88,7 +75,7 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices ISettleAccountBranchEfCoreRepository priceRepository, IDistributedCache cache - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _guidGenerator = guidGenerator; _objectMapper = objectMapper; @@ -116,17 +103,16 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices public async Task ItemInvoicePriceUploadExcelImportMap([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) { - var _mapList = _importColumnMapRepository.Where(p => p.ProjectName == SettleAccountModuleName.ItemInvoicePrice).ToList(); ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var entityList = ObjectMapper.Map, List>(result); var _versionQuery = _versionRepository.Where(p => p.Version == version); - await _versionQuery.BatchDeleteAsync(); - var _query = _repository.Where(p => p.Version == version ); - await _query.BatchDeleteAsync(); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); + var _query = _repository.Where(p => p.Version == version); + await _query.BatchDeleteAsync().ConfigureAwait(false); var checkList = new List(); - var _matList = await _materialRepository.GetAllAsync(GuidGenerator.Create()); + var _matList = await _materialRepository.GetAllAsync(GuidGenerator.Create()).ConfigureAwait(false); //var _group = entityList.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode }); //foreach (var itm in _group) @@ -137,8 +123,6 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices // } //} - - var _id = GuidGenerator.Create(); var _ItemInvoicePriceList = new List(); _ItemInvoicePriceList.Add(new ItemInvoicePriceVersion(_id, branchId, year, period, version, customerCode, factory)); @@ -153,17 +137,14 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices } if (checkList.Count > 0) { - return await ExportErrorReportAsync(checkList); + return await ExportErrorReportAsync(checkList).ConfigureAwait(false); } - await _repository.GetDbContext().BulkInsertAsync(entityList); - await _versionRepository.GetDbContext().BulkInsertAsync(_ItemInvoicePriceList); + await _repository.GetDbContext().BulkInsertAsync(entityList).ConfigureAwait(false); + await _versionRepository.GetDbContext().BulkInsertAsync(_ItemInvoicePriceList).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } - - - /// /// 빦 /// @@ -174,19 +155,19 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices [DisableRequestSizeLimit] //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Create)] - public async Task ItemInvoicePriceUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode,string factory) + public async Task ItemInvoicePriceUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) { - + ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); var entityList = ObjectMapper.Map, List>(result); - var _versionQuery = _versionRepository.Where(p => p.Version == version && p.Factory==factory ); - await _versionQuery.BatchDeleteAsync(); + var _versionQuery = _versionRepository.Where(p => p.Version == version && p.Factory == factory); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); var _query = _repository.Where(p => p.Version == version && p.Factory == factory); - await _query.BatchDeleteAsync(); + await _query.BatchDeleteAsync().ConfigureAwait(false); var checkList = new List(); - var _matList =await _materialRepository.GetAllAsync(GuidGenerator.Create()); - var _group = entityList.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode }); + var _matList = await _materialRepository.GetAllAsync(GuidGenerator.Create()).ConfigureAwait(false); + var _group = entityList.GroupBy(x => new { x.MaterialCode, x.Version }).Select(p => new { Count = p.Count(), MaterialCode = p.Key.MaterialCode }); //foreach (var itm in _group) //{ // if (itm.Count > 1) @@ -195,8 +176,8 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices // } //} var _id = GuidGenerator.Create(); - var _ItemInvoicePriceList = new List(); - _ItemInvoicePriceList.Add(new ItemInvoicePriceVersion(_id, branchId, year, period, version, customerCode,factory)); + var _ItemInvoicePriceList = new List(); + _ItemInvoicePriceList.Add(new ItemInvoicePriceVersion(_id, branchId, year, period, version, customerCode, factory)); foreach (var itm in entityList) { if (!_matList.Any(p => p.MaterialCode == itm.MaterialCode)) @@ -204,14 +185,14 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, itm.MaterialCode, string.Empty, string.Format("ݲϺ{0}", itm.MaterialCode), string.Empty)); continue; } - itm.SetValue(GuidGenerator.Create(),branchId,year,period,version,factory); + itm.SetValue(GuidGenerator.Create(), branchId, year, period, version, factory); } if (checkList.Count > 0) { - return await ExportErrorReportAsync(checkList); + return await ExportErrorReportAsync(checkList).ConfigureAwait(false); } - await _repository.GetDbContext().BulkInsertAsync(entityList); - await _versionRepository.GetDbContext().BulkInsertAsync(_ItemInvoicePriceList); + await _repository.GetDbContext().BulkInsertAsync(entityList).ConfigureAwait(false); + await _versionRepository.GetDbContext().BulkInsertAsync(_ItemInvoicePriceList).ConfigureAwait(false); //st.Stop(); return ApplicationConsts.SuccessStr; } @@ -223,22 +204,22 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices [HttpPost] [Route("Export")] //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)] - virtual public async Task ExportAsync(ItemInvoicePriceRequestDto input) + public virtual async Task ExportAsync(ItemInvoicePriceRequestDto input) { IExporter _csv = new CsvExporter(); IExporter _excel = new ExcelExporter(); var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); string _fileName = string.Empty; - - var _query = from itm1 in _relationRepository join itm2 in _priceRepository on new { itm1.CustomerCode, itm1.Version,itm1.SettleMaterialCode } equals new { itm2.CustomerCode, itm2.Version, SettleMaterialCode =itm2.SettlementPartCode } + var _query = from itm1 in _relationRepository + join itm2 in _priceRepository on new { itm1.CustomerCode, itm1.Version, itm1.SettleMaterialCode } equals new { itm2.CustomerCode, itm2.Version, SettleMaterialCode = itm2.SettlementPartCode } where itm1.Version == input.Version && itm1.CustomerCode == "R0003" - - select new { ErpMaterialCode=itm1.ErpMaterialCode, SettleMaterialCode=itm1.SettleMaterialCode,Price=itm1.Qty*itm2.Price}; - var _priceList = await _query.GroupBy(p => p.ErpMaterialCode).Select(p => new { Price = p.Sum(itm => itm.Price), ErpMaterialCode = p.Key }).ToListAsync(); + select new { ErpMaterialCode = itm1.ErpMaterialCode, SettleMaterialCode = itm1.SettleMaterialCode, Price = itm1.Qty * itm2.Price }; + + var _priceList = await _query.GroupBy(p => p.ErpMaterialCode).Select(p => new { Price = p.Sum(itm => itm.Price), ErpMaterialCode = p.Key }).ToListAsync().ConfigureAwait(false); if (_priceList.Count > 0) { @@ -263,19 +244,15 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices { case 0: _fileName = string.Format("QAD˵_{0}.csv", _snowflakeIdGenerator.Create().ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: _fileName = string.Format("QAD˵_{0}.xlsx", _snowflakeIdGenerator.Create().ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); - - - - //浼ļɶ await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto @@ -283,7 +260,7 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } #endregion @@ -298,31 +275,22 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices /// ʵDTO [HttpGet] [Route("{id}")] - //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)] - virtual public async Task GetAsync(Guid id) + //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)] + public virtual async Task GetAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); var dto = _objectMapper.Map(result); return dto; } - - private async Task GetFromCacheAsync(Guid id) - { - var result = await _repository.GetAsync(id); - return result; - } - - private async Task GetCountAsync(ItemInvoicePriceRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - private async Task GetCountAsync(ItemInvoicePriceVersionRequestDto input) { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } /// @@ -331,14 +299,12 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices /// ʵ [HttpGet] [Route("count")] - //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)] + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } - - /// /// ɾʵ /// @@ -346,12 +312,12 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices /// [HttpDelete] [Route("{id}")] - //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Delete)] - virtual public async Task DeleteAsync(Guid id) + //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Delete)] + public virtual async Task DeleteAsync(Guid id) { //var entity = await GetFromCacheAsync(id); //await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -361,19 +327,18 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices /// Ƿִгɹ [HttpPost] [Route("delete")] - //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Delete)] - virtual public async Task DeleteListAsync(List ids) + //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Delete)] + public virtual async Task DeleteListAsync(List ids) { //foreach (var id in ids) //{ // var entity = await GetFromCacheAsync(id); - + //} - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - ///// /// @@ -389,13 +354,12 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices //[Authorize(SettleAccountPermissions.ItemInvoicePrices.Default)] public async Task> GetListAsync(ItemInvoicePriceRequestDto input) { - + input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); - - + var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); - var totalCount = await GetCountAsync(input); + input.SkipCount, true).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = _objectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -416,15 +380,15 @@ namespace Win.Sfs.SettleAccount.ItemInvoicePrices public async Task> GetVersionListAsync(ItemInvoicePriceVersionRequestDto input) { var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = _objectMapper.Map, List>(entities); //foreach (var itm in dtos) //{ // itm.Version = itm.Version + string.Format("({0})", itm.Factory); //} return new PagedResultDto(totalCount, dtos); - } + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Jobs/UpdateLoadFileJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Jobs/UpdateLoadFileJob.cs index 50d03dcd..48110666 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Jobs/UpdateLoadFileJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Jobs/UpdateLoadFileJob.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; @@ -21,20 +16,16 @@ namespace Win.Sfs.SettleAccount.Entities.Jobs public override void Execute(UpdateLoadFileArgs args) { - + if (args.ImportOrExport == true) { - - } else { - - } - + } public void Import(string fileName, string serviceName) { @@ -42,17 +33,8 @@ namespace Win.Sfs.SettleAccount.Entities.Jobs } public void Export(string fileName, string serviceName) { - + } } - - - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs index 2041292f..f0499808 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipAppService.cs @@ -3,14 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Shouldly; using Volo.Abp.Application.Dtos; using Volo.Abp.Caching; using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; @@ -19,456 +17,436 @@ using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships; - -/// -/// 客户零件关系 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class MaterialRelationshipAppService : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships { /// - /// 客户零件关系仓储 - /// - private readonly INormalEfCoreRepository _repository; - - /// - /// 构造 - /// - public MaterialRelationshipAppService( - INormalEfCoreRepository repository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) - { - _repository = repository; - } - - #region 导入、导出 - /// - /// 导入 + /// 客户零件关系 /// - [HttpPost] - public async Task ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class MaterialRelationshipAppService : SettleAccountApplicationBase { - var _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false); - var _ls = ObjectMapper.Map, List>(result); - List _errorList = new List(); - var checkList = new List(); + /// + /// 客户零件关系仓储 + /// + private readonly INormalEfCoreRepository _repository; + + /// + /// 构造 + /// + public MaterialRelationshipAppService( + INormalEfCoreRepository repository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _repository = repository; + } - if (_ls.Count > 0) + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] MaterialRelationshipImportRequestDto materialRelationshipImportRequestDto) { - var query = from arc in _ls - group arc by new { arc.SettleMaterialCode } - into g - where g.Count() > 1 - select g; - foreach (var itm in query) + var _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImport(materialRelationshipImportRequestDto.Files, _excelImportService).ConfigureAwait(false); + var _ls = ObjectMapper.Map, List>(result); + List _errorList = new List(); + var checkList = new List(); + + if (_ls.Count > 0) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("客户物料号{0}有重复", itm.Key.SettleMaterialCode), string.Empty)); + var query = from arc in _ls + group arc by new { arc.SettleMaterialCode } + into g + where g.Count() > 1 + select g; + foreach (var itm in query) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("客户物料号{0}有重复", itm.Key.SettleMaterialCode), string.Empty)); + } } - } - if (checkList.Count > 0) - { - string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); - } - foreach (var itm in _ls) - { - var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian); - if (_first != null) + if (checkList.Count > 0) { - _first.Update(itm.MaterialDesc, itm.SettleMaterialCode); - await _repository.UpdateAsync(_first).ConfigureAwait(false); + string fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { Code = ApplicationConsts.ImportFailCode, Message = "错误提示文件已下载,请打开文件查看", fileName = fileName }); } - else + foreach (var itm in _ls) { - itm.BusinessType = EnumBusinessType.BeiJian; - await _repository.InsertAsync(itm).ConfigureAwait(false); + var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode && p.BusinessType == EnumBusinessType.BeiJian); + if (_first != null) + { + _first.Update(itm.MaterialDesc, itm.SettleMaterialCode); + await _repository.UpdateAsync(_first).ConfigureAwait(false); + } + else + { + itm.BusinessType = EnumBusinessType.BeiJian; + await _repository.InsertAsync(itm).ConfigureAwait(false); + } } + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(RequestDto input) - { - string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(RequestDto input) + { + string fileName = $"客户零件关系_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); - result.ShouldNotBeNull(); + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); - return fileName; - } - #endregion + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion + + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } + #endregion + + #region 原方法(废弃) + ///// + ///// 导入功能 + ///// + ///// 上传的文件(前端已经限制只能上传一个附件) + ///// + //[HttpPost] + //[Route("ExcelImport-Map")] + //[DisableRequestSizeLimit] + //public async Task MaterialRelationshipUploadExcelImportMap([FromForm] IFormFileCollection files) + //{ + // ExportImporter _exportImporter = new ExportImporter(); + // var mapList = _mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.MaterialRelationship).ToList(); + // var result = await _exportImporter.ExtendExcelImport(files, _excelImportService, mapList); + // var _ls = ObjectMapper.Map, List>(result); + // List _errorList = new List(); + // var checkList = new List(); + // if (_ls.Count > 0) + // { + // var query = from arc in _ls + // group arc by new { arc.ErpMaterialCode } + // into g + // where g.Count() > 1 + + // select g; + // foreach (var itm in query) + // { + // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty)); + // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode)); + // } + // } + // foreach (var itm in _ls) + // { + // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode); + // if (_first != null) + // { + // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode); + // await _repository.UpdateAsync(_first); + // } + // else + // { + // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty)); + // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode)); + // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); + // //await _repository.InsertAsync(itm); + // } + // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); + + // } + // if (checkList.Count > 0) + // { + // return await ExportErrorReportAsync(checkList); + // } + + // return ApplicationConsts.SuccessStr; + //} + + ///// + ///// 导入功能 + ///// + ///// 上传的文件(前端已经限制只能上传一个附件) + ///// + //[HttpPost] + //[Route("ExcelImport")] + //[DisableRequestSizeLimit] + //public async Task MaterialRelationshipUploadExcelImport([FromForm] IFormFileCollection files) + //{ + + // ExportImporter _exportImporter = new ExportImporter(); + // var result = await _exportImporter.UploadExcelImport(files, _excelImportService); + // var _ls = ObjectMapper.Map, List>(result); + // List _errorList = new List(); + // var checkList = new List(); + + // if (_ls.Count > 0) + // { + // var query = from arc in _ls + // group arc by new { arc.ErpMaterialCode } + // into g + // where g.Count() > 1 + + // select g; + // foreach (var itm in query) + // { + // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty)); + // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode)); + // } + // } + // foreach (var itm in _ls) + // { + // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode); + // if (_first != null) + // { + // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode); + // await _repository.UpdateAsync(_first); + // } + // else + // { + // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty)); + // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode)); + // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); + // //await _repository.InsertAsync(itm); + // } + // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); + + // } + // if (checkList.Count > 0) + // { + // return await ExportErrorReportAsync(checkList); + // } + + // return ApplicationConsts.SuccessStr; + //} + + ///// + ///// 按ID获取唯一实体 + ///// + ///// + ///// 返回实体全部属性 + ///// + ///// ID + ///// 实体DTO + //[HttpGet] + //[Route("{id}")] + //virtual public async Task GetAsync(Guid id) + //{ + // var result = await GetFromCacheAsync(id); + // var dto = ObjectMapper.Map(result); + // return dto; + //} + + //private async Task GetFromCacheAsync(Guid id) + //{ + // var result = await _repository.GetAsync(id); + + // return result; + //} + + //private async Task GetCountAsync(MaterialRelationshipRequestDto input) + //{ + // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + //} + + /////// + + ///// + ///// 根据筛选条件获取实体列表 + ///// + ///// + ///// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 + ///// + ///// 请求条件 + ///// 实体DTO列表 + //[HttpPost] + //[Route("list")] + //virtual public async Task> GetListAsync(MaterialRelationshipRequestDto input) + //{ + // 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>(entities); + + // return new PagedResultDto(totalCount, dtos); + //} + + ///// + ///// 获取实体总数 + ///// + ///// 实体总数 + //[HttpGet] + //[Route("count")] + //virtual public async Task GetTotalCountAsync(Guid branchId) + //{ + // return await _repository.GetCountAsync(branchId); + //} + + ///// + ///// 获取全部实体列表 + ///// + ///// 实体DTO列表 + //[HttpGet] + //[Route("all")] + //virtual public async Task> GetAllAsync(Guid branchId) + //{ + // var entities = await _repository.GetAllAsync(branchId, true); + + // var dtos = ObjectMapper.Map, List>(entities); + + // return new ListResultDto(dtos); + //} + + ///// + ///// 新增实体 + ///// + ///// 新增实体DTO + ///// 实体DTO + + //[HttpPost] + //[Route("")] + //virtual public async Task CreateAsync(MaterialRelationshipCreateDto input) + //{ + + // var _first = _repository.Where(p => p.ErpMaterialCode == input.ErpMaterialCode).FirstOrDefault(); + + // if (_first != null) + // { + // throw new BusinessException("001", "已经存数据请修改后创建"); + // } + + // var entity = new MaterialRelationship( + // GuidGenerator.Create(), + // input.BranchId, + // input.ErpMaterialCode, + + // input.MaterialDesc, + // input.MaterialProperty, + // input.SettleMaterialCode, + // input.ShipMaterailCode, + // input.AppraisalCategory + + // ); + + // await _repository.InsertAsync(entity); + + // ////create cache + // //await Cache.SetAsync(entity.Id.ToString(), entity, + // // CacheStrategyConst.FIVE_MINUTES); + + // var dto = ObjectMapper.Map(entity); + // return dto; + + //} + + ///// + ///// 修改实体 + ///// + ///// ID + ///// 修改实体DTO + ///// 实体DTO + //[HttpPut] + //[Route("{id}")] + //virtual public async Task UpdateAsync(Guid id, MaterialRelationshipUpdateDto input) + //{ + // var entity = await _repository.GetAsync(id); + // if (entity != null) + // { + // entity.Update(input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode); + + // await _repository.UpdateAsync(entity); + + // var dto = ObjectMapper.Map(entity); + // return dto; + // } + // else + // { + // return null; + // } + + //} + + ///// + ///// 删除实体 + ///// + ///// ID + ///// + //[HttpDelete] + //[Route("{id}")] + //virtual public async Task DeleteAsync(Guid id) + //{ + // var entity = await GetFromCacheAsync(id); + // await Cache.DeleteAsync(id.ToString()); + // await _repository.DeleteAsync(id); + //} + + ///// + ///// 按IDs删除实体列表 + ///// + ///// IDs + ///// 是否执行成功 + //[HttpPost] + //[Route("delete")] + //virtual public async Task DeleteListAsync(List ids) + //{ + // var _query = _repository.Where(p => ids.Contains(p.Id)); + // int i = await _query.BatchDeleteAsync(); + + // if (i == 0) + // { + // return false; + // } + // return true; + //} + //[HttpPost] + //[Route("Export")] + //virtual public async Task ExportAsync(MaterialRelationshipRequestDto input) + //{ + // //var _userId = CurrentUser.Id.Value.ToString(); + // string _fileName = string.Format("零件关系_{0}.xlsx", Guid.NewGuid().ToString()); + // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, + // 0, true); + + // var dtoDetails = ObjectMapper.Map, List>(entities); + + // //声明导出容器 + // ExportImporter _exportImporter = new ExportImporter(); + + // var result = await _exportImporter.ExcelExporter(dtoDetails); + + // result.ShouldNotBeNull(); + + // //保存导出文件到服务器存成二进制 + // await _excelImportService.SaveBlobAsync( + // new SaveExcelImportInputDto + // { + // Name = _fileName, + // Content = result + // } + // ); + // return _fileName; + //} + #endregion - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); } - #endregion - - #region 原方法(废弃) - ///// - ///// 导入功能 - ///// - ///// 上传的文件(前端已经限制只能上传一个附件) - ///// - //[HttpPost] - //[Route("ExcelImport-Map")] - //[DisableRequestSizeLimit] - //public async Task MaterialRelationshipUploadExcelImportMap([FromForm] IFormFileCollection files) - //{ - // ExportImporter _exportImporter = new ExportImporter(); - // var mapList = _mapRepository.Where(p => p.ProjectName == SettleAccountModuleName.MaterialRelationship).ToList(); - // var result = await _exportImporter.ExtendExcelImport(files, _excelImportService, mapList); - // var _ls = ObjectMapper.Map, List>(result); - // List _errorList = new List(); - // var checkList = new List(); - // if (_ls.Count > 0) - // { - // var query = from arc in _ls - // group arc by new { arc.ErpMaterialCode } - // into g - // where g.Count() > 1 - - // select g; - // foreach (var itm in query) - // { - // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty)); - // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode)); - // } - // } - // foreach (var itm in _ls) - // { - // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode); - // if (_first != null) - // { - // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode); - // await _repository.UpdateAsync(_first); - // } - // else - // { - // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty)); - // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode)); - // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); - // //await _repository.InsertAsync(itm); - // } - // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); - - // } - // if (checkList.Count > 0) - // { - // return await ExportErrorReportAsync(checkList); - // } - - // return ApplicationConsts.SuccessStr; - //} - - - - ///// - ///// 导入功能 - ///// - ///// 上传的文件(前端已经限制只能上传一个附件) - ///// - //[HttpPost] - //[Route("ExcelImport")] - //[DisableRequestSizeLimit] - //public async Task MaterialRelationshipUploadExcelImport([FromForm] IFormFileCollection files) - //{ - - - // ExportImporter _exportImporter = new ExportImporter(); - // var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - // var _ls = ObjectMapper.Map, List>(result); - // List _errorList = new List(); - // var checkList = new List(); - - // if (_ls.Count > 0) - // { - // var query = from arc in _ls - // group arc by new { arc.ErpMaterialCode } - // into g - // where g.Count() > 1 - - // select g; - // foreach (var itm in query) - // { - // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}有重复", itm.Key.ErpMaterialCode), string.Empty)); - // // _errorList.Add(string.Format("ERP物料号{0}有重复",itm.Key.ErpMaterialCode)); - // } - // } - // foreach (var itm in _ls) - // { - // var _first = _repository.FirstOrDefault(p => p.ErpMaterialCode == itm.ErpMaterialCode); - // if (_first != null) - // { - // _first.Update(itm.MaterialDesc, itm.MaterialProperty, itm.SettleMaterialCode, itm.ShipMaterailCode); - // await _repository.UpdateAsync(_first); - // } - // else - // { - // checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode), string.Empty)); - // //_errorList.Add(string.Format("关系表中不存在ERP物料号{0}!", itm.ErpMaterialCode)); - // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); - // //await _repository.InsertAsync(itm); - // } - // //itm.SetId(GuidGenerator.Create(), GuidGenerator.Create()); - - // } - // if (checkList.Count > 0) - // { - // return await ExportErrorReportAsync(checkList); - // } - - // return ApplicationConsts.SuccessStr; - //} - - - - ///// - ///// 按ID获取唯一实体 - ///// - ///// - ///// 返回实体全部属性 - ///// - ///// ID - ///// 实体DTO - //[HttpGet] - //[Route("{id}")] - //virtual public async Task GetAsync(Guid id) - //{ - // var result = await GetFromCacheAsync(id); - // var dto = ObjectMapper.Map(result); - // return dto; - //} - - - //private async Task GetFromCacheAsync(Guid id) - //{ - // var result = await _repository.GetAsync(id); - - - // return result; - //} - - - //private async Task GetCountAsync(MaterialRelationshipRequestDto input) - //{ - // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); - //} - - - - - /////// - - ///// - ///// 根据筛选条件获取实体列表 - ///// - ///// - ///// 请求条件包括:筛选条件列表,排序条件,数据数量,页码 - ///// - ///// 请求条件 - ///// 实体DTO列表 - //[HttpPost] - //[Route("list")] - //virtual public async Task> GetListAsync(MaterialRelationshipRequestDto input) - //{ - // 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>(entities); - - // return new PagedResultDto(totalCount, dtos); - //} - - - ///// - ///// 获取实体总数 - ///// - ///// 实体总数 - //[HttpGet] - //[Route("count")] - //virtual public async Task GetTotalCountAsync(Guid branchId) - //{ - // return await _repository.GetCountAsync(branchId); - //} - - ///// - ///// 获取全部实体列表 - ///// - ///// 实体DTO列表 - //[HttpGet] - //[Route("all")] - //virtual public async Task> GetAllAsync(Guid branchId) - //{ - // var entities = await _repository.GetAllAsync(branchId, true); - - - // var dtos = ObjectMapper.Map, List>(entities); - - - // return new ListResultDto(dtos); - //} - - - - - ///// - ///// 新增实体 - ///// - ///// 新增实体DTO - ///// 实体DTO - - //[HttpPost] - //[Route("")] - //virtual public async Task CreateAsync(MaterialRelationshipCreateDto input) - //{ - - - // var _first = _repository.Where(p => p.ErpMaterialCode == input.ErpMaterialCode).FirstOrDefault(); - - // if (_first != null) - // { - // throw new BusinessException("001", "已经存数据请修改后创建"); - // } - - - // var entity = new MaterialRelationship( - // GuidGenerator.Create(), - // input.BranchId, - // input.ErpMaterialCode, - - // input.MaterialDesc, - // input.MaterialProperty, - // input.SettleMaterialCode, - // input.ShipMaterailCode, - // input.AppraisalCategory - - - // ); - - // await _repository.InsertAsync(entity); - - // ////create cache - // //await Cache.SetAsync(entity.Id.ToString(), entity, - // // CacheStrategyConst.FIVE_MINUTES); - - // var dto = ObjectMapper.Map(entity); - // return dto; - - //} - - ///// - ///// 修改实体 - ///// - ///// ID - ///// 修改实体DTO - ///// 实体DTO - //[HttpPut] - //[Route("{id}")] - //virtual public async Task UpdateAsync(Guid id, MaterialRelationshipUpdateDto input) - //{ - // var entity = await _repository.GetAsync(id); - // if (entity != null) - // { - // entity.Update(input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode); - - // await _repository.UpdateAsync(entity); - - - // var dto = ObjectMapper.Map(entity); - // return dto; - // } - // else - // { - // return null; - // } - - //} - - ///// - ///// 删除实体 - ///// - ///// ID - ///// - //[HttpDelete] - //[Route("{id}")] - //virtual public async Task DeleteAsync(Guid id) - //{ - // var entity = await GetFromCacheAsync(id); - // await Cache.DeleteAsync(id.ToString()); - // await _repository.DeleteAsync(id); - //} - - ///// - ///// 按IDs删除实体列表 - ///// - ///// IDs - ///// 是否执行成功 - //[HttpPost] - //[Route("delete")] - //virtual public async Task DeleteListAsync(List ids) - //{ - // var _query = _repository.Where(p => ids.Contains(p.Id)); - // int i = await _query.BatchDeleteAsync(); - - // if (i == 0) - // { - // return false; - // } - // return true; - //} - //[HttpPost] - //[Route("Export")] - //virtual public async Task ExportAsync(MaterialRelationshipRequestDto input) - //{ - // //var _userId = CurrentUser.Id.Value.ToString(); - // string _fileName = string.Format("零件关系_{0}.xlsx", Guid.NewGuid().ToString()); - // var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - // 0, true); - - // var dtoDetails = ObjectMapper.Map, List>(entities); - - // //声明导出容器 - // ExportImporter _exportImporter = new ExportImporter(); - - // var result = await _exportImporter.ExcelExporter(dtoDetails); - - // result.ShouldNotBeNull(); - - // //保存导出文件到服务器存成二进制 - // await _excelImportService.SaveBlobAsync( - // new SaveExcelImportInputDto - // { - // Name = _fileName, - // Content = result - // } - // ); - // return _fileName; - //} - #endregion - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs index bab519e5..b5465027 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/MaterialRelationships/MaterialRelationshipTHAppService.cs @@ -1,24 +1,19 @@ -using Magicodes.ExporterAndImporter.Core; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +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 Shouldly; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Services; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; 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.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.Filter; @@ -64,16 +59,14 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpGet] [Route("{id}")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - var result = await _mng.GetAsync(id); ; + var result = await _mng.GetAsync(id).ConfigureAwait(false); ; var dto = ObjectMapper.Map(result); return dto; } - - /// /// 导入功能 /// @@ -95,11 +88,9 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships customConditionList.Add(new CustomCondition() { Name = "Site", Value = "TH" }); var _taskid = await _service.ImportEnqueueAsync(files, "总成结算零件关系表", CurrentUser, typeof(SecRelationShipImportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; - - } /// @@ -113,7 +104,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpPost] [Route("list")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task> GetListAsync(MaterialRelationshipDetailRequestDto input) + public virtual async Task> GetListAsync(MaterialRelationshipDetailRequestDto input) { if (!string.IsNullOrEmpty(input.Version)) @@ -127,8 +118,8 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships } var entities = await _mng.GetListAsync(input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount); - var totalCount = await GetCountAsync(input); + input.SkipCount).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -144,24 +135,18 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpPost] [Route("versionlist")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task> GetVersionListAsync(MaterialRelationshipDetailRequestDto input) + public virtual async Task> GetVersionListAsync(MaterialRelationshipDetailRequestDto input) { - - var entities = await _mng.GetVersionListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await GetCountAsync(input); + var entities = await _mng.GetVersionListAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - - - - - private async Task GetCountAsync(MaterialRelationshipDetailRequestDto input) { - return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create()); + return await _mng.GetCountAsync(input.Filters, GuidGenerator.Create()).ConfigureAwait(false); } /// @@ -171,9 +156,9 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpGet] [Route("count")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _mng.GetCountAsync(new List(), branchId); + return await _mng.GetCountAsync(new List(), branchId).ConfigureAwait(false); } /// @@ -183,9 +168,9 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpGet] [Route("all")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _mng.GetAllAsync(branchId); + var entities = await _mng.GetAllAsync(branchId).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new ListResultDto(dtos); } @@ -236,12 +221,8 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships // return ApplicationConsts.SuccessStr; - //} - - - ///// ///// 修改实体 ///// @@ -259,7 +240,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships // var _ent = await _mng.UpdateAsync(id, entity); - // var dto = ObjectMapper.Map(_ent); // return dto; //} @@ -272,10 +252,10 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpDelete] [Route("{id}")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Delete)] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - await _mng.DeleteAsync(id); + await _mng.DeleteAsync(id).ConfigureAwait(false); } /// @@ -286,10 +266,10 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpPost] [Route("delete")] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { - return await _mng.DeleteListAsync(ids); + return await _mng.DeleteListAsync(ids).ConfigureAwait(false); } /// @@ -300,7 +280,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships [HttpPost] [Route("Export")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task ExportAsync(MaterialRelationshipDetailRequestDto input) + public virtual async Task ExportAsync(MaterialRelationshipDetailRequestDto input) { IExporter _csv = new CsvExporter(); @@ -319,19 +299,13 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships } var entities = await _mng.GetListAsync(input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); - - string _fileName = string.Empty; + var _fileName = string.Format("总成与结算件关系_{0}.xlsx", Guid.NewGuid().ToString()); //声明导出容器 - byte[] result = null; - - _fileName = string.Format("总成与结算件关系_{0}.xlsx",Guid.NewGuid().ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); - - + var result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制 @@ -341,11 +315,9 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs index 8b38a844..7b10299f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Materials/MaterialAppService.cs @@ -1,9 +1,9 @@ -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using Shouldly; -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Shouldly; using Volo.Abp.Application.Dtos; using Volo.Abp.Caching; using Win.Abp.Snowflakes; @@ -35,9 +35,9 @@ namespace Win.Sfs.SettleAccount.Entities.Materials IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, ICommonManager commonManager - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - _repository = repository; + _repository = repository; } #region 导入、导出 @@ -49,13 +49,13 @@ namespace Win.Sfs.SettleAccount.Entities.Materials { string _fileName = string.Format("物料主数据_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtoDetails); + var result = await _exportImporter.ExcelExporter(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -66,7 +66,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } #endregion @@ -76,11 +76,11 @@ namespace Win.Sfs.SettleAccount.Entities.Materials /// 获取列表 /// [HttpPost] - virtual public async Task> GetListAsync(MaterialRequestDto input) + public virtual async Task> GetListAsync(MaterialRequestDto input) { var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters); + input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -187,15 +187,12 @@ namespace Win.Sfs.SettleAccount.Entities.Materials // return checkList; //} - - //private async Task> UpdateMaterial(List result, string version) //{ // var _list = await _repository.GetAllAsync(GuidGenerator.Create()); // //var _relationshiplist = _relationshipRepository.GetAllAsync(GuidGenerator.Create()); - // List _errorList = new List(); // List _insertls = new List(); @@ -240,12 +237,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials // return _errorList; //} - - - - - - ///// ///// 导入功能 ///// @@ -299,8 +290,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials // return ApplicationConsts.SuccessStr; //} - - ///// ///// 按ID获取唯一实体 ///// @@ -315,13 +304,11 @@ namespace Win.Sfs.SettleAccount.Entities.Materials //virtual public async Task GetAsync(Guid id) //{ - // var result = await GetFromCacheAsync(id); // var dto = ObjectMapper.Map(result); // return dto; //} - //private async Task GetFromCacheAsync(Guid id) //{ // var result = await _repository.GetAsync(id); @@ -329,15 +316,11 @@ namespace Win.Sfs.SettleAccount.Entities.Materials // return result; //} - //private async Task GetCountAsync(MaterialRequestDto input) //{ // return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); //} - - - /////// ///// @@ -362,7 +345,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials // return new PagedResultDto(totalCount, dtos); //} - ///// ///// 获取实体总数 ///// @@ -386,16 +368,11 @@ namespace Win.Sfs.SettleAccount.Entities.Materials //{ // var entities = await _repository.GetAllAsync(branchId, true); - // var dtos = ObjectMapper.Map, List>(entities); - // return new ListResultDto(dtos); //} - - - ///// ///// 批量导入实体列表 ///// @@ -413,7 +390,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials //// var result = await _repository.ImportAsync(entities); - //// return result; ////} @@ -476,7 +452,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials // var dto = ObjectMapper.Map(entity); // return dto; - //} ///// @@ -543,9 +518,5 @@ namespace Win.Sfs.SettleAccount.Entities.Materials //} #endregion - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs index d5fd17e0..57897888 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prebatch/PrebatchAppService.cs @@ -1,34 +1,26 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using System.Threading.Tasks; -using EFCore.BulkExtensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using Microsoft.Data.SqlClient; 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.Boms; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.FISes; using Win.Sfs.Shared.CacheBase; using Win.Sfs.Shared.Enums.SettleAccount; -using Win.Utils; namespace Win.Sfs.SettleAccount.Prebatches { @@ -43,7 +35,6 @@ namespace Win.Sfs.SettleAccount.Prebatches public class PrebatchAppService : SettleAccountApplicationBase, IPrebatchAppService { - private readonly IExcelImportAppService _excelImportService; private readonly ISettleAccountBranchEfCoreRepository _repository; private readonly ISettleAccountBranchEfCoreRepository _fisRepository; @@ -65,7 +56,7 @@ namespace Win.Sfs.SettleAccount.Prebatches ICommonManager commonManager, ISettleAccountBranchEfCoreRepository fisRepository, ISettleAccountBranchEfCoreRepository extendRepository - ) : base(cache,excelImportService,snowflakeIdGenerator,commonManager) + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { _fisRepository = fisRepository; _extendRepository = extendRepository; @@ -73,19 +64,6 @@ namespace Win.Sfs.SettleAccount.Prebatches _excelImportService = excelImportService; } - private FIS SetFisState(FIS fis, EnumSettleStatus status) - { - fis.State = status; - return fis; - } - - private FISExtend SetFisExtendState(FISExtend fis, EnumSettleStatus status) - { - fis.State = status; - return fis; - } - - /// /// 导入功能 /// @@ -98,8 +76,7 @@ namespace Win.Sfs.SettleAccount.Prebatches public async Task PrebatchUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImport(files, _excelImportService); - + var result = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); List _ls1 = new List(); @@ -107,9 +84,9 @@ namespace Win.Sfs.SettleAccount.Prebatches foreach (var itm in result) { - var _first = await _repository.FirstOrDefaultAsync(p => p.KENNCode == itm.KENNCode && p.Year==itm.Year); - var _count=_ls1.Count(p => p.KENNCode == itm.KENNCode && p.Year == itm.Year); - if (_first == null || _count==0 ) + var _first = await _repository.FirstOrDefaultAsync(p => p.KENNCode == itm.KENNCode && p.Year == itm.Year).ConfigureAwait(false); + var _count = _ls1.Count(p => p.KENNCode == itm.KENNCode && p.Year == itm.Year); + if (_first == null || _count == 0) { var entity = new Prebatch( GuidGenerator.Create(), @@ -120,39 +97,34 @@ namespace Win.Sfs.SettleAccount.Prebatches itm.YearKennCode, itm.Year ); - await _repository.InsertAsync(entity); + await _repository.InsertAsync(entity).ConfigureAwait(false); _ls1.Add(entity); } else { - if (itm.State == 0) + if (itm.State == 0) { - var _fisList= _fisRepository.Where(p => p.KENNCode == itm.KENNCode &&p.Year==itm.Year &&p.State==EnumSettleStatus.预批量).ToList(); + var _fisList = _fisRepository.Where(p => p.KENNCode == itm.KENNCode && p.Year == itm.Year && p.State == EnumSettleStatus.预批量).ToList(); foreach (var fis in _fisList) { fis.State = EnumSettleStatus.未结算; - await _fisRepository.UpdateAsync(fis); + await _fisRepository.UpdateAsync(fis).ConfigureAwait(false); } - var _extendList= _extendRepository.Where(p => p.KENNCode == itm.KENNCode && p.Year == itm.Year && p.State == EnumSettleStatus.预批量).ToList(); + var _extendList = _extendRepository.Where(p => p.KENNCode == itm.KENNCode && p.Year == itm.Year && p.State == EnumSettleStatus.预批量).ToList(); foreach (var extend in _extendList) { extend.State = EnumSettleStatus.未结算; - await _extendRepository.UpdateAsync(extend); + await _extendRepository.UpdateAsync(extend).ConfigureAwait(false); } } - _first.Update(string.Empty, itm.State,itm.CarCode,itm.YearKennCode,itm.Year); - await _repository.UpdateAsync(_first); + _first.Update(string.Empty, itm.State, itm.CarCode, itm.YearKennCode, itm.Year); + await _repository.UpdateAsync(_first).ConfigureAwait(false); } } return ApplicationConsts.SuccessStr; } - - - - - /// /// 按ID获取唯一实体 /// @@ -163,32 +135,26 @@ namespace Win.Sfs.SettleAccount.Prebatches /// 实体DTO [HttpGet] [Route("{id}")] - //[Authorize(SettleAccountPermissions.Prebatchs.Default)] - virtual public async Task GetAsync(Guid id) + //[Authorize(SettleAccountPermissions.Prebatchs.Default)] + public virtual async Task GetAsync(Guid id) { - var result = await GetFromCacheAsync(id); + var result = await GetFromCacheAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); - + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } - private async Task GetCountAsync(PrebatchRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - - - ///// /// @@ -201,29 +167,28 @@ namespace Win.Sfs.SettleAccount.Prebatches /// 实体DTO列表 [HttpPost] [Route("list")] - //[Authorize(SettleAccountPermissions.Prebatchs.Default)] - virtual public async Task> GetListAsync(PrebatchRequestDto input) + //[Authorize(SettleAccountPermissions.Prebatchs.Default)] + public virtual async Task> GetListAsync(PrebatchRequestDto input) { var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - /// /// 获取实体总数 /// /// 实体总数 [HttpGet] [Route("count")] - ///[Authorize(SettleAccountPermissions.Prebatchs.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + ///[Authorize(SettleAccountPermissions.Prebatchs.Default)] + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } /// @@ -232,26 +197,22 @@ namespace Win.Sfs.SettleAccount.Prebatches /// 实体DTO列表 [HttpGet] [Route("all")] - //[Authorize(SettleAccountPermissions.Prebatchs.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + //[Authorize(SettleAccountPermissions.Prebatchs.Default)] + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId, true); - + var entities = await _repository.GetAllAsync(branchId, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); } - - [HttpPost] [Route("")] - //[Authorize(SettleAccountPermissions.Prebatchs.Create)] - virtual public async Task CreateAsync(PrebatchCreateDto input) + //[Authorize(SettleAccountPermissions.Prebatchs.Create)] + public virtual async Task CreateAsync(PrebatchCreateDto input) { - var _first = await _repository.FirstOrDefaultAsync(p => p.KENNCode == input.KENNCode); + var _first = await _repository.FirstOrDefaultAsync(p => p.KENNCode == input.KENNCode).ConfigureAwait(false); if (_first != null) { throw new BusinessException("8989", "已经存在该KENEN号数据!"); @@ -266,7 +227,7 @@ namespace Win.Sfs.SettleAccount.Prebatches input.Year ); - await _repository.InsertAsync(entity); + await _repository.InsertAsync(entity).ConfigureAwait(false); //create cache //await Cache.SetAsync(entity.Id.ToString(), entity,CacheStrategyConst.FIVE_MINUTES); @@ -284,12 +245,12 @@ namespace Win.Sfs.SettleAccount.Prebatches /// 实体DTO [HttpPut] [Route("{id}")] - //[Authorize(SettleAccountPermissions.Prebatchs.Update)] - virtual public async Task UpdateAsync(Guid id, PrebatchUpdateDto input) + //[Authorize(SettleAccountPermissions.Prebatchs.Update)] + public virtual async Task UpdateAsync(Guid id, PrebatchUpdateDto input) { - var entity = await _repository.GetAsync(id); - entity.Update(input.Remark,input.State,input.CarCode,input.YearKennCode,input.Year); - await _repository.UpdateAsync(entity); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); + entity.Update(input.Remark, input.State, input.CarCode, input.YearKennCode, input.Year); + await _repository.UpdateAsync(entity).ConfigureAwait(false); //update cache //await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); var dto = ObjectMapper.Map(entity); @@ -303,12 +264,12 @@ namespace Win.Sfs.SettleAccount.Prebatches /// [HttpDelete] [Route("{id}")] - //[Authorize(SettleAccountPermissions.Prebatchs.Delete)] - virtual public async Task DeleteAsync(Guid id) + //[Authorize(SettleAccountPermissions.Prebatchs.Delete)] + public virtual async Task DeleteAsync(Guid id) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -318,44 +279,44 @@ namespace Win.Sfs.SettleAccount.Prebatches /// 是否执行成功 [HttpPost] [Route("delete")] - //[Authorize(SettleAccountPermissions.Prebatchs.Delete)] - virtual public async Task DeleteListAsync(List ids) + //[Authorize(SettleAccountPermissions.Prebatchs.Delete)] + public virtual async Task DeleteListAsync(List ids) { foreach (var id in ids) { - var _first = await _repository.GetAsync(id); + var _first = await _repository.GetAsync(id).ConfigureAwait(false); var _fisList = _fisRepository.Where(p => p.KENNCode == _first.KENNCode && p.State == EnumSettleStatus.预批量).ToList(); foreach (var fis in _fisList) { fis.State = EnumSettleStatus.未结算; - await _fisRepository.UpdateAsync(fis); + await _fisRepository.UpdateAsync(fis).ConfigureAwait(false); } var _extendList = _extendRepository.Where(p => p.KENNCode == _first.KENNCode && p.State == EnumSettleStatus.预批量).ToList(); foreach (var extend in _extendList) { extend.State = EnumSettleStatus.未结算; - await _extendRepository.UpdateAsync(extend); + await _extendRepository.UpdateAsync(extend).ConfigureAwait(false); } _first.Update(string.Empty, 0, _first.CarCode, _first.YearKennCode, _first.Year); - await _repository.UpdateAsync(_first); + await _repository.UpdateAsync(_first).ConfigureAwait(false); } return true; } [HttpPost] [Route("Export")] - //[Authorize(SettleAccountPermissions.Prebatchs.Default)] - virtual public async Task ExportAsync(PrebatchRequestDto input) + //[Authorize(SettleAccountPermissions.Prebatchs.Default)] + public virtual async Task ExportAsync(PrebatchRequestDto input) { string _fileName = string.Format("预批量_{0}.xlsx", DateTime.Now.ToString("yyyyMMdd")); var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtoDetails); + var result = await _exportImporter.ExcelExporter(dtoDetails).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -366,7 +327,7 @@ namespace Win.Sfs.SettleAccount.Prebatches Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs index 5930002b..e3cb870e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppService.cs @@ -18,260 +18,259 @@ using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; -using Win.Sfs.SettleAccount.Entities.Factories; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.Prices; - -/// -/// 销售价格单 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class PriceListAppService : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.Prices { /// - /// DbContext - /// - private readonly SettleAccountDbContext _settleAccountDbContext; - /// - /// 销售价格仓储 + /// 销售价格单 /// - private readonly INormalEfCoreRepository _priceListRepository; - - public PriceListAppService( - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository priceListRepository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class PriceListAppService : SettleAccountApplicationBase { - _settleAccountDbContext = settleAccountDbContext; - _priceListRepository = priceListRepository; - } + /// + /// DbContext + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + /// + /// 销售价格仓储 + /// + private readonly INormalEfCoreRepository _priceListRepository; + + public PriceListAppService( + SettleAccountDbContext settleAccountDbContext, + INormalEfCoreRepository priceListRepository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _settleAccountDbContext = settleAccountDbContext; + _priceListRepository = priceListRepository; + } - #region 导入、导出 - ///// - ///// 获取导入模板 - ///// - //[HttpPost("import-template")] - //public virtual async Task ImportTemplateAsync() - //{ - // await Task.CompletedTask; - // return new Microsoft.AspNetCore.Mvc.OkResult(); - //} + #region 导入、导出 + ///// + ///// 获取导入模板 + ///// + //[HttpPost("import-template")] + //public virtual async Task ImportTemplateAsync() + //{ + // await Task.CompletedTask; + // return new Microsoft.AspNetCore.Mvc.OkResult(); + //} - /// - /// 导入 - /// - [HttpPost] - public virtual async Task ImportAsync([FromForm] IFormFileCollection files, string version) - { - var checkList = new List(); - var _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService).ConfigureAwait(false); - var filter = new List + /// + /// 导入 + /// + [HttpPost] + public virtual async Task ImportAsync([FromForm] IFormFileCollection files, string version) + { + var checkList = new List(); + var _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService).ConfigureAwait(false); + var filter = new List { "1040", "1046", "104T" }; - result = result.FindAll(p => filter.Contains(p.Plant)).ToList(); - result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); - var newPrice = ObjectMapper.Map, List>(result); - newPrice = newPrice.GroupBy(p => new { p.Date, p.ClientCode, p.LU, p.BeginTime, p.EndTime }).Select(p => p.FirstOrDefault()).ToList(); + result = result.FindAll(p => filter.Contains(p.Plant)).ToList(); + result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); + var newPrice = ObjectMapper.Map, List>(result); + newPrice = newPrice.GroupBy(p => new { p.Date, p.ClientCode, p.LU, p.BeginTime, p.EndTime }).Select(p => p.FirstOrDefault()).ToList(); - #region 校验 - if (newPrice.Any()) - { - var query = from item1 in newPrice - join item2 in newPrice - on new { item1.Date, item1.ClientCode, item1.LU } equals new { item2.Date, item2.ClientCode, item2.LU } - where (item1.BeginTime > item2.BeginTime && item1.EndTime < item2.EndTime) || (item2.BeginTime > item1.BeginTime && item2.EndTime < item1.EndTime) || (item1.BeginTime == item2.BeginTime && item1.EndTime != item2.EndTime) || (item1.BeginTime != item2.BeginTime && item1.EndTime == item2.EndTime) - select item1; - var repeat = query.Distinct().ToList(); - foreach (var item in repeat) + #region 校验 + if (newPrice.Any()) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间存在交集", string.Empty)); - } + var query = from item1 in newPrice + join item2 in newPrice + on new { item1.Date, item1.ClientCode, item1.LU } equals new { item2.Date, item2.ClientCode, item2.LU } + where (item1.BeginTime > item2.BeginTime && item1.EndTime < item2.EndTime) || (item2.BeginTime > item1.BeginTime && item2.EndTime < item1.EndTime) || (item1.BeginTime == item2.BeginTime && item1.EndTime != item2.EndTime) || (item1.BeginTime != item2.BeginTime && item1.EndTime == item2.EndTime) + select item1; + var repeat = query.Distinct().ToList(); + foreach (var item in repeat) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间存在交集", string.Empty)); + } - foreach (var item in CheckPriceListContinuity(newPrice)) + foreach (var item in CheckPriceListContinuity(newPrice)) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间【{item.BeginTime:yyyy-MM-dd}至{item.EndTime:yyyy-MM-dd}】不连续", string.Empty)); + } + } + if (checkList.Count > 0) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间【{item.BeginTime:yyyy-MM-dd}至{item.EndTime:yyyy-MM-dd}】不连续", string.Empty)); + var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); } - } - if (checkList.Count > 0) - { - var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); - } - #endregion + #endregion - newPrice.ForEach(t => t.IsCancel = true); - newPrice.GroupBy(t => new { t.ClientCode, t.LU }) - .SelectMany(t => - { - var data = t.OrderByDescending(t => t.Date).First().Date; - return t.Where(t => t.Date == data); - }) - .ForEach(t => t.IsCancel = false); + newPrice.ForEach(t => t.IsCancel = true); + newPrice.GroupBy(t => new { t.ClientCode, t.LU }) + .SelectMany(t => + { + var data = t.OrderByDescending(t => t.Date).First().Date; + return t.Where(t => t.Date == data); + }) + .ForEach(t => t.IsCancel = false); - var importLus = newPrice.Select(t => t.LU).Distinct().ToList(); - var oldPrices = _settleAccountDbContext.Set() - .Where(t => t.IsCancel == false) - .Where(t => importLus.Contains(t.LU)) - .ToList(); - //系统中合同日期比导入文件中的合同日期晚 - var oldPriceNewDate = from oldPriceItem in oldPrices - from newPriceItem in newPrice.FindAll(t => t.IsCancel == false) - where oldPriceItem.ClientCode == newPriceItem.ClientCode && oldPriceItem.LU == newPriceItem.LU && oldPriceItem.Date > newPriceItem.Date - select new { oldPriceItem, newPriceItem }; - oldPrices.ForEach(t => t.IsCancel = true); - if (oldPriceNewDate.Any()) - { - oldPrices.FindAll(t => t.IsCancel == true && oldPriceNewDate.Select(t => t.oldPriceItem).Contains(t)).ForEach(t => t.IsCancel = false); - newPrice.FindAll(t => t.IsCancel == false && oldPriceNewDate.Select(t => t.newPriceItem).Contains(t)).ForEach(t => t.IsCancel = true); - } - foreach (var item in newPrice) - { - item.Update(GuidGenerator.Create()); - } - using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); - await _settleAccountDbContext.BulkInsertAsync(newPrice).ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - return new JsonResult(new { Code = 200, Message = "导入失败" }); + var importLus = newPrice.Select(t => t.LU).Distinct().ToList(); + var oldPrices = _settleAccountDbContext.Set() + .Where(t => t.IsCancel == false) + .Where(t => importLus.Contains(t.LU)) + .ToList(); + //系统中合同日期比导入文件中的合同日期晚 + var oldPriceNewDate = from oldPriceItem in oldPrices + from newPriceItem in newPrice.FindAll(t => t.IsCancel == false) + where oldPriceItem.ClientCode == newPriceItem.ClientCode && oldPriceItem.LU == newPriceItem.LU && oldPriceItem.Date > newPriceItem.Date + select new { oldPriceItem, newPriceItem }; + oldPrices.ForEach(t => t.IsCancel = true); + if (oldPriceNewDate.Any()) + { + oldPrices.FindAll(t => t.IsCancel == true && oldPriceNewDate.Select(t => t.oldPriceItem).Contains(t)).ForEach(t => t.IsCancel = false); + newPrice.FindAll(t => t.IsCancel == false && oldPriceNewDate.Select(t => t.newPriceItem).Contains(t)).ForEach(t => t.IsCancel = true); + } + foreach (var item in newPrice) + { + item.Update(GuidGenerator.Create()); + } + using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); + try + { + await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(newPrice).ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + return new JsonResult(new { Code = 200, Message = "导入失败" }); + } + return new JsonResult(new { Code = 200, Message = "导入成功" }); } - return new JsonResult(new { Code = 200, Message = "导入成功" }); - } - /// - /// 价格表时间是否连续 - /// - private List CheckPriceListContinuity(List priceList) - { - var result = new List(); - if (priceList.Count <= 1) + /// + /// 价格表时间是否连续 + /// + private List CheckPriceListContinuity(List priceList) { - return result; // 只有一个或零个价格条目 - } + var result = new List(); + if (priceList.Count <= 1) + { + return result; // 只有一个或零个价格条目 + } - var dateGroups = priceList.GroupBy(t => t.Date); - foreach (var dateGroup in dateGroups) - { - var clientCodeGroups = dateGroup.GroupBy(t => t.ClientCode); - foreach (var clientCodeGroup in clientCodeGroups) + var dateGroups = priceList.GroupBy(t => t.Date); + foreach (var dateGroup in dateGroups) { - if (clientCodeGroup.ToList().Count <= 1) + var clientCodeGroups = dateGroup.GroupBy(t => t.ClientCode); + foreach (var clientCodeGroup in clientCodeGroups) { - continue; - } - var sortedList = clientCodeGroup.OrderBy(t => t.LU).ThenBy(t => t.BeginTime).ToList(); - for (var i = 1; i < sortedList.Count; i++) - { - if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) + if (clientCodeGroup.ToList().Count <= 1) + { + continue; + } + var sortedList = clientCodeGroup.OrderBy(t => t.LU).ThenBy(t => t.BeginTime).ToList(); + for (var i = 1; i < sortedList.Count; i++) { - result.Add(sortedList[i]); + if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) + { + result.Add(sortedList[i]); + } } } } - } - - return result; // 所有价格时间都连续 - } - /// - /// 导出 - /// - [HttpPost] - public virtual async Task ExportAsync(RequestDto input) - { - IExporter _excel = new ExcelExporter(); - var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); - var dtoDetails = ObjectMapper.Map, List>(entities); - string fileName = string.Format("销售价格单_{0}.xlsx", Guid.NewGuid().ToString()); - byte[] result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); - result.ShouldNotBeNull(); + return result; // 所有价格时间都连续 + } - //保存导出文件到服务器存成二进制 - await _excelImportService.SaveBlobAsync( - new SaveExcelImportInputDto - { - Name = fileName, - Content = result - } - ).ConfigureAwait(false); - return fileName; - } - #endregion + /// + /// 导出 + /// + [HttpPost] + public virtual async Task ExportAsync(RequestDto input) + { + IExporter _excel = new ExcelExporter(); + var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtoDetails = ObjectMapper.Map, List>(entities); + string fileName = string.Format("销售价格单_{0}.xlsx", Guid.NewGuid().ToString()); + byte[] result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); + result.ShouldNotBeNull(); - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _priceListRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } + //保存导出文件到服务器存成二进制 + await _excelImportService.SaveBlobAsync( + new SaveExcelImportInputDto + { + Name = fileName, + Content = result + } + ).ConfigureAwait(false); + return fileName; + } + #endregion - /// - /// 删除 - /// - [HttpPost] - public async Task DeleteAsync(Guid id) - { - await _priceListRepository.DeleteAsync(id).ConfigureAwait(false); - } + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) + { + var entities = await _priceListRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _priceListRepository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } - /// - /// 批量删除 - /// - [HttpPost] - public async Task DeleteListAsync(List ids) - { - return await _priceListRepository.DeleteListAsync(ids).ConfigureAwait(false); - } + /// + /// 删除 + /// + [HttpPost] + public async Task DeleteAsync(Guid id) + { + await _priceListRepository.DeleteAsync(id).ConfigureAwait(false); + } - /// - /// 修改实体 - /// - [HttpPost] - public async Task UpdateAsync(PriceListUpdateDto input) - { - var entity = await _settleAccountDbContext.Set().FindAsync(input.Id).ConfigureAwait(false); - entity.IsCancel = input.IsCancel; - if (entity.IsCancel == false) + /// + /// 批量删除 + /// + [HttpPost] + public async Task DeleteListAsync(List ids) { - var existPriceList = _settleAccountDbContext.Set() - .Where(t => t.LU == entity.LU) - .Where(t => t.IsCancel == false) - .Where(t => t.Id != entity.Id) - .ToList(); + return await _priceListRepository.DeleteListAsync(ids).ConfigureAwait(false); + } - var existPrice = existPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); - if (existPrice != null) + /// + /// 修改实体 + /// + [HttpPost] + public async Task UpdateAsync(PriceListUpdateDto input) + { + var entity = await _settleAccountDbContext.Set().FindAsync(input.Id).ConfigureAwait(false); + entity.IsCancel = input.IsCancel; + if (entity.IsCancel == false) { - throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPrice.BeginTime:yyyy-MM-dd}至{existPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); + var existPriceList = _settleAccountDbContext.Set() + .Where(t => t.LU == entity.LU) + .Where(t => t.IsCancel == false) + .Where(t => t.Id != entity.Id) + .ToList(); + + var existPrice = existPriceList.Find(t => (entity.BeginTime >= t.BeginTime && entity.BeginTime < t.EndTime) || (t.BeginTime >= entity.BeginTime && t.BeginTime < entity.EndTime)); + if (existPrice != null) + { + throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPrice.BeginTime:yyyy-MM-dd}至{existPrice.EndTime:yyyy-MM-dd}】存在交集", "400"); + } } + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + var dto = ObjectMapper.Map(entity); + return dto; } - await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); - var dto = ObjectMapper.Map(entity); - return dto; + #endregion } - #endregion } - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs index d274e04e..db748b59 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/Prices/PriceListAppServiceBJ.cs @@ -19,217 +19,217 @@ using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.Prices; - -/// -/// 备件价格 -/// -[AllowAnonymous] -[Route("api/settleaccount/[controller]/[action]")] -public class PriceListAppServiceBJ : SettleAccountApplicationBase +namespace Win.Sfs.SettleAccount.Entities.Prices { /// - /// 数据上下文 + /// 备件价格 /// - private readonly SettleAccountDbContext _settleAccountDbContext; - private readonly INormalEfCoreRepository _repository; - - public PriceListAppServiceBJ( - SettleAccountDbContext settleAccountDbContext, - INormalEfCoreRepository repository, - IDistributedCache cache, - IExcelImportAppService excelImportService, - ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager - ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + [AllowAnonymous] + [Route("api/settleaccount/[controller]/[action]")] + public class PriceListAppServiceBJ : SettleAccountApplicationBase { - _settleAccountDbContext = settleAccountDbContext; - _repository = repository; - } + /// + /// 数据上下文 + /// + private readonly SettleAccountDbContext _settleAccountDbContext; + private readonly INormalEfCoreRepository _repository; + + public PriceListAppServiceBJ( + SettleAccountDbContext settleAccountDbContext, + INormalEfCoreRepository repository, + IDistributedCache cache, + IExcelImportAppService excelImportService, + ISnowflakeIdGenerator snowflakeIdGenerator, + ICommonManager commonManager + ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) + { + _settleAccountDbContext = settleAccountDbContext; + _repository = repository; + } - #region 导入、导出 - /// - /// 导入 - /// - [HttpPost] - public async Task ImportAsync([FromForm] IFormFileCollection files, string version) - { - var checkList = new List(); - var _exportImporter = new ExportImporter(); - var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService).ConfigureAwait(false); - var filter = new List + #region 导入、导出 + /// + /// 导入 + /// + [HttpPost] + public async Task ImportAsync([FromForm] IFormFileCollection files, string version) + { + var checkList = new List(); + var _exportImporter = new ExportImporter(); + var result = await _exportImporter.UploadExcelImportByHeadDesc(files, _excelImportService).ConfigureAwait(false); + var filter = new List { "1049" }; - result = result.Where(p => filter.Contains(p.Plant)).ToList(); - result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); - var newPrice = ObjectMapper.Map, List>(result); - newPrice = newPrice.GroupBy(p => new { p.Date, p.ClientCode, p.LU, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList(); + result = result.Where(p => filter.Contains(p.Plant)).ToList(); + result.FindAll(t => !string.IsNullOrEmpty(t.ES1) || !string.IsNullOrEmpty(t.ES2)).ForEach(t => t.PartNo = t.PartNo + new string(' ', 6) + t.ES1 + t.ES2); + var newPrice = ObjectMapper.Map, List>(result); + newPrice = newPrice.GroupBy(p => new { p.Date, p.ClientCode, p.LU, p.BeginDate, p.EndDate }).Select(p => p.FirstOrDefault()).ToList(); - #region 校验 - if (newPrice.Any()) - { - var query = from item1 in newPrice - join item2 in newPrice - on new { item1.Date, item1.ClientCode, item1.LU } equals new { item2.Date, item2.ClientCode, item2.LU } - where (item1.BeginDate > item2.BeginDate && item1.EndDate < item2.EndDate) || (item2.BeginDate > item1.BeginDate && item2.EndDate < item1.EndDate) || (item1.BeginDate == item2.BeginDate && item1.EndDate != item2.EndDate) || (item1.BeginDate != item2.BeginDate && item1.EndDate == item2.EndDate) - select item1; - var repeat = query.Distinct().ToList(); - foreach (var item in repeat) + #region 校验 + if (newPrice.Any()) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间存在交集", string.Empty)); - } + var query = from item1 in newPrice + join item2 in newPrice + on new { item1.Date, item1.ClientCode, item1.LU } equals new { item2.Date, item2.ClientCode, item2.LU } + where (item1.BeginDate > item2.BeginDate && item1.EndDate < item2.EndDate) || (item2.BeginDate > item1.BeginDate && item2.EndDate < item1.EndDate) || (item1.BeginDate == item2.BeginDate && item1.EndDate != item2.EndDate) || (item1.BeginDate != item2.BeginDate && item1.EndDate == item2.EndDate) + select item1; + var repeat = query.Distinct().ToList(); + foreach (var item in repeat) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间存在交集", string.Empty)); + } - foreach (var item in CheckPriceListContinuity(newPrice)) + foreach (var item in CheckPriceListContinuity(newPrice)) + { + checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间【{item.BeginDate:yyyy-MM-dd}至{item.EndDate:yyyy-MM-dd}】不连续", string.Empty)); + } + } + if (checkList.Count > 0) { - checkList.Add(new ErrorExportDto(string.Empty, string.Empty, string.Empty, string.Empty, item.LU, string.Empty, $"合同号:{item.ContractNo},合同签订时间:{item.Date:yyyy-MM-dd},时间区间【{item.BeginDate:yyyy-MM-dd}至{item.EndDate:yyyy-MM-dd}】不连续", string.Empty)); + var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); + return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); } - } - if (checkList.Count > 0) - { - var fileName = await ExportErrorReportAsync(checkList).ConfigureAwait(false); - return new JsonResult(new { code = ApplicationConsts.ImportFailCode, message = "导入失败", fileName }); - } - #endregion + #endregion - newPrice.ForEach(t => t.IsCancel = true); - newPrice.GroupBy(t => new { t.ClientCode, t.LU }) - .SelectMany(t => - { - var data = t.OrderByDescending(t => t.Date).First().Date; - return t.Where(t => t.Date == data); - }) - .ForEach(t => t.IsCancel = false); - - var importLus = newPrice.Select(t => t.LU).Distinct().ToList(); - var oldPrices = _settleAccountDbContext.Set() - .Where(t => t.IsCancel == false) - .Where(t => importLus.Contains(t.LU)) - .ToList(); - //系统中合同日期比导入文件中的合同日期晚 - var oldPriceNewDate = from oldPriceItem in oldPrices - from newPriceItem in newPrice.FindAll(t => t.IsCancel == false) - where oldPriceItem.ClientCode == newPriceItem.ClientCode && oldPriceItem.LU == newPriceItem.LU && oldPriceItem.Date > newPriceItem.Date - select new { oldPriceItem, newPriceItem }; - oldPrices.ForEach(t => t.IsCancel = true); - if (oldPriceNewDate.Any()) - { - oldPrices.FindAll(t => t.IsCancel == true && oldPriceNewDate.Select(t => t.oldPriceItem).Contains(t)).ForEach(t => t.IsCancel = false); - newPrice.FindAll(t => t.IsCancel == false && oldPriceNewDate.Select(t => t.newPriceItem).Contains(t)).ForEach(t => t.IsCancel = true); - } - foreach (var item in newPrice) - { - item.Update(GuidGenerator.Create()); - } - using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); - try - { - await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); - await _settleAccountDbContext.BulkInsertAsync(newPrice).ConfigureAwait(false); - await transaction.CommitAsync().ConfigureAwait(false); - } - catch (Exception) - { - await transaction.RollbackAsync().ConfigureAwait(false); - return new JsonResult(new { Code = 200, Message = "导入失败" }); - } - return new JsonResult(new { Code = 200, Message = "导入成功" }); + newPrice.ForEach(t => t.IsCancel = true); + newPrice.GroupBy(t => new { t.ClientCode, t.LU }) + .SelectMany(t => + { + var data = t.OrderByDescending(t => t.Date).First().Date; + return t.Where(t => t.Date == data); + }) + .ForEach(t => t.IsCancel = false); - } + var importLus = newPrice.Select(t => t.LU).Distinct().ToList(); + var oldPrices = _settleAccountDbContext.Set() + .Where(t => t.IsCancel == false) + .Where(t => importLus.Contains(t.LU)) + .ToList(); + //系统中合同日期比导入文件中的合同日期晚 + var oldPriceNewDate = from oldPriceItem in oldPrices + from newPriceItem in newPrice.FindAll(t => t.IsCancel == false) + where oldPriceItem.ClientCode == newPriceItem.ClientCode && oldPriceItem.LU == newPriceItem.LU && oldPriceItem.Date > newPriceItem.Date + select new { oldPriceItem, newPriceItem }; + oldPrices.ForEach(t => t.IsCancel = true); + if (oldPriceNewDate.Any()) + { + oldPrices.FindAll(t => t.IsCancel == true && oldPriceNewDate.Select(t => t.oldPriceItem).Contains(t)).ForEach(t => t.IsCancel = false); + newPrice.FindAll(t => t.IsCancel == false && oldPriceNewDate.Select(t => t.newPriceItem).Contains(t)).ForEach(t => t.IsCancel = true); + } + foreach (var item in newPrice) + { + item.Update(GuidGenerator.Create()); + } + using var transaction = await _settleAccountDbContext.Database.BeginTransactionAsync().ConfigureAwait(false); + try + { + await _settleAccountDbContext.BulkUpdateAsync(oldPrices).ConfigureAwait(false); + await _settleAccountDbContext.BulkInsertAsync(newPrice).ConfigureAwait(false); + await transaction.CommitAsync().ConfigureAwait(false); + } + catch (Exception) + { + await transaction.RollbackAsync().ConfigureAwait(false); + return new JsonResult(new { Code = 200, Message = "导入失败" }); + } + return new JsonResult(new { Code = 200, Message = "导入成功" }); - /// - /// 价格表时间是否连续 - /// - private List CheckPriceListContinuity(List priceList) - { - var result = new List(); - if (priceList.Count <= 1) - { - return result; // 只有一个或零个价格条目 } - var dateGroups = priceList.GroupBy(t => t.Date); - foreach (var dateGroup in dateGroups) + /// + /// 价格表时间是否连续 + /// + private List CheckPriceListContinuity(List priceList) { - var clientCodeGroups = dateGroup.GroupBy(t => t.ClientCode); - foreach (var clientCodeGroup in clientCodeGroups) + var result = new List(); + if (priceList.Count <= 1) { - if (clientCodeGroup.ToList().Count <= 1) - { - continue; - } - var sortedList = clientCodeGroup.OrderBy(t => t.LU).ThenBy(t => t.BeginDate).ToList(); - for (var i = 1; i < sortedList.Count; i++) + return result; // 只有一个或零个价格条目 + } + + var dateGroups = priceList.GroupBy(t => t.Date); + foreach (var dateGroup in dateGroups) + { + var clientCodeGroups = dateGroup.GroupBy(t => t.ClientCode); + foreach (var clientCodeGroup in clientCodeGroups) { - if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1)) + if (clientCodeGroup.ToList().Count <= 1) { - result.Add(sortedList[i]); + continue; + } + var sortedList = clientCodeGroup.OrderBy(t => t.LU).ThenBy(t => t.BeginDate).ToList(); + for (var i = 1; i < sortedList.Count; i++) + { + if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginDate != sortedList[i - 1].EndDate.AddDays(1)) + { + result.Add(sortedList[i]); + } } } } - } - - return result; // 所有价格时间都连续 - } - /// - /// 导出 - /// - [HttpPost] - public async Task ExportAsync(RequestDto input) - { - string fileName = $"备件价格_{Guid.NewGuid()}.xlsx"; - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true); - var dtos = ObjectMapper.Map, List>(entities); + return result; // 所有价格时间都连续 + } - ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(dtos); - result.ShouldNotBeNull(); + /// + /// 导出 + /// + [HttpPost] + public async Task ExportAsync(RequestDto input) + { + string fileName = $"备件价格_{Guid.NewGuid()}.xlsx"; + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }); - return fileName; - } - #endregion + ExportImporter _exportImporter = new ExportImporter(); + var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); - #region CURD - /// - /// 获取列表 - /// - [HttpPost] - public async Task> GetListAsync(RequestDto input) - { - var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); - var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); - var dtos = ObjectMapper.Map, List>(entities); - return new PagedResultDto(totalCount, dtos); - } + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + return fileName; + } + #endregion - /// - /// 修改实体 - /// - [HttpPost] - public async Task UpdateAsync(PriceListBJUpdateDto input) - { - var entity = await _settleAccountDbContext.Set().FindAsync(input.Id).ConfigureAwait(false); - entity.IsCancel = input.IsCancel; - if (entity.IsCancel == false) + #region CURD + /// + /// 获取列表 + /// + [HttpPost] + public async Task> GetListAsync(RequestDto input) { - var existPriceBjList = _settleAccountDbContext.Set() - .Where(t => t.LU == entity.LU) - .Where(t => t.IsCancel == false) - .Where(t => t.Id != entity.Id) - .ToList(); + var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount, true).ConfigureAwait(false); + var totalCount = await _repository.GetCountByFilterAsync(input.Filters).ConfigureAwait(false); + var dtos = ObjectMapper.Map, List>(entities); + return new PagedResultDto(totalCount, dtos); + } - var existPriceBj = existPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); - if (existPriceBj != null) + /// + /// 修改实体 + /// + [HttpPost] + public async Task UpdateAsync(PriceListBJUpdateDto input) + { + var entity = await _settleAccountDbContext.Set().FindAsync(input.Id).ConfigureAwait(false); + entity.IsCancel = input.IsCancel; + if (entity.IsCancel == false) { - throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPriceBj.BeginDate:yyyy-MM-dd}至{existPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); + var existPriceBjList = _settleAccountDbContext.Set() + .Where(t => t.LU == entity.LU) + .Where(t => t.IsCancel == false) + .Where(t => t.Id != entity.Id) + .ToList(); + + var existPriceBj = existPriceBjList.Find(t => (entity.BeginDate >= t.BeginDate && entity.BeginDate < t.EndDate) || (t.BeginDate >= entity.BeginDate && t.BeginDate < entity.EndDate)); + if (existPriceBj != null) + { + throw new UserFriendlyException($"无法启用!此记录启用时间区间与区间【{existPriceBj.BeginDate:yyyy-MM-dd}至{existPriceBj.EndDate:yyyy-MM-dd}】存在交集", "400"); + } } + await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); + var dto = ObjectMapper.Map(entity); + return dto; } - await _settleAccountDbContext.SaveChangesAsync().ConfigureAwait(false); - var dto = ObjectMapper.Map(entity); - return dto; + #endregion } - #endregion } - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs index 839dd426..b93b5b68 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SecMatch/SecMatchAppService.cs @@ -1,32 +1,24 @@ -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 NPOI.XSSF.UserModel; -using Shouldly; using System; using System.Collections.Generic; using System.IO; using System.IO.Compression; using System.Linq; -using System.Text; using System.Threading.Tasks; -using TaskJob.EventArgs; -using TaskJob.Services; +using EFCore.BulkExtensions; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Csv; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using NPOI.XSSF.UserModel; using Volo.Abp; 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.SettleAccount.ImportExcelCommon; -using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.Reports.SecMatch; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.Shared.Filter; @@ -39,7 +31,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [ApiExplorerSettings(IgnoreApi = true)] [AllowAnonymous] - [Route("api/settleaccount/SecMatch")] public class SecMatchAppService : ApplicationService { @@ -86,16 +77,14 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpGet] [Route("{id}")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - var result = await _repository.GetAsync(id); ; + var result = await _repository.GetAsync(id).ConfigureAwait(false); ; var dto = ObjectMapper.Map(result); return dto; } - - /// /// 导入功能 /// @@ -131,14 +120,14 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpPost] [Route("list")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task> GetListAsync(SecMatchBaseRequestDto input) + public virtual async Task> GetListAsync(SecMatchBaseRequestDto input) { if (!string.IsNullOrEmpty(input.Version)) { input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); } - var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await GetCountAsync(input); + var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } @@ -154,16 +143,16 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpPost] [Route("versionlist")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task> GetVersionListAsync(SecMatchBaseRequestDto input) + public virtual async Task> GetVersionListAsync(SecMatchBaseRequestDto input) { - var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount); - var totalCount = await GetCountAsync(input); + var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); return entities.Select(p => p.Version).Distinct().ToList(); } private async Task GetCountAsync(SecMatchBaseRequestDto input) { - return await _repository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters); + return await _repository.GetCountByFilterAsync(GuidGenerator.Create(), input.Filters).ConfigureAwait(false); } /// @@ -173,9 +162,9 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpGet] [Route("count")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountByFilterAsync(branchId, new List()); + return await _repository.GetCountByFilterAsync(branchId, new List()).ConfigureAwait(false); } /// @@ -185,9 +174,9 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpGet] [Route("all")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId); + var entities = await _repository.GetAllAsync(branchId).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new ListResultDto(dtos); } @@ -238,12 +227,8 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch // return ApplicationConsts.SuccessStr; - //} - - - /// /// 修改实体 /// @@ -261,7 +246,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch // var _ent = await _mng.UpdateAsync(id, entity); - // var dto = ObjectMapper.Map(_ent); // return dto; //} @@ -274,10 +258,10 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpDelete] [Route("{id}")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Delete)] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -288,13 +272,12 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpPost] [Route("delete")] //[Authorize(SettleAccountPermissions.MaterialRelationships.Delete)] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - /// /// 导出文件 /// @@ -303,7 +286,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpPost] [Route("Export")] [UnitOfWork(false)] - virtual public async Task ExportAsync(SecMatchBaseRequestDto input) + public virtual async Task ExportAsync(SecMatchBaseRequestDto input) { List fileList = new List(); if (string.IsNullOrEmpty(input.Version)) @@ -314,7 +297,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch IExporter _csv = new CsvExporter(); - IExporter _excel = new ExcelExporter(); + IExporter _excel = new ExcelExporter(); //2021-09-27 添加过滤条件 var output = "二配打印表" + input.Version + ".zip"; @@ -330,10 +313,10 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch new SecMatchBaseOutPutDto("当月结算汇总", "采埃孚富奥汽车底盘系统(长春)有限公司", input.Version, - input.Version.Substring(0, 4) + "年" + input.Version.Substring(4, 2) + "月", + string.Concat(input.Version.AsSpan(0, 4), "年", input.Version.AsSpan(4, 2), "月"), DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), _listdto), - tplPathSub); + tplPathSub).ConfigureAwait(false); string saveSubFileName = "二配打印表_" + input.Version + "当月结算汇总" + ".xlsx"; fileList.Add(saveSubFileName); //保存导出文件到服务器存成二进制 @@ -343,7 +326,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch Name = saveSubFileName, Content = result } - ); + ).ConfigureAwait(false); } var bl1 = _listdto.Where(p => p.PartType == "自制件" && p.Model == "BORA NF").ToList();//宝来 @@ -351,7 +334,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch _dic.Add("宝来自制件", bl1); _dic.Add("AUDI自制件", audi1); - var bl2 = _listdto.Where(p => p.PartType.Contains("CKD") && p.Model == "BORA NF").ToList();//宝来 var audi2 = _listdto.Where(p => p.PartType.Contains("CKD") && p.Model.Contains("AUDI")).ToList();//奥迪 @@ -361,7 +343,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch var bl3 = _listdto.Where(p => p.PartType == "装配费" && p.Model == "BORA NF").ToList();//宝来 var audi3 = _listdto.Where(p => p.PartType == "装配费" && p.Model.Contains("AUDI")).ToList();//奥迪 - _dic.Add("宝来装配费", bl3); _dic.Add("AUDI装配费", audi3); @@ -369,13 +350,14 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch string tplPath = Environment.CurrentDirectory + @"\wwwroot\btsecsummary\" + fileName; //获取导入的模板 - if (_dic != null && _dic.Count > 0) { foreach (var item in _dic) { if (item.Value.Count == 0) + { continue;//没有数据的跳过 + } //创建Excel导出对象 IExportFileByTemplate exporter = new ExcelExporter(); @@ -387,7 +369,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch input.Version.Substring(0, 4) + "年" + input.Version.Substring(4, 2) + "月", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), item.Value), - tplPath); + tplPath).ConfigureAwait(false); string saveFileName = "二配打印表_" + input.Version + item.Key.ToString() + ".xlsx"; fileList.Add(saveFileName); //保存导出文件到服务器存成二进制 @@ -397,7 +379,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch Name = saveFileName, Content = result } - ); + ).ConfigureAwait(false); } } @@ -411,8 +393,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch fileList1.Add(excelFilesPathVerson + @"\" + itm); } - - //string path = excelFilesPathVerson; //DirectoryInfo root = new DirectoryInfo(path); //List @@ -422,13 +402,8 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch // string fullName = f.FullName; //} - - - - MergeExcels(fileList1.ToArray(), excelFilesPath + @"\" + GuidGenerator.Create() + ".xlsx"); - string zipFileName = Environment.CurrentDirectory + @"\wwwroot\" + output; File.Delete(zipFileName); ZipFile.CreateFromDirectory(excelFilesPathVerson, zipFileName); @@ -440,12 +415,11 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch Name = output, Content = fileBuffer } - ); + ).ConfigureAwait(false); File.Delete(zipFileName); _repository.DbContext.BulkInsert(_list); // _list.Where(p=>p) - //var entities = await _mng.GetListAsync(input.Filters, input.Sorting, int.MaxValue, // 0, true); @@ -459,7 +433,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch // _fileName = string.Format("总成与结算件关系_{0}.xlsx",Guid.NewGuid().ToString()); // result = await _excel.ExportAsByteArray(dtoDetails); - //result.ShouldNotBeNull(); //保存导出文件到服务器存成二进制 @@ -473,7 +446,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch return output; } - /// /// 将数个Excel文件中的第一个工作表合并至一个Excel文件中 /// @@ -482,7 +454,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch private void MergeExcels(string[] excelFilePaths, string desFilePath) { - XSSFWorkbook mergeWorkBook = new XSSFWorkbook(); for (int i = 0; i < excelFilePaths.Length; i++) @@ -536,8 +507,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch // return output; //} - - /// /// 导出文件 /// @@ -546,9 +515,9 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch [HttpPost] [Route("ExportSummary")] [UnitOfWork(false)] - virtual public async Task ExportSummaryAsync(SecMatchBaseRequestDto input) + public virtual async Task ExportSummaryAsync(SecMatchBaseRequestDto input) { - + List fileList = new List(); if (string.IsNullOrEmpty(input.Version)) { @@ -569,7 +538,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch var result = await exporterSub.ExportBytesByTemplate( new SecMatchSummaryOutPutDto("国产化二次配套结算汇总表", "采埃孚富奥汽车底盘系统(长春)有限公司(J7W)", - input.Version.Substring(0, 4) + "年" + input.Version.Substring(4, 2) + "月", + string.Concat(input.Version.AsSpan(0, 4), "年", input.Version.AsSpan(4, 2), "月"), DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), _ls.Select(p => p.BORANF).Sum(), _ls.Select(p => p.AUDIB9).Sum(), @@ -577,7 +546,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch _ls.Select(p => p.Amount).Sum(), _ls.Select(p => p.TaxAmount).Sum(), _ls), - tplPathSub); + tplPathSub).ConfigureAwait(false); string saveSubFileName = "大众二配结算清单_" + input.Version + "汇总表(总结算)" + ".xlsx"; fileList.Add(saveSubFileName); //保存导出文件到服务器存成二进制 @@ -587,10 +556,9 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch Name = saveSubFileName, Content = result } - ); + ).ConfigureAwait(false); } - //var _list = _dapper.GetReportList(input.Version, string.Empty); //var _listdto = ObjectMapper.Map, List>(_list); @@ -617,7 +585,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch p.Amount = p.BackNumber * p.Price; p.TaxAmount = Math.Round(p.Amount * decimal.Parse("1.13"), 2); }); - + //创建Excel导出对象 IExportFileByTemplate exporter = new ExcelExporter(); //根据模板导出 @@ -629,10 +597,10 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch itm.Value, itm.Key, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), - _lst.Select(p=>p.Amount).Sum(), - _lst.Select(p=>p.TaxAmount).Sum(), + _lst.Select(p => p.Amount).Sum(), + _lst.Select(p => p.TaxAmount).Sum(), _lst), - tplPath); + tplPath).ConfigureAwait(false); string saveFileName = itm.Key + ".xlsx"; fileList.Add(saveFileName); //保存导出文件到服务器存成二进制 @@ -642,7 +610,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch Name = saveFileName, Content = result } - ); + ).ConfigureAwait(false); } var excelFilesPath = Environment.CurrentDirectory + @"\wwwroot\secsummary\files\host\sec-summary-container"; @@ -658,7 +626,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch string newExcelData = "供应商清单_" + GuidGenerator.Create() + ".xlsx"; MergeExcels(fileList1.ToArray(), excelFilesPath + @"\" + newExcelData); - //string zipFileName = Environment.CurrentDirectory + @"\wwwroot\" + output; //File.Delete(zipFileName); //ZipFile.CreateFromDirectory(excelFilesPathVerson, zipFileName); @@ -673,8 +640,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch // ); //File.Delete(zipFileName); _repository.DbContext.BulkInsert(_list); - - string _fileName = string.Empty; @@ -749,12 +714,11 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch catch (Exception e) { - throw e; + throw; } } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs index 08435e55..d42a8966 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/SettlementParts/SettlementPartAppService.cs @@ -6,31 +6,21 @@ 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.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 Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; -using Win.Sfs.SettleAccount.Entities.Inventories; -using Win.Sfs.SettleAccount.Entities.InventoryDetialVersion; -using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.Inventories; using Win.Sfs.Shared.CacheBase; using Win.Sfs.Shared.Filter; -using Win.Utils; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { @@ -47,14 +37,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts private readonly IExcelImportAppService _excelImportService; private readonly ISettleAccountBranchEfCoreRepository _repository; private readonly ISettleAccountBranchEfCoreRepository _versionRepository; - + /// /// /// /// ִӿ /// public SettlementPartAppService( - + ISettleAccountBranchEfCoreRepository repository, ISettleAccountBranchEfCoreRepository versionRepository, IDistributedCache cache, @@ -63,7 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts ICommonManager commonManager ) : base(cache, excelImportService, snowflakeIdGenerator, commonManager) { - + _versionRepository = versionRepository; _excelImportService = excelImportService; _repository = repository; @@ -80,7 +70,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts public async Task SettlementPartUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExtendExcelImport(files, _excelImportService); + var result = await _exportImporter.ExtendExcelImport(files, _excelImportService).ConfigureAwait(false); List _list = new List(); var checkList = new List(); var _id = GuidGenerator.Create(); @@ -118,27 +108,24 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts if (checkList.Count > 0) { - return await ExportErrorReportAsync(checkList); + return await ExportErrorReportAsync(checkList).ConfigureAwait(false); } var _versionQuery = _versionRepository.Where(p => p.Version == version && p.CustomerCode == customerCode); - await _versionQuery.BatchDeleteAsync(); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); var _query = _repository.Where(p => p.Version == version && p.CustomerCode == customerCode); - await _query.BatchDeleteAsync(); + await _query.BatchDeleteAsync().ConfigureAwait(false); _repository.GetDbContext().BulkInsert(_list); var versionList = new List(); versionList.Add(new SettlementPartVersion(_id, branchId, year, period, version, customerCode, factory)); - await _versionRepository.GetDbContext().BulkInsertAsync(versionList); + await _versionRepository.GetDbContext().BulkInsertAsync(versionList).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } - - - /// /// ĵ /// @@ -151,7 +138,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts public async Task SettlementPartUploadExcelUpdate([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode, string factory) { ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExtendExcelImport(files, _excelImportService); + var result = await _exportImporter.ExtendExcelImport(files, _excelImportService).ConfigureAwait(false); List _list = new List(); var checkList = new List(); var _id = GuidGenerator.Create(); @@ -175,7 +162,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts var _details = _repository.Where(p => p.Period == period && p.Version == version && p.CustomerCode == customerCode); - foreach (var itm in _list) { @@ -194,16 +180,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts if (checkList.Count > 0) { - return await ExportErrorReportAsync(checkList); + return await ExportErrorReportAsync(checkList).ConfigureAwait(false); } - await _repository.UpdateManyAsync(_details); - + await _repository.UpdateManyAsync(_details).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } - /// /// IDȡΨһʵ /// @@ -215,34 +199,30 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpGet] [Route("{id}")] //[Authorize(SettleAccountPermissions.SettlementParts.Default)] - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - var result = await GetFromCacheAsync(id); + var result = await GetFromCacheAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); - + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } - private async Task GetCountAsync(SettlementPartRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } private async Task GetCountAsync(SettlementPartVersionRequestDto input) { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - ///// /// @@ -256,7 +236,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpPost] [Route("list")] //[Authorize(SettleAccountPermissions.SettlementParts.Default)] - virtual public async Task> GetListAsync(SettlementPartRequestDto input) + public virtual async Task> GetListAsync(SettlementPartRequestDto input) { if (!string.IsNullOrEmpty(input.Version)) @@ -270,15 +250,14 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - /// /// ȡʵ /// @@ -286,9 +265,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpGet] [Route("count")] //[Authorize(SettleAccountPermissions.SettlementParts.Default)] - virtual public async Task GetTotalCountAsync(Guid branchId) + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } /// @@ -298,20 +277,15 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpGet] [Route("all")] //[Authorize(SettleAccountPermissions.SettlementParts.Default)] - virtual public async Task> GetAllAsync(Guid branchId) + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId, true); - + var entities = await _repository.GetAllAsync(branchId, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); } - - - /// /// ޸ʵ /// @@ -321,9 +295,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpPut] [Route("{id}")] //[Authorize(SettleAccountPermissions.SettlementParts.Update)] - virtual public async Task UpdateAsync(Guid id, SettlementPartUpdateDto input) + public virtual async Task UpdateAsync(Guid id, SettlementPartUpdateDto input) { - var entity = await _repository.GetAsync(id); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); if (entity != null) { //var _inventory = new SettlementPart( @@ -348,7 +322,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts //await _repository.UpdateAsync(_inventory); //update cache - await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES); + await Cache.SetAsync(id.ToString(), entity, CacheStrategyConst.FIVE_MINUTES).ConfigureAwait(false); var dto = ObjectMapper.Map(entity); return dto; @@ -368,11 +342,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpDelete] [Route("{id}")] //[Authorize(SettleAccountPermissions.SettlementParts.Delete)] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); - await _repository.DeleteAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -383,19 +357,17 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpPost] [Route("delete")] //[Authorize(SettleAccountPermissions.SettlementParts.Delete)] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { foreach (var id in ids) { - var entity = await GetFromCacheAsync(id); - await Cache.DeleteAsync(id.ToString()); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); + await Cache.DeleteAsync(id.ToString()).ConfigureAwait(false); } - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - - [HttpPost] [Route("versionlist")] //[Authorize(SettleAccountPermissions.SettlementParts.Default)] @@ -407,9 +379,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts public async Task> GetVersionListAsync(SettlementPartVersionRequestDto input) { var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); //foreach (var itm in dtos) //{ @@ -418,10 +390,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts return new PagedResultDto(totalCount, dtos); } - - - - /// /// ļ /// @@ -430,7 +398,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [HttpPost] [Route("Export")] //[Authorize(SettleAccountPermissions.SettlementParts.Default)] - virtual public async Task ExportAsync(SettlementPartRequestDto input) + public virtual async Task ExportAsync(SettlementPartRequestDto input) { IExporter _csv = new CsvExporter(); @@ -449,7 +417,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); @@ -461,11 +429,11 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts { case 0: _fileName = string.Format("۸ϸ_{0}.csv", _snowflakeIdGenerator.Create().ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: _fileName = string.Format("۸ϸ_{0}.xlsx", _snowflakeIdGenerator.Create().ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -477,7 +445,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs index 88673265..39e96c89 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/TaskJobs/JobAppService.cs @@ -1,94 +1,90 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities.BQ; -using Win.Sfs.SettleAccount.MaterialRelationships; -namespace Win.Sfs.SettleAccount.Entities.TaskJobs; - -[AllowAnonymous] -[Route("api/settleaccount/Job")] -public class JobAppService: ApplicationService +namespace Win.Sfs.SettleAccount.Entities.TaskJobs { - private readonly TaskJobService _service; - - public JobAppService(TaskJobService service) + [AllowAnonymous] + [Route("api/settleaccount/Job")] + public class JobAppService : ApplicationService { - _service = service; - } + private readonly TaskJobService _service; - /// - /// 根据筛选条件获取实体列表 - /// - /// - [HttpPost] - [Route("listold")] - [UnitOfWork(false)] - public virtual async Task> GetListOldAsync(JobRequestDto input) - { - return await _service.GetListAsync(input); - } + public JobAppService(TaskJobService service) + { + _service = service; + } - /// - /// 根据筛选条件获取实体列表 - /// - [HttpPost] - [Route("list")] - [UnitOfWork(false)] - public virtual async Task> GetListAsync(JobRequestDto input) - { - var lists = await _service.GetListAsync(input).ConfigureAwait(false); - return new PagedResultDto(lists.Count, lists); - } + /// + /// 根据筛选条件获取实体列表 + /// + /// + [HttpPost] + [Route("listold")] + [UnitOfWork(false)] + public virtual async Task> GetListOldAsync(JobRequestDto input) + { + return await _service.GetListAsync(input).ConfigureAwait(false); + } - [HttpGet] - [Route("{id}")] + /// + /// 根据筛选条件获取实体列表 + /// + [HttpPost] + [Route("list")] + [UnitOfWork(false)] + public virtual async Task> GetListAsync(JobRequestDto input) + { + var lists = await _service.GetListAsync(input).ConfigureAwait(false); + return new PagedResultDto(lists.Count, lists); + } - //[Authorize(SettleAccountPermissions.Materials.Default)] - [UnitOfWork(false)] - virtual public async Task> GetUploadListAsync(string id) - { - return await _service.GetUpFileListAsync(id); - } + [HttpGet] + [Route("{id}")] + //[Authorize(SettleAccountPermissions.Materials.Default)] + [UnitOfWork(false)] + public virtual async Task> GetUploadListAsync(string id) + { + return await _service.GetUpFileListAsync(id).ConfigureAwait(false); + } - [HttpPost] - [Route("versionlist")] - [UnitOfWork(false)] - virtual public async Task> GetVersionListAsync() - { - return await _service.GetVersionListAsync(); - } + [HttpPost] + [Route("versionlist")] + [UnitOfWork(false)] + public virtual async Task> GetVersionListAsync() + { + return await _service.GetVersionListAsync().ConfigureAwait(false); + } - [HttpPost] - [Route("delete")] - - virtual public async Task DeleteListAsync(List ids) - { - return await _service.DeleteListAsync(ids); - } + [HttpPost] + [Route("delete")] + public virtual async Task DeleteListAsync(List ids) + { + return await _service.DeleteListAsync(ids).ConfigureAwait(false); + } - [HttpGet] - [Route("updateRemark")] - virtual public async Task UpdateRemarkAsync(Guid p_id,string remark) - { - return await _service.UpdateAsync(p_id,remark); - } + [HttpGet] + [Route("updateRemark")] -} + public virtual async Task UpdateRemarkAsync(Guid p_id, string remark) + { + return await _service.UpdateAsync(p_id, remark).ConfigureAwait(false); + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs index 3e588d04..61cf223f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/UnHQSettleAccounts/UnHQSettleAppService.cs @@ -1,4 +1,8 @@ -using EFCore.BulkExtensions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EFCore.BulkExtensions; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Csv; using Magicodes.ExporterAndImporter.Excel; @@ -6,11 +10,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Shouldly; -using System; -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; @@ -43,10 +42,8 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts private readonly ISettleAccountBranchEfCoreRepository _repository; - private readonly ISettleAccountBranchEfCoreRepository _versionMRepository; - private readonly ISettleAccountBranchEfCoreRepository _repositoryM; /// /// 构建方法 /// @@ -87,7 +84,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts public async Task UnHQSettleUploadExcelImport([FromForm] IFormFileCollection files, Guid branchId, string year, string period, string version, string customerCode) { ExportImporter _exportImporter = new ExportImporter(); - var result_org = await _exportImporter.UploadExcelImport(files, _excelImportService); + var result_org = await _exportImporter.UploadExcelImport(files, _excelImportService).ConfigureAwait(false); if (result_org == null || result_org.Count == 0) { @@ -98,10 +95,10 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts var entityList = ObjectMapper.Map, List>(result); //删除版本 var _versionQuery = _versionRepository.Where(p => p.Version == version); - await _versionQuery.BatchDeleteAsync(); + await _versionQuery.BatchDeleteAsync().ConfigureAwait(false); //删除明细 var _query = _repository.Where(p => p.Version == version); - await _query.BatchDeleteAsync(); + await _query.BatchDeleteAsync().ConfigureAwait(false); var _id = GuidGenerator.Create(); var _bomList = new List(); @@ -119,14 +116,12 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts } } - await _repository.GetDbContext().BulkInsertAsync(entityList); - await _versionRepository.GetDbContext().BulkInsertAsync(_bomList); + await _repository.GetDbContext().BulkInsertAsync(entityList).ConfigureAwait(false); + await _versionRepository.GetDbContext().BulkInsertAsync(_bomList).ConfigureAwait(false); return ApplicationConsts.SuccessStr; } - - /// /// 按ID获取唯一实体 /// @@ -137,32 +132,29 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// 实体DTO [HttpGet] [Route("{id}")] - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - var result = await GetFromCacheAsync(id); + var result = await GetFromCacheAsync(id).ConfigureAwait(false); var dto = ObjectMapper.Map(result); return dto; } - private async Task GetFromCacheAsync(Guid id) { - var result = await _repository.GetAsync(id); + var result = await _repository.GetAsync(id).ConfigureAwait(false); return result; } - private async Task GetCountAsync(UnHQSettleRequestDto input) { - return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _repository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } private async Task GetCountAsync(UnHQSettleVersionRequestDto input) { - return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters); + return await _versionRepository.GetCountByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); } - /// /// 导出文件 /// @@ -170,7 +162,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// [HttpPost] [Route("Export")] - virtual public async Task ExportAsync(UnHQSettleRequestDto input) + public virtual async Task ExportAsync(UnHQSettleRequestDto input) { IExporter _csv = new CsvExporter(); @@ -180,7 +172,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts input.Filters.Add(new FilterCondition() { Action = EnumFilterAction.Equal, Column = "Version", Logic = EnumFilterLogic.And, Value = input.Version }); } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - 0, true); + 0, true).ConfigureAwait(false); var dtoDetails = ObjectMapper.Map, List>(entities); @@ -192,11 +184,11 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts { case 0: _fileName = string.Format("红旗未结明细_{0}.csv", input.UserId.ToString()); - result = await _csv.ExportAsByteArray(dtoDetails); + result = await _csv.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; case 1: _fileName = string.Format("红旗未结明细_{0}.xlsx", input.UserId.ToString()); - result = await _excel.ExportAsByteArray(dtoDetails); + result = await _excel.ExportAsByteArray(dtoDetails).ConfigureAwait(false); break; } result.ShouldNotBeNull(); @@ -208,11 +200,10 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts Name = _fileName, Content = result } - ); + ).ConfigureAwait(false); return _fileName; } - /// /// 根据筛选条件获取实体列表 /// @@ -223,7 +214,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// 实体DTO列表 [HttpPost] [Route("list")] - virtual public async Task> GetListAsync(UnHQSettleRequestDto input) + public virtual async Task> GetListAsync(UnHQSettleRequestDto input) { if (!string.IsNullOrEmpty(input.Version)) { @@ -234,24 +225,23 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts return new PagedResultDto(0, new List()); } var entities = await _repository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, input.MaxResultCount, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); } - /// /// 获取实体总数 /// /// 实体总数 [HttpGet] [Route("count")] - virtual public async Task GetTotalCountAsync(Guid branchId) + public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } /// @@ -260,19 +250,15 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// 实体DTO列表 [HttpGet] [Route("all")] - virtual public async Task> GetAllAsync(Guid branchId) + public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId, true); - + var entities = await _repository.GetAllAsync(branchId, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); - return new ListResultDto(dtos); } - - /// /// 删除实体 /// @@ -280,9 +266,9 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// [HttpDelete] [Route("{id}")] - virtual public async Task DeleteAsync(Guid id) + public virtual async Task DeleteAsync(Guid id) { - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } /// @@ -292,19 +278,17 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// 是否执行成功 [HttpPost] [Route("delete")] - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { foreach (var id in ids) { - var entity = await GetFromCacheAsync(id); + var entity = await GetFromCacheAsync(id).ConfigureAwait(false); //await Cache.DeleteAsync(id.ToString()); } - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - - /// /// 版本列表查询 /// @@ -315,9 +299,9 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts public async Task> GetVersionListAsync(UnHQSettleVersionRequestDto input) { var entities = await _versionRepository.GetListByFilterAsync(input.BranchId, input.Filters, input.Sorting, int.MaxValue, - input.SkipCount, true); + input.SkipCount, true).ConfigureAwait(false); - var totalCount = await GetCountAsync(input); + var totalCount = await GetCountAsync(input).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); return new PagedResultDto(totalCount, dtos); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Handler/FisRecHandler.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Handler/FisRecHandler.cs index 0c12401b..8bd1b412 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Handler/FisRecHandler.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Handler/FisRecHandler.cs @@ -1,9 +1,8 @@ -using EFCore.BulkExtensions; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using EFCore.BulkExtensions; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories; using Volo.Abp.EventBus.Distributed; @@ -39,7 +38,7 @@ namespace Win.Sfs.SettleAccount.Handler { _ls.Add(new FIS(Guid.NewGuid(), Guid.NewGuid(), eventData.Year, eventData.Period, string.Empty, itm.ChassisNumber, itm.Qty, DateTime.Parse(itm.CP5Time), itm.SequenceNumber, itm.OrderBillNum, itm.MaterialCode, itm.Year, _id, itm.KENNCode, itm.ChassisNumber.Substring(9, 8), EnumSettleStatus.未结算, DateTime.MinValue, 0, eventData.Version, DateTime.Now, Guid.NewGuid(), DateTime.Now, DateTime.Now, itm.ErpMaterialCode)); } - await _repository.GetDbContext().BulkInsertAsync(_ls); + await _repository.GetDbContext().BulkInsertAsync(_ls).ConfigureAwait(false); //_repository.Where(p=>p.ErpMaterialCode) @@ -51,7 +50,7 @@ namespace Win.Sfs.SettleAccount.Handler if (_version != null) { List version = new List() { new FISVersion(Guid.NewGuid(), Guid.NewGuid(), eventData.Year, eventData.Period, eventData.Version, eventData.CustomerCode, eventData.Factory, eventData.Model, DateTime.Parse(eventData.BeginDate), DateTime.Parse(eventData.EndDate)) }; - await _versionRepository.GetDbContext().BulkInsertAsync(version); + await _versionRepository.GetDbContext().BulkInsertAsync(version).ConfigureAwait(false); var query = from p in _repository group p by new { p.ItemCode, p.ChassisNumber } into g where g.Count() > 1 @@ -65,13 +64,11 @@ namespace Win.Sfs.SettleAccount.Handler var query1 = _repository.Where(p => _IdList.Contains(p.Id)); query1.BatchDelete(); - } - } } } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/AppConfigurations.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/AppConfigurations.cs index a0711270..178145ce 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/AppConfigurations.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/AppConfigurations.cs @@ -1,12 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.Extensions.Configuration; namespace Win.Sfs.BaseData.ImportExcelCommon diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ConfigDirHelper.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ConfigDirHelper.cs index 2c40d2bb..6afe3a3a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ConfigDirHelper.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ConfigDirHelper.cs @@ -1,14 +1,9 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.Extensions.Configuration; -using Win.Sfs.BaseData.ImportExcelCommon; namespace Win.Sfs.BaseData.ImportExcelCommon { @@ -17,7 +12,7 @@ namespace Win.Sfs.BaseData.ImportExcelCommon /// public static class ConfigDirHelper { - private static IConfigurationRoot _appConfiguration = AppConfigurations.Get(System.Environment.CurrentDirectory); + private static readonly IConfigurationRoot _appConfiguration = AppConfigurations.Get(System.Environment.CurrentDirectory); //用法1(有嵌套):GetAppSetting("Authentication", "JwtBearer:SecurityKey") //用法2:GetAppSetting("App", "ServerRootAddress") public static string GetAppSetting(string section, string key) @@ -43,7 +38,7 @@ namespace Win.Sfs.BaseData.ImportExcelCommon { if (!System.IO.File.Exists(path)) { - return new byte[0]; + return Array.Empty(); } FileInfo fi = new FileInfo(path); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/EPHelper.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/EPHelper.cs index c4261125..edce1c77 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/EPHelper.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/EPHelper.cs @@ -1,4 +1,4 @@ -//using OfficeOpenXml; +//using OfficeOpenXml; //using OfficeOpenXml.Style; //using System; //using System.Collections.Generic; @@ -14,16 +14,6 @@ //namespace Win.Sfs.SettleAccount.ImportExcelCommon //{ - - - - - - - - - - // public class EPPlusExcelHelper : IDisposable // { // public ExcelPackage ExcelPackage { get; private set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExcelImportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExcelImportAppService.cs index 30650a21..47b9062c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExcelImportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExcelImportAppService.cs @@ -1,10 +1,6 @@ // 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; using Volo.Abp.BlobStoring; @@ -28,7 +24,7 @@ namespace Win.Sfs.BaseData.ImportExcelCommon public async Task SaveBlobAsync(SaveExcelImportInputDto input) { - await _fileContainer.SaveAsync(input.Name, input.Content, true); + await _fileContainer.SaveAsync(input.Name, input.Content, true).ConfigureAwait(false); } /// /// 获取BLOB存储 @@ -37,8 +33,9 @@ namespace Win.Sfs.BaseData.ImportExcelCommon /// public async Task GetBlobAsync(GetExcelImportRequestDto input) { - var blob = await _fileContainer.GetAllBytesAsync(input.Name); - return new ExcelImportDto { + var blob = await _fileContainer.GetAllBytesAsync(input.Name).ConfigureAwait(false); + return new ExcelImportDto + { Name = input.Name, Content = blob }; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs index 2218e76d..0514de29 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs @@ -1,43 +1,26 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Shouldly; using System; using System.Collections.Generic; +using System.Data; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Win.Sfs.BaseData.ImportExcelCommon; -using NPOI.HSSF.UserModel; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; - -using System.Data; -using System.Globalization; - -using System.Threading; -using System.Text.Json; -using Microsoft.Extensions.Configuration; using System.Reflection; -using System.Text.Encodings.Web; -using System.Text.Unicode; -using OfficeOpenXml; -using Win.Sfs.SettleAccount.Inventories; -using Win.Sfs.SettleAccount.Entities.Errors; - -using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.Entities.ImportMap; -using Magicodes.ExporterAndImporter.Excel.Utility; -using Magicodes.ExporterAndImporter.Core.Models; -using Magicodes.ExporterAndImporter.Core.Filters; -using OfficeOpenXml.Attributes; -using Win.Sfs.SettleAccount.Attributes; +using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core.Extension; +using Magicodes.ExporterAndImporter.Core.Models; +using Magicodes.ExporterAndImporter.Excel; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using Shouldly; +using Volo.Abp; using Volo.Abp.BlobStoring; +using Win.Sfs.BaseData.ImportExcelCommon; +using Win.Sfs.SettleAccount.Attributes; +using Win.Sfs.SettleAccount.Entities.ImportMap; namespace Win.Sfs.SettleAccount.ExcelImporter { @@ -45,7 +28,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter { public static IServiceProvider ServiceProvider { get; set; } - private readonly IExporter _csvExporter = new Magicodes.ExporterAndImporter.Csv.CsvExporter();//导出CSV private readonly IExcelImporter _importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();//导入Excel private readonly IExporter _exporter = new ExcelExporter();//导出Excel @@ -88,7 +70,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter using (var memoryStream = new MemoryStream()) { //保存成物理文件 - await file.CopyToAsync(memoryStream); + await file.CopyToAsync(memoryStream).ConfigureAwait(false); //await _excelImportService.SaveBlobAsync( // new SaveExcelImportInputDto // { @@ -107,7 +89,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter ////文件保存的路径(应用的工作目录+文件夹相对路径); //string fileSavePath = Environment.CurrentDirectory + @"\wwwroot\files\host\my-file-container" + absoluteFileDir; //var filePath = fileSavePath + getFileName;//获取到导入的excel - var import = await _importer.Import((await fc.GetAsync(FileOriginName).ConfigureAwait(false))); + var import = await _importer.Import((await fc.GetAsync(FileOriginName).ConfigureAwait(false))).ConfigureAwait(false); if (import.Exception != null) { if (import.Exception.Message.ToString() == "导入文件不存在!") @@ -187,7 +169,7 @@ namespace Win.Sfs.SettleAccount.ExcelImporter using (var memoryStream = new MemoryStream()) { //保存成物理文件 - await file.CopyToAsync(memoryStream); + await file.CopyToAsync(memoryStream).ConfigureAwait(false); //await _excelImportService.SaveBlobAsync( // new SaveExcelImportInputDto // { @@ -308,9 +290,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter // ExcelImportResult returnResult = new ExcelImportResult(); // List _errorList = new List(); - - - // //if (repository != null) // //{ // // var importAttrib = type.GetCustomAttribute(); @@ -337,7 +316,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter // // } // //} - // foreach (var file in files) // { // if (file == null) @@ -406,8 +384,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter // _errorList.Add(string.Format("第{0}行{1}", itm.RowIndex.ToString(), error)); // } - - // //自动保存“{ 目标文件名称}_.xlsx”的标注文件到目标位置 // //导入的数据有错误,比如重复列,必填项为空等(不包含警告),主要看DTO的设置 // import.HasError.ShouldBeTrue();//标识导入的数据有错误 @@ -433,8 +409,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter // return ImportList;//返回客户端 // } - - /// /// 导出Excel文件公用方法 /// @@ -443,14 +417,11 @@ namespace Win.Sfs.SettleAccount.ExcelImporter /// public virtual async Task ExcelExporter(List dots) where T : class, new() { - var result = await _exporter.ExportAsByteArray(dots); - + var result = await _exporter.ExportAsByteArray(dots).ConfigureAwait(false); return result; } - - public virtual async Task> ExtendExcelImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService, List p_list = null) where T : class, new() { @@ -459,7 +430,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter var ImportList = new List(); ExcelImportResult returnResult = new ExcelImportResult(); - List _errorList = new List(); foreach (var file in files) { @@ -472,14 +442,14 @@ namespace Win.Sfs.SettleAccount.ExcelImporter using (var memoryStream = new MemoryStream()) { //保存成物理文件 - await file.CopyToAsync(memoryStream); + await file.CopyToAsync(memoryStream).ConfigureAwait(false); await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto { Name = Path.GetFileName(FileOriginName), Content = memoryStream.ToArray() } - ); + ).ConfigureAwait(false); } //读取文件保存的根目录 string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath"); @@ -505,7 +475,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter return ImportList;//返回客户端 } - public virtual async Task> ExtendExcelOfSheetOneImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService, List p_list = null) where T : class, new() { @@ -514,7 +483,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter var ImportList = new List(); ExcelImportResult returnResult = new ExcelImportResult(); - List _errorList = new List(); foreach (var file in files) { @@ -527,14 +495,14 @@ namespace Win.Sfs.SettleAccount.ExcelImporter using (var memoryStream = new MemoryStream()) { //保存成物理文件 - await file.CopyToAsync(memoryStream); + await file.CopyToAsync(memoryStream).ConfigureAwait(false); await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto { Name = Path.GetFileName(FileOriginName), Content = memoryStream.ToArray() } - ); + ).ConfigureAwait(false); } //读取文件保存的根目录 string fileSaveRootDir = ConfigDirHelper.GetAppSetting("App", "FileRootPath"); @@ -563,17 +531,6 @@ namespace Win.Sfs.SettleAccount.ExcelImporter } } - - - - - - - - - - - /// /// 获取配置下面的具体属性的值 /// @@ -586,9 +543,6 @@ public class GetSetting } } - - - public class ExcelImportResult { /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileAppService.cs index 28c4ce88..64c18917 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileAppService.cs @@ -1,10 +1,6 @@ // 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Application.Services; using Volo.Abp.BlobStoring; @@ -31,7 +27,7 @@ namespace Win.Sfs.BaseData.ImportExcelCommon /// public async Task SaveBlobAsync(SaveBlobInputDto input) { - await _fileContainer.SaveAsync(input.Name, input.Content, true); + await _fileContainer.SaveAsync(input.Name, input.Content, true).ConfigureAwait(false); } /// /// 获取BLOB存储 @@ -40,8 +36,9 @@ namespace Win.Sfs.BaseData.ImportExcelCommon /// public async Task GetBlobAsync(GetBlobRequestDto input) { - var blob = await _fileContainer.GetAllBytesAsync(input.Name); - return new BlobDto { + var blob = await _fileContainer.GetAllBytesAsync(input.Name).ConfigureAwait(false); + return new BlobDto + { Name = input.Name, Content = blob }; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileSystem.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileSystem.cs index 1378666e..a51b1cc4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileSystem.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/FileSystem.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.SettleAccount.ImportExcelCommon { @@ -37,18 +33,16 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon { if (!System.IO.File.Exists(path)) { - return new byte[0]; + return Array.Empty(); } FileInfo fi = new FileInfo(path); byte[] buff = new byte[fi.Length]; - FileStream fs = fi.OpenRead(); fs.Read(buff, 0, Convert.ToInt32(fs.Length)); fs.Close(); - return buff; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecBTSummaryFileAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecBTSummaryFileAppService.cs index 1978eb58..45161871 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecBTSummaryFileAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecBTSummaryFileAppService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; @@ -27,7 +23,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon public async Task SaveBlobAsync(SaveExcelImportInputDto input) { - await _fileContainer.SaveAsync(input.Name, input.Content, true); + await _fileContainer.SaveAsync(input.Name, input.Content, true).ConfigureAwait(false); } /// /// 获取BLOB存储 @@ -36,7 +32,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon /// public async Task GetBlobAsync(GetExcelImportRequestDto input) { - var blob = await _fileContainer.GetAllBytesAsync(input.Name); + var blob = await _fileContainer.GetAllBytesAsync(input.Name).ConfigureAwait(false); return new ExcelImportDto { Name = input.Name, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecSummaryFileAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecSummaryFileAppService.cs index 4ebe47b9..d45ac4e5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecSummaryFileAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/SecSummaryFileAppService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; +using System.Threading.Tasks; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; @@ -28,7 +23,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon public async Task SaveBlobAsync(SaveExcelImportInputDto input) { - await _fileContainer.SaveAsync(input.Name, input.Content, true); + await _fileContainer.SaveAsync(input.Name, input.Content, true).ConfigureAwait(false); } /// /// 获取BLOB存储 @@ -37,7 +32,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon /// public async Task GetBlobAsync(GetExcelImportRequestDto input) { - var blob = await _fileContainer.GetAllBytesAsync(input.Name); + var blob = await _fileContainer.GetAllBytesAsync(input.Name).ConfigureAwait(false); return new ExcelImportDto { Name = input.Name, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipBTExportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipBTExportAppService.cs index 70746b42..2ec596cf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipBTExportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipBTExportAppService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.Application.Services; using Volo.Abp.BlobStoring; using Win.Sfs.BaseData.ImportExcelCommon; @@ -24,7 +20,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon public async Task SaveBlobAsync(SaveExcelImportInputDto input) { - await _fileContainer.SaveAsync(input.Name, input.Content, true); + await _fileContainer.SaveAsync(input.Name, input.Content, true).ConfigureAwait(false); } /// /// 获取BLOB存储 @@ -33,7 +29,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon /// public async Task GetBlobAsync(GetExcelImportRequestDto input) { - var blob = await _fileContainer.GetAllBytesAsync(input.Name); + var blob = await _fileContainer.GetAllBytesAsync(input.Name).ConfigureAwait(false); return new ExcelImportDto { Name = input.Name, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipExportAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipExportAppService.cs index 4c867dfc..5257b021 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipExportAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ZipExportAppService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; using Volo.Abp.Application.Services; using Volo.Abp.BlobStoring; using Win.Sfs.BaseData.ImportExcelCommon; @@ -24,7 +20,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon public async Task SaveBlobAsync(SaveExcelImportInputDto input) { - await _fileContainer.SaveAsync(input.Name, input.Content, true); + await _fileContainer.SaveAsync(input.Name, input.Content, true).ConfigureAwait(false); } /// /// 获取BLOB存储 @@ -33,7 +29,7 @@ namespace Win.Sfs.SettleAccount.ImportExcelCommon /// public async Task GetBlobAsync(GetExcelImportRequestDto input) { - var blob = await _fileContainer.GetAllBytesAsync(input.Name); + var blob = await _fileContainer.GetAllBytesAsync(input.Name).ConfigureAwait(false); return new ExcelImportDto { Name = input.Name, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs index d9889370..2d7f13de 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Jobs/TaskJobService.cs @@ -1,31 +1,22 @@ -using AutoMapper; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Text; -using System.Text.Encodings.Web; using System.Text.Json; -using System.Text.Unicode; using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; using TaskJob.EventArgs; using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; using Volo.Abp.Uow; using Volo.Abp.Users; using Win.Sfs.BaseData.ImportExcelCommon; - using Win.Sfs.SettleAccount.Repository; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.TaskJobs { - + public class TaskJobService : ITransientDependency { private readonly TaskJobManager _mng; @@ -46,48 +37,41 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs _mng = mng; } - - virtual public async Task GetAsync(Guid id) + public virtual async Task GetAsync(Guid id) { - return await _mng.GetAsync(id); ; - + return await _mng.GetAsync(id).ConfigureAwait(false); ; } - virtual public async Task GetAsync(string id) + public virtual async Task GetAsync(string id) { - return await _mng.GetAsync(id); ; - + return await _mng.GetAsync(id).ConfigureAwait(false); ; } - virtual public async Task> GetVersionListAsync() + public virtual async Task> GetVersionListAsync() { - return await _mng.GetVersionListAsync(); - + return await _mng.GetVersionListAsync().ConfigureAwait(false); } - - virtual public async Task> GetUpFileListAsync(string taskId) + public virtual async Task> GetUpFileListAsync(string taskId) { - return await _taskDapper.GetUpFileAsync(taskId); + return await _taskDapper.GetUpFileAsync(taskId).ConfigureAwait(false); } - - virtual public async Task DeleteListAsync(List ids) + public virtual async Task DeleteListAsync(List ids) { - return await _mng.DeleteListAsync(ids); + return await _mng.DeleteListAsync(ids).ConfigureAwait(false); } - virtual public async Task UpdateAsync(Guid p_id,string remark) + public virtual async Task UpdateAsync(Guid p_id, string remark) { - return await _mng.UpdateAsync(p_id,remark); + return await _mng.UpdateAsync(p_id, remark).ConfigureAwait(false); } - [UnitOfWork(false)] - virtual public async Task> GetListAsync(JobRequestDto input) + public virtual async Task> GetListAsync(JobRequestDto input) { var _job = new Job(input.Id, input.StateId, @@ -110,7 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs input.Type, input.Remark ); - var _lst = await _taskDapper.GetTaskJobsAsync(_job); + var _lst = await _taskDapper.GetTaskJobsAsync(_job).ConfigureAwait(false); var _dtoList = new List(); foreach (var itm in _lst) { @@ -141,7 +125,6 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs return _dtoList; } - /// /// 导入队列 /// @@ -152,7 +135,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs /// 开始回调函数 /// 加入队列时回调 /// - public async Task ImportEnqueueAsync([FromForm] IFormFileCollection files, string currentApplicationName, ICurrentUser user, Type moudle,List conditions, Action beginAction = null, Action endaction = null) where T : TaskArgs, new() + public async Task ImportEnqueueAsync([FromForm] IFormFileCollection files, string currentApplicationName, ICurrentUser user, Type moudle, List conditions, Action beginAction = null, Action endaction = null) where T : TaskArgs, new() { if (beginAction != null) { @@ -172,14 +155,14 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs using (var memoryStream = new MemoryStream()) { //保存成物理文件 - await file.CopyToAsync(memoryStream); + await file.CopyToAsync(memoryStream).ConfigureAwait(false); await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto { Name = _filename, Content = memoryStream.ToArray() } - ); + ).ConfigureAwait(false); } fileNameList.Add(getFileName); } @@ -187,7 +170,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs var _id = Guid.NewGuid(); var args = new T() { - Id=_id, + Id = _id, ActionName = "导入", FileName = fileNameList, RealFileName = fileNameList, @@ -195,17 +178,15 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs Email = user.Email, Name = currentApplicationName, ServiceName = _serviceName, - InputConditions=conditions + InputConditions = conditions }; - - - var _taskId = await _backgroundJobManager.EnqueueAsync(args,BackgroundJobPriority.Normal,TimeSpan.FromSeconds(3)); + var _taskId = await _backgroundJobManager.EnqueueAsync(args, BackgroundJobPriority.Normal, TimeSpan.FromSeconds(3)).ConfigureAwait(false); var options = new JsonSerializerOptions { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; - await _mng.CreateAsync(new TaskJob(_id, _taskId, currentApplicationName, "导入", string.Empty, user.Name, user.Email,JsonSerializer.Serialize(fileNameList,options), JsonSerializer.Serialize(fileNameList,options), string.Empty, string.Empty, _serviceName,string.Empty,string.Empty)); + await _mng.CreateAsync(new TaskJob(_id, _taskId, currentApplicationName, "导入", string.Empty, user.Name, user.Email, JsonSerializer.Serialize(fileNameList, options), JsonSerializer.Serialize(fileNameList, options), string.Empty, string.Empty, _serviceName, string.Empty, string.Empty)).ConfigureAwait(false); args.TaskId = _taskId; if (endaction != null) { @@ -222,7 +203,7 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs /// 执行队列实现模块类名 /// 生成任务后回调函数 /// - public async Task ExportEnqueueAsync(string currentApplicationName,ExportExtentsion extentsion,string version,string remark, ICurrentUser user, Type moudle,List customConditions, Action action = null) + public async Task ExportEnqueueAsync(string currentApplicationName, ExportExtentsion extentsion, string version, string remark, ICurrentUser user, Type moudle, List customConditions, Action action = null) { if (string.IsNullOrEmpty(currentApplicationName) || user == null || moudle == null) { @@ -232,31 +213,31 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs switch (extentsion) { case ExportExtentsion.Csv: - str= string.Format("{0}_{1}.{2}", currentApplicationName, Guid.NewGuid().ToString(), "cvs"); + str = string.Format("{0}_{1}.{2}", currentApplicationName, Guid.NewGuid().ToString(), "cvs"); break; case ExportExtentsion.Excel: - str= string.Format("{0}_{1}.{2}", currentApplicationName, Guid.NewGuid().ToString(), "xlsx"); + str = string.Format("{0}_{1}.{2}", currentApplicationName, Guid.NewGuid().ToString(), "xlsx"); break; } var _serviceName = moudle.FullName; var guid = Guid.NewGuid(); - var _entity= await _mng.CreateAsync(new TaskJob(guid,version , currentApplicationName, "导出", string.Empty, user.Name, user.Email, string.Empty,string.Empty, str, str, _serviceName,version,remark)); + var _entity = await _mng.CreateAsync(new TaskJob(guid, version, currentApplicationName, "导出", string.Empty, user.Name, user.Email, string.Empty, string.Empty, str, str, _serviceName, version, remark)).ConfigureAwait(false); var args = new ExportTaskArgs() { - Id=guid, + Id = guid, ActionName = "导出", - DownFileName = new List() { str }, + DownFileName = new List() { str }, RealDownFileName = new List() { str }, Creator = user.Name, Email = user.Email, Name = currentApplicationName, - ServiceName=_serviceName, - InputConditions=customConditions, + ServiceName = _serviceName, + InputConditions = customConditions, }; - var _taskId=await _backgroundJobManager.EnqueueAsync(args,BackgroundJobPriority.Normal, TimeSpan.FromSeconds(3)); - await _mng.ChangeTaskIdAsync(guid, _taskId); - args.TaskId = _taskId; + var _taskId = await _backgroundJobManager.EnqueueAsync(args, BackgroundJobPriority.Normal, TimeSpan.FromSeconds(3)).ConfigureAwait(false); + await _mng.ChangeTaskIdAsync(guid, _taskId).ConfigureAwait(false); + args.TaskId = _taskId; if (action != null) { action(args); @@ -284,14 +265,14 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs using (var memoryStream = new MemoryStream()) { //保存成物理文件 - await file.CopyToAsync(memoryStream); + await file.CopyToAsync(memoryStream).ConfigureAwait(false); await _excelImportService.SaveBlobAsync( new SaveExcelImportInputDto { Name = _filename, Content = memoryStream.ToArray() } - ); + ).ConfigureAwait(false); } fileNameList.Add(getFileName); } @@ -305,14 +286,14 @@ namespace Win.Sfs.SettleAccount.Entities.TaskJobs Email = user.Email, Name = currentApplicationName, ServiceName = _serviceName, - InputConditions=customConditions + InputConditions = customConditions }; - var _taskId = await _backgroundJobManager.EnqueueAsync(args); + var _taskId = await _backgroundJobManager.EnqueueAsync(args).ConfigureAwait(false); var options = new JsonSerializerOptions { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; - await _mng.CreateAsync(new TaskJob(Guid.NewGuid(), _taskId, currentApplicationName, "通知", string.Empty, user.Name, user.Email, JsonSerializer.Serialize(fileNameList,options), JsonSerializer.Serialize(fileNameList,options), string.Empty, string.Empty, _serviceName,string.Empty,string.Empty)); + await _mng.CreateAsync(new TaskJob(Guid.NewGuid(), _taskId, currentApplicationName, "通知", string.Empty, user.Name, user.Email, JsonSerializer.Serialize(fileNameList, options), JsonSerializer.Serialize(fileNameList, options), string.Empty, string.Empty, _serviceName, string.Empty, string.Empty)).ConfigureAwait(false); args.TaskId = _taskId; if (endaction != null) { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs index d731ad35..95cd1e1d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Reports/ReportServices/ReportMakeService.cs @@ -1,35 +1,22 @@ -using Magicodes.ExporterAndImporter.Excel; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; - -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using SettleAccount.Job.Services; using SettleAccount.Job.Services.Report; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; -using Volo.Abp; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; -using Volo.Abp.Caching; using Volo.Abp.Uow; -using Win.Abp.Snowflakes; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.ItemInvoicePrices; using Win.Sfs.SettleAccount.Entities.MaterialRelationships; -using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.SettleAccounts; using Win.Sfs.SettleAccount.Entities.SettlementParts; using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.Entities.Wms; using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.Reports.ReportRequestDto; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace Win.Sfs.SettleAccount.Reports.ReportServices { @@ -60,12 +47,12 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices ISettleAccountBranchEfCoreRepository settlementPartVersionrepository, ISettleAccountBranchEfCoreRepository fisVersionrepository, ISettleAccountBranchEfCoreRepository itemInvoicePriceVersionrepository, - + IExcelImportAppService excelImportService, //ISnowflakeIdGenerator snowflakeIdGenerator, //ICommonManager commonManager, TaskJobService service - ) + ) { _relationshipRepository = relationshipRepository; _settlementPartVersionrepository = settlementPartVersionrepository; @@ -73,7 +60,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices _invoiceVersionRepository = invoiceVersionRepository; _fisVersionrepository = fisVersionrepository; _itemInvoicePriceVersionrepository = itemInvoicePriceVersionrepository; - + _service = service; } @@ -331,7 +318,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices [Route("SharePartUnSettledExport")] [DisableRequestSizeLimit] - public async Task SharePartUnSettled( string sapCode, string version, + public async Task SharePartUnSettled(string sapCode, string version, DateTime begin, DateTime end) { List customConditionList = new List(); @@ -342,11 +329,10 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices var _taskid = await _service.ExportEnqueueAsync("备件未结明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(SharePartUnSettledExport), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } - ///// ///// 结算总成和ERP总成价格对比 ///// @@ -373,7 +359,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices // 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) => // { @@ -381,9 +367,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices // return _taskid; //} - - - /// /// 看板未结输出 /// @@ -398,7 +381,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices [DisableRequestSizeLimit] public async Task KanbanUnSettled(string sapCode, string version, - DateTime begin, DateTime end,string materialGroup,string matialCode,string isContainVersion) + DateTime begin, DateTime end, string materialGroup, string matialCode, string isContainVersion) { List customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty }); @@ -411,11 +394,10 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices var _taskid = await _service.ExportEnqueueAsync("看板未结明细", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(KanBanUnSettledExport), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } - /// /// 1.大众发票与结算核对汇总表 /// @@ -424,23 +406,22 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices [HttpGet] [Route("InvoiceSettledDiff-Make")] [DisableRequestSizeLimit] - + public async Task InvoiceSettledDiffMake( - string year, string period, string version,string sapCode, string customerCode, string factory, string matialCode, string state + string year, string period, string version, string sapCode, string customerCode, string factory, string matialCode, string state ) { - List customConditionList = new List(); customConditionList.Add(new CustomCondition() { Name = "Version", Value = version ?? string.Empty }); customConditionList.Add(new CustomCondition() { Name = "MatialCode", Value = matialCode ?? string.Empty }); customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = sapCode ?? string.Empty }); customConditionList.Add(new CustomCondition() { Name = "ProjectName", Value = "结算与开票数据对比" }); customConditionList.Add(new CustomCondition() { Name = "Year", Value = year ?? DateTime.Now.Year.ToString() }); - var _taskid = await _service.ExportEnqueueAsync("发票与结算核对汇总表", ExportExtentsion.Excel,version,string.Empty ,CurrentUser, typeof(InvoiceSettledDiffExportService), customConditionList, (rs) => + var _taskid = await _service.ExportEnqueueAsync("发票与结算核对汇总表", ExportExtentsion.Excel, version, string.Empty, CurrentUser, typeof(InvoiceSettledDiffExportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } /// @@ -469,7 +450,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode }); var _taskid = await _service.ExportEnqueueAsync("", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } @@ -486,11 +467,10 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices BaseRequestDto request ) { - List customConditionList = new List(); - customConditionList.Add(new CustomCondition() { Name = "Version", Value =string.IsNullOrEmpty(request.Version) ?string.Empty:request.Version }); - customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(request.MaterialCode) ?string.Empty: request.MaterialCode }); + customConditionList.Add(new CustomCondition() { Name = "Version", Value = string.IsNullOrEmpty(request.Version) ? string.Empty : request.Version }); + customConditionList.Add(new CustomCondition() { Name = "MaterialCode", Value = string.IsNullOrEmpty(request.MaterialCode) ? string.Empty : request.MaterialCode }); customConditionList.Add(new CustomCondition() { Name = "BeginTime", Value = string.IsNullOrEmpty(request.Begin) ? string.Empty : request.Begin }); customConditionList.Add(new CustomCondition() { Name = "EndTime", Value = string.IsNullOrEmpty(request.End) ? string.Empty : request.End }); customConditionList.Add(new CustomCondition() { Name = "Cp7BeginTime", Value = string.IsNullOrEmpty(request.Cp7Begin) ? string.Empty : request.Cp7Begin }); @@ -500,9 +480,9 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup }); customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode }); - var _taskid = await _service.ExportEnqueueAsync("准时化结算核对明细", ExportExtentsion.Excel,request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) => + var _taskid = await _service.ExportEnqueueAsync("准时化结算核对明细", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(InvoiceSettledDetailDiffExportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } @@ -530,16 +510,12 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "ChassisNumber", Value = string.IsNullOrEmpty(request.ChassisNumber) ? string.Empty : request.ChassisNumber }); customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup }); customConditionList.Add(new CustomCondition() { Name = "SapCode", Value = string.IsNullOrEmpty(request.SapCode) ? string.Empty : request.SapCode }); - var _taskid = await _service.ExportEnqueueAsync("准时化结算数量差异比对输出", ExportExtentsion.Excel,request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) => + var _taskid = await _service.ExportEnqueueAsync("准时化结算数量差异比对输出", ExportExtentsion.Excel, request.Version, string.IsNullOrEmpty(request.MaterialGroup) ? string.Empty : request.MaterialGroup, CurrentUser, typeof(UnInvoiceSettledDetailDiffExportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } - - - - /// /// 准时化未结明细表(包含漏结,漏结要有标识) /// @@ -557,23 +533,22 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices { List customConditionList = new List(); - 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 = "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(UnsettledDetailReportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } - /// ///准时化未结差异比对表 /// @@ -598,7 +573,7 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices 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(UnSettleDiffExportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } @@ -621,12 +596,11 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices customConditionList.Add(new CustomCondition() { Name = "State", Value = string.IsNullOrEmpty(input.State) ? string.Empty : input.State }); var _taskid = await _service.ExportEnqueueAsync("出库单合计汇总输出", ExportExtentsion.Excel, input.Version, string.IsNullOrEmpty(input.MaterialGroup) ? string.Empty : input.MaterialGroup, CurrentUser, typeof(WmsOutputSumExportService), customConditionList, (rs) => { - }); + }).ConfigureAwait(false); return _taskid; } - ///// ///// 结算总成和ERP总成价格对比 ///// @@ -659,7 +633,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices // return _taskid; //} - ///// ///// 结算总成和ERP总成价格对比 ///// @@ -694,8 +667,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices //#region 红旗、一汽轿车的输出报表 - - ///// /////红旗工厂核对明细 ///// @@ -727,7 +698,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices // return _taskid; //} - ///// /////红旗工厂未结明细 ///// @@ -819,7 +789,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices // return _taskid; //} - //[HttpPost] //[Route("FisUpdateExportService")] //[DisableRequestSizeLimit] @@ -838,9 +807,6 @@ namespace Win.Sfs.SettleAccount.Reports.ReportServices // return _taskid; //} - - - ///// ///// 结算未结寄售核对表 ///// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountAppService.cs index 6eef028f..b0591b5a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountAppService.cs @@ -1,4 +1,4 @@ -using SettleAccount.Localization; +using SettleAccount.Localization; using Volo.Abp.Application.Services; namespace Win.Sfs.SettleAccount diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 3ccaa219..a061e4ef 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -3,19 +3,16 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Reflection; using AutoMapper; -using Newtonsoft.Json; using SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Boms; using Win.Sfs.SettleAccount.BTNotConsignReports; using Win.Sfs.SettleAccount.BTSeqKBDiffReports; -using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.Boms; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.Controls; -using Win.Sfs.SettleAccount.Entities.Errors; using Win.Sfs.SettleAccount.Entities.Factories; using Win.Sfs.SettleAccount.Entities.ImportColumnMaps; using Win.Sfs.SettleAccount.Entities.ImportMap; @@ -33,8 +30,6 @@ using Win.Sfs.SettleAccount.Entities.SettleAccountVersion; using Win.Sfs.SettleAccount.Entities.SettlementParts; using Win.Sfs.SettleAccount.Entities.StorageLocations; using Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts; -using Win.Sfs.SettleAccount.Entities.Wms.WmsSumOutput; -using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.EstimatedStockDiffReports; using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.HQNotConsignReports; @@ -51,7 +46,6 @@ using Win.Sfs.SettleAccount.SendUnsettledDiffReports; using Win.Sfs.SettleAccount.StockFisDiffReports; using Win.Sfs.SettleAccount.StockSettledDiffReports; using Win.Sfs.SettleAccount.StockUnsettledDiffReports; -using Win.Sfs.SettleAccount.SupplierItemSetUps; namespace Win.Sfs.SettleAccount { @@ -66,7 +60,6 @@ namespace Win.Sfs.SettleAccount CreateMapItemInvoicePrice(); CreateMapItemInvoicePriceVersion(); - CreateMapBom(); CreateMapBomVersion(); CreateMapInventoryDetail(); @@ -94,8 +87,6 @@ namespace Win.Sfs.SettleAccount CreateMapSecondaryActuralAdjustmentReport(); CreateMapSecondaryActuralDiffReport(); - - CreateMapBTSeqKBDiffReport(); CreateMapBTNotConsignReport(); CreateMapHQNotConsignReport(); @@ -113,7 +104,6 @@ namespace Win.Sfs.SettleAccount CreateMapPriceListBJVersion(); CreateMapPriceListBJ(); - #endregion #region 派格 CreateMapInvoice(); @@ -148,64 +138,44 @@ namespace Win.Sfs.SettleAccount CreateMapBBAC_CAN_SA(); - CreateMapBBAC_CAN_SA_DETAIL(); - CreateMapBBAC_NOT_SA_DETAIL(); - CreateMapHBPO_CAN_SA(); - CreateMapHBPO_CAN_SA_DETAIL(); - CreateMapHBPO_NOT_SA_DETAIL(); - CreateMapINVOICE_GRP(); - CreateMapINVOICE_MAP_GROUP(); - CreateMapINVOICE_NOT_SETTLE(); - CreateMapINVOICE_WAIT_DETAIL(); - CreateMapPUB_CAN_SA(); - CreateMapPUB_CAN_SA_DETAIL(); - CreateMapPUB_NOT_SA_DETAIL(); - - CreateMapPUB_ADJ_DETAIL(); CreateMapBBAC_PD(); CreateMapBBAC_PD_DETAIL(); - CreateMapHBPO_PD(); CreateMapHBPO_PD_DETAIL(); - CreateMapPUB_PD(); CreateMapPUB_PD_DETAIL(); CreateMapINVOICE_WAIT_DETAIL_EXTEND(); - - } #region BQ - - /// /// BBAC可结算 /// @@ -294,9 +264,6 @@ namespace Win.Sfs.SettleAccount } - - - private void CreateMapPUB_CAN_SA() { @@ -377,53 +344,12 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } - - #endregion - - - - #region 派格出库单 - - private void CreateMapWMSErrorBill() - { - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - } - - private void CreateMapWMSOutputSum() - { - CreateMap().ReverseMap(); - CreateMap().ReverseMap(); - } - private void CreateMapWMSDiffOutputSum() - { - CreateMap().ReverseMap(); - - } - private void CreateMapWMSCacelOutputSum() - { - CreateMap().ReverseMap(); - - } - /// - /// 有条码业务 - /// - private void CreateMapWMSWithCodeOutputSum() - { - CreateMap().ReverseMap(); - - } #endregion #region PG-派格映射 - - - /// /// 红旗明细未结导入 /// @@ -449,8 +375,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); } - - /// /// 大众发票导入 /// @@ -487,13 +411,10 @@ namespace Win.Sfs.SettleAccount CreateMap(); - - CreateMap(); CreateMap(); } - /// /// 大众准时化结算明细导入--版本 /// @@ -527,13 +448,6 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } - - - - - - - private void CreateMapPriceListVersion() { @@ -586,7 +500,6 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } - private void CreateMapInvoiceSettledDiff() { @@ -596,7 +509,6 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } - private void CreateMapInvoiceSettledDiffVersion() { @@ -606,13 +518,6 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); } - - - - - - - private void CreateMapEstimatedStockDiffReport() { CreateMap().ReverseMap(); @@ -621,13 +526,11 @@ namespace Win.Sfs.SettleAccount CreateMap(); CreateMap(); - CreateMap(); CreateMap(); CreateMap(); } - private void CreateMapSendUnsettledDiffReport() { CreateMap().ReverseMap(); @@ -646,14 +549,12 @@ namespace Win.Sfs.SettleAccount } - private void CreateMapStockSettledDiffReport() { CreateMap().ReverseMap(); CreateMap().ReverseMap(); ; CreateMap().ReverseMap(); ; - CreateMap().ReverseMap(); ; CreateMap(); @@ -692,8 +593,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); CreateMap(); - - CreateMap(); CreateMap(); CreateMap(); @@ -706,13 +605,11 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap().ReverseMap(); CreateMap(); } - private void CreateMapSecondaryActuralDiffReport() { CreateMap().ReverseMap(); @@ -721,12 +618,10 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); - CreateMap(); CreateMap(); } - private void CreateMapBom() { CreateMap().ReverseMap(); @@ -738,7 +633,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); } - private void CreateMapSettlementPart() { CreateMap().ReverseMap(); @@ -757,7 +651,6 @@ namespace Win.Sfs.SettleAccount } - private void CreateMapItemInvoicePrice() { CreateMap().ReverseMap(); @@ -776,9 +669,6 @@ namespace Win.Sfs.SettleAccount } - - - private void CreateMapBomVersion() { CreateMap().ReverseMap(); @@ -787,14 +677,8 @@ namespace Win.Sfs.SettleAccount CreateMap(); CreateMap(); - } - - - - - private void CreateMapInventoryDetail() { CreateMap().ReverseMap(); @@ -806,18 +690,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); } - private void CreateMapSupplierItemSetUp() - { - CreateMap().ReverseMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - CreateMap(); - } - - - private void CreateMapCodeSetting() { @@ -865,7 +737,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); } - private void CreateMapPrebatch() { CreateMap().ReverseMap(); @@ -884,7 +755,6 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); CreateMap(); - CreateMap(); CreateMap(); @@ -892,7 +762,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); } - private void CreateMapCustomerStorageLocation() { CreateMap().ReverseMap(); @@ -903,7 +772,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); } - private void CreateMapInventoryDetailVersion() { CreateMap().ReverseMap(); @@ -935,7 +803,6 @@ namespace Win.Sfs.SettleAccount CreateMap(); CreateMap(); - CreateMap(); CreateMap(); @@ -947,23 +814,17 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap().ReverseMap(); CreateMap(); } - - - - private void CreateMapHQNotConsignReport() { CreateMap().ReverseMap(); CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap().ReverseMap(); CreateMap(); } @@ -974,7 +835,6 @@ namespace Win.Sfs.SettleAccount CreateMap().ReverseMap(); CreateMap().ReverseMap(); - CreateMap().ReverseMap(); CreateMap(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationBase.cs index fbff4070..e5e01de5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationBase.cs @@ -1,10 +1,7 @@ -using Shouldly; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp; +using Shouldly; using Volo.Abp.Application.Services; using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; @@ -15,10 +12,7 @@ using Win.Sfs.SettleAccount.CommonManagers; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.ExcelImporter; using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.RepositoryBase; -using Win.Utils; -using IObjectMapper = Volo.Abp.ObjectMapping.IObjectMapper; namespace Win.Sfs.SettleAccount { @@ -38,7 +32,7 @@ namespace Win.Sfs.SettleAccount IDistributedCache cache, IExcelImportAppService excelImportService, ISnowflakeIdGenerator snowflakeIdGenerator, - ICommonManager commonManager ) + ICommonManager commonManager) { _excelImportService = excelImportService; _snowflakeIdGenerator = snowflakeIdGenerator; @@ -46,14 +40,13 @@ namespace Win.Sfs.SettleAccount Cache = cache; } - /// /// 输出报错信息 /// /// /// /// - protected async Task ExportErrorReportAsync(List errorList,string fileName="") + protected async Task ExportErrorReportAsync(List errorList, string fileName = "") { //没有信息返回成功 if (errorList == null || errorList.Count == 0) @@ -72,7 +65,7 @@ namespace Win.Sfs.SettleAccount //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(errorList); + var result = await _exportImporter.ExcelExporter(errorList).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -83,22 +76,19 @@ namespace Win.Sfs.SettleAccount Name = fileName, Content = result } - ); + ).ConfigureAwait(false); return fileName; } - - //public Task - /// /// 输出文件信息 /// /// /// /// - public async Task ExportFileAsync(List errorList, string fileNameTitle ,string extension= ApplicationConsts.FileExtension) where T:class,new() + public async Task ExportFileAsync(List errorList, string fileNameTitle, string extension = ApplicationConsts.FileExtension) where T : class, new() { //未命名给赋值默认值 if (string.IsNullOrEmpty(fileNameTitle)) @@ -106,14 +96,13 @@ namespace Win.Sfs.SettleAccount fileNameTitle = ApplicationConsts.DefaultExportFileName; } - //导出文件名称 - string fileName = CommonMethod.GetExcelFileNameByUserID(fileNameTitle, _snowflakeIdGenerator.Create().ToString(), extension); + string fileName = CommonMethod.GetExcelFileNameByUserID(fileNameTitle, _snowflakeIdGenerator.Create().ToString(), extension); //声明导出容器 ExportImporter _exportImporter = new ExportImporter(); - var result = await _exportImporter.ExcelExporter(errorList); + var result = await _exportImporter.ExcelExporter(errorList).ConfigureAwait(false); result.ShouldNotBeNull(); @@ -124,7 +113,7 @@ namespace Win.Sfs.SettleAccount Name = fileName, Content = result } - ); + ).ConfigureAwait(false); return fileName; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs index 934e41e5..5565299c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationModule.cs @@ -1,16 +1,14 @@ using System; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using SettleAccount.Job.Services.Report; using TaskJob.Interfaces; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AutoMapper; -using Volo.Abp.BlobStoring; using Volo.Abp.BlobStoring.Minio; using Volo.Abp.Dapper; -using Volo.Abp.Emailing.Smtp; using Volo.Abp.Emailing; +using Volo.Abp.Emailing.Smtp; using Volo.Abp.Http.Client.IdentityModel; using Volo.Abp.Identity; using Volo.Abp.Modularity; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxHelper.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxHelper.cs index c6fcb697..0e76efd6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxHelper.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxHelper.cs @@ -2,47 +2,48 @@ using Microsoft.Extensions.Configuration; using SqlSugar; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; -namespace Win.Sfs.SettleAccount.influxdb; - -public class InfluxHelper +namespace Win.Sfs.SettleAccount.influxdb { - private readonly IConfiguration _configuration; - private readonly string _database = "vmi"; - - public InfluxHelper(IConfiguration configuration) + public class InfluxHelper { - this._configuration = configuration; - } + private readonly IConfiguration _configuration; + private readonly string _database = "vmi"; - public void Start() - { - var db = GetClient(); - db.DbMaintenance.CreateDatabase(); - db.CodeFirst.InitTables(); - } + public InfluxHelper(IConfiguration configuration) + { + this._configuration = configuration; + } - public ISugarQueryable Query() - { - var db = GetClient(); - return db.Queryable(); - } + public void Start() + { + var db = GetClient(); + db.DbMaintenance.CreateDatabase(); + db.CodeFirst.InitTables(); + } - public void Insert(T entity) where T : class, new() - { - var db = GetClient(); - db.Insertable(entity).ExecuteCommand(); - } + public ISugarQueryable Query() + { + var db = GetClient(); + return db.Queryable(); + } - private SqlSugarClient GetClient() - { - var connectionString = _configuration.GetConnectionString("questdb") ?? $"host=localhost;port=8812;username=admin;password=quest;database={this._database};ServerCompatibilityMode=NoTypeLoading;"; - var db = new SqlSugarClient(new ConnectionConfig + public void Insert(T entity) where T : class, new() + { + var db = GetClient(); + db.Insertable(entity).ExecuteCommand(); + } + + private SqlSugarClient GetClient() { - ConnectionString = connectionString, - DbType = DbType.QuestDB, - InitKeyType = InitKeyType.Attribute, - IsAutoCloseConnection = true, - }); - return db; + var connectionString = _configuration.GetConnectionString("questdb") ?? $"host=localhost;port=8812;username=admin;password=quest;database={this._database};ServerCompatibilityMode=NoTypeLoading;"; + var db = new SqlSugarClient(new ConnectionConfig + { + ConnectionString = connectionString, + DbType = DbType.QuestDB, + InitKeyType = InitKeyType.Attribute, + IsAutoCloseConnection = true, + }); + return db; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxQueryResult.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxQueryResult.cs index 7f2d6dc2..d0164f42 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxQueryResult.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/influxdb/InfluxQueryResult.cs @@ -1,28 +1,29 @@ using System.Collections.Generic; -namespace Win.Sfs.SettleAccount.influxdb; - -public class InfluxQueryResult +namespace Win.Sfs.SettleAccount.influxdb { - public List results { get; set; } = new List(); -} + public class InfluxQueryResult + { + public List results { get; set; } = new List(); + } -public class InfluxResult -{ - public string statement_id { get; set; } - public List messages { get; set;} = new List(); - public List series { get; set; } = new List(); -} + public class InfluxResult + { + public string statement_id { get; set; } + public List messages { get; set; } = new List(); + public List series { get; set; } = new List(); + } -public class InfluxMessage -{ - public string level { get; set; } - public string text { get; set; } -} + public class InfluxMessage + { + public string level { get; set; } + public string text { get; set; } + } -public class InfluxSeries -{ - public string name { get; set; } - public List columns { get; set; } = new List(); - public List> values { get; set; } = new List>(); + public class InfluxSeries + { + public string name { get; set; } + public List columns { get; set; } = new List(); + public List> values { get; set; } = new List>(); + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ExportExtentsion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ExportExtentsion.cs index 984bfdff..26691936 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ExportExtentsion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ExportExtentsion.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount { public enum ExportExtentsion { - Excel=0, + Excel = 0, Csv } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ImportProjectAttribute.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ImportProjectAttribute.cs index e822d44c..b09a62cd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ImportProjectAttribute.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ImportProjectAttribute.cs @@ -1,9 +1,9 @@ -using System; +using System; -public class ImportProjectAttribute:Attribute +public class ImportProjectAttribute : Attribute { - public ImportProjectAttribute() - { - } - public string Name { set; get; } + public ImportProjectAttribute() + { + } + public string Name { set; get; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Localization/SettleAccountResource.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Localization/SettleAccountResource.cs index e42065b3..0c8fe806 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Localization/SettleAccountResource.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/Localization/SettleAccountResource.cs @@ -1,10 +1,10 @@ -using Volo.Abp.Localization; +using Volo.Abp.Localization; namespace SettleAccount.Localization { [LocalizationResourceName("SettleAccount")] public class SettleAccountResource { - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ModuleName.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ModuleName.cs index 557513da..54b6bcdf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ModuleName.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/ModuleName.cs @@ -1,16 +1,3 @@ -using OfficeOpenXml; -using OfficeOpenXml.Style; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Drawing.Drawing2D; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount { public class SettleAccountModuleName @@ -33,11 +20,5 @@ namespace Win.Sfs.SettleAccount //public const string Bom = "Bom"; //public const string Bom = "Bom"; } - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountDomainSharedModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountDomainSharedModule.cs index 1cc20656..63cb4b49 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountDomainSharedModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountDomainSharedModule.cs @@ -1,7 +1,7 @@ -using Volo.Abp.Modularity; -using Volo.Abp.Localization; using SettleAccount.Localization; +using Volo.Abp.Localization; using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Modularity; using Volo.Abp.Validation; using Volo.Abp.Validation.Localization; using Volo.Abp.VirtualFileSystem; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountErrorCodes.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountErrorCodes.cs index 09db1ef7..dcf4f40e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountErrorCodes.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccountErrorCodes.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.SettleAccount +namespace Win.Sfs.SettleAccount { public static class SettleAccountErrorCodes { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskState.cs index eaac0b3b..a7f321f5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskState.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskState.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount { public enum TaskState { - Waiting=0, + Waiting = 0, Execution, Complete } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskType.cs index 2aa7a120..70edb848 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/TaskType.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount { public enum TaskType diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs index 60a0965e..41715237 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/BaseDomainServices/BaseDomainService.cs @@ -1,23 +1,16 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Caching; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Bases; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Volo.Abp.Guids; using Volo.Abp.ObjectMapping; using Win.Sfs.SettleAccount.Boms; -using Win.Sfs.SettleAccount.CommonManagers; -using Win.Sfs.SettleAccount.Entities.ImportMap; using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; @@ -38,51 +31,47 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices INormalEfCoreRepository bomshipRepository, INormalEfCoreRepository priceRepository, INormalEfCoreRepository pricebjRepository - //IExcelImportAppService excelImportService, - //ISnowflakeIdGenerator snowflakeIdGenerator, - //ICommonManager commonManager + //IExcelImportAppService excelImportService, + //ISnowflakeIdGenerator snowflakeIdGenerator, + //ICommonManager commonManager ) { _priceRepository = priceRepository; - _pricebjRepository= pricebjRepository; + _pricebjRepository = pricebjRepository; _materialRepository = materialRepository; _relationshipRepository = relationshipRepository; _bomshipRepository = bomshipRepository; } - public async Task> GetMaterialList() + public async Task> GetMaterialList() { List ls = new List(); - var lst = await _relationshipRepository.Where(p => !string.IsNullOrEmpty(p.SettleMaterialCode)).ToListAsync(); + var lst = await _relationshipRepository.Where(p => !string.IsNullOrEmpty(p.SettleMaterialCode)).ToListAsync().ConfigureAwait(false); - var l=lst.GroupBy(p => p.SettleMaterialCode).Select(g=> g.First()); + var l = lst.GroupBy(p => p.SettleMaterialCode).Select(g => g.First()); return l.ToList(); } public static async Task DoWorkBulkWithTransaction(DbContext dbContext, Action p_dowork) { - using (var transaction = await dbContext.Database.BeginTransactionAsync()) + using (var transaction = await dbContext.Database.BeginTransactionAsync().ConfigureAwait(false)) { try { // 执行批量数据操作 p_dowork(); // 提交事务 - await transaction.CommitAsync(); + await transaction.CommitAsync().ConfigureAwait(false); } catch (Exception) { // 回滚事务 - await transaction.RollbackAsync(); + await transaction.RollbackAsync().ConfigureAwait(false); throw; } } } - - - - public async Task> CheckBase(List p_list, BASE_CONF p_config) { List errorList = new List(); @@ -90,7 +79,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices if (p_config.IsBom == true) { - var bomList = await _bomshipRepository.ToListAsync(); + var bomList = await _bomshipRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in bomList on itm equals itm1.ParentItemCode into temp @@ -104,7 +93,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices } if (p_config.IsMaterial == true) { - var materialList = await _materialRepository.ToListAsync(); + var materialList = await _materialRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in materialList on itm equals itm1.MaterialCode into temp @@ -118,7 +107,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices } if (p_config.IsRelationShip == true) { - var materialList = await _relationshipRepository.ToListAsync(); + var materialList = await _relationshipRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in materialList on itm equals itm1.SettleMaterialCode into temp @@ -141,7 +130,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices if (p_config.IsBom == true) { - var bomList = await _bomshipRepository.ToListAsync(); + var bomList = await _bomshipRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in bomList on itm equals itm1.ParentItemCode into temp @@ -156,7 +145,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices } if (p_config.IsMaterial == true) { - var materialList = await _materialRepository.ToListAsync(); + var materialList = await _materialRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in materialList on itm equals itm1.MaterialCode into temp @@ -170,7 +159,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices } if (p_config.IsRelationShip == true) { - var materialList = await _relationshipRepository.ToListAsync(); + var materialList = await _relationshipRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in materialList on itm equals itm1.SettleMaterialCode into temp @@ -185,7 +174,7 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices } if (p_config.IsRelationShip == true) { - var materialList = await _relationshipRepository.ToListAsync(); + var materialList = await _relationshipRepository.ToListAsync().ConfigureAwait(false); var query = from itm in partList join itm1 in materialList on itm equals itm1.SettleMaterialCode into temp @@ -211,13 +200,15 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices { List prices = new List(); if (priceList.Count <= 1) + { return prices; // 只有一个或零个价格条目 + } var sortedList = priceList.OrderBy(item => item.BeginTime).ToList(); for (int i = 1; i < sortedList.Count; i++) { - if (sortedList[i].LU== sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) + if (sortedList[i].LU == sortedList[i - 1].LU && sortedList[i].BeginTime != sortedList[i - 1].EndTime.AddDays(1)) { prices.Add(sortedList[i]); } @@ -225,20 +216,19 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices return prices; // 所有价格时间都连续 } - public static bool IsTimeOverlap(PriceList range1, PriceList range2) { return range1.BeginTime <= range2.EndTime && range1.EndTime >= range2.BeginTime; } - public async Task> CheckPriceList(List p_list,string p_site,bool isBj=false) - where TEntity : ISA_BASE,new() + public async Task> CheckPriceList(List p_list, string p_site, bool isBj = false) + where TEntity : ISA_BASE, new() { List errorList = new List(); if (isBj == true) { var pricebjlist = _pricebjRepository.Where(p => p.ClientCode == p_site && p.IsCancel == false).ToList(); - + var inner = from d in p_list join p in pricebjlist on d.LU equals p.LU where @@ -252,13 +242,11 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices select d; errorList = left.ToList(); - } else { - var pricelist = _priceRepository.Where(p=>p.ClientCode==p_site && p.IsCancel==false).ToList(); - - + var pricelist = _priceRepository.Where(p => p.ClientCode == p_site && p.IsCancel == false).ToList(); + var inner = from d in p_list join p in pricelist on d.LU equals p.LU where @@ -276,8 +264,6 @@ namespace Win.Sfs.SettleAccount.Bases.DomainServices return errorList; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs index bc777b29..63f0f814 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/EntityBase.cs @@ -1,19 +1,10 @@ using System; -using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.Validation; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -using Win.Sfs.SettleAccount.Entities.SettleAccountDomain; using Win.Sfs.SettleAccount.Enums; -using static System.Runtime.CompilerServices.RuntimeHelpers; namespace SettleAccount.Bases { @@ -41,14 +32,12 @@ namespace SettleAccount.Bases } - public class SA_CAN_BASE_MAIN : AuditedAggregateRoot { public SA_CAN_BASE_MAIN() { } public SA_CAN_BASE_MAIN(Guid id) : base(id) { } - [Display(Name = "期间")] public virtual int Version { get; set; } @@ -69,20 +58,15 @@ namespace SettleAccount.Bases [Display(Name = "发票分组号")] public virtual string InvGroupNum { get; set; } = null!; - public virtual string Site { get; set; } - public virtual void SetId(Guid guid) { Id = guid; } - - } - public class PD_BASE_MAIN : FullAuditedAggregateRoot { public PD_BASE_MAIN() @@ -97,7 +81,6 @@ namespace SettleAccount.Bases [Display(Name = "关联结算单号")] public virtual string SettleBillNum { get; set; } = null!; - /// /// 可结算单状态 /// @@ -117,16 +100,6 @@ namespace SettleAccount.Bases } - - - - - - - - - - public interface ISA_BASE : ISBASE { /// @@ -151,8 +124,6 @@ namespace SettleAccount.Bases /// public string GroupNum { set; get; } - - } public interface ISA_CAN_BASE : ISBASE @@ -220,7 +191,6 @@ namespace SettleAccount.Bases /// public string WmsBillNum { set; get; } - } public class RE_BASE : FullAuditedAggregateRoot, IRE_BASE @@ -253,14 +223,8 @@ namespace SettleAccount.Bases /// public string KeyCode { get; set; } - - } - - - - public interface ISE_BASE : ISBASE { /// @@ -325,7 +289,6 @@ namespace SettleAccount.Bases public bool IsPriceList { set; get; } - public BASE_CONF(bool isRelationShip, bool isMaterial, bool isBom) { IsRelationShip = isRelationShip; @@ -338,9 +301,6 @@ namespace SettleAccount.Bases } } - - - public class SA_BASE : AuditedAggregateRoot, ISA_BASE { public SA_BASE() { } @@ -461,7 +421,6 @@ namespace SettleAccount.Bases public string PartCode { get; set; } public string RealPartCode { get; set; } - public string Site { get; set; } //public SA_CAN_BASE(int version, decimal price, string billNum, DateTime settleDate, string invGroupNum, string lU, string pN, string keyCode, decimal qty, string groupNum) @@ -479,11 +438,6 @@ namespace SettleAccount.Bases //} } - - - - - public class SA_NOT_BASE : AuditedAggregateRoot, ISA_BASE { public SA_NOT_BASE() @@ -531,7 +485,6 @@ namespace SettleAccount.Bases /// public string GroupNum { get; set; } - public string PartCode { get; set; } /// /// 业务分类 @@ -560,7 +513,6 @@ namespace SettleAccount.Bases //} } - public class SE_BASE : FullAuditedAggregateRoot, ISE_BASE { /// @@ -643,8 +595,6 @@ namespace SettleAccount.Bases /// public string GroupNum { set; get; } - - public EnumBusinessType BusinessType { set; get; } /// @@ -683,8 +633,6 @@ namespace SettleAccount.Bases /// public string Extend4 { get; set; } - - } public class JisSeBase : SE_BASE diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs index b779209e..e60c7210 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/OrderNumberGenerator.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; +using System; using System.Threading; -using System.Threading.Tasks; namespace Win.Sfs.SettleAccount.Bases { @@ -16,7 +12,7 @@ namespace Win.Sfs.SettleAccount.Bases public class OrderNumberGenerator { private static readonly object lockObject = new object(); - private static int sequence = 0; + private static int sequence; /// /// 生成单号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootBase.cs index 08b6a360..7821ba2f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootBase.cs @@ -1,12 +1,11 @@ -using System; -using Volo.Abp; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Bases { public abstract class SettleAccountDocumentRootBase : FullAuditedDocumentBase { - protected SettleAccountDocumentRootBase(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id) + protected SettleAccountDocumentRootBase(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id) { DocumentNumber = documentNumber; Year = year; @@ -34,13 +33,11 @@ namespace Win.Sfs.SettleAccount.Bases /// public string Period { set; get; } - /// /// 版本 /// public string Version { set; get; } - ///// ///// 地点 ///// @@ -55,16 +52,11 @@ namespace Win.Sfs.SettleAccount.Bases /// public string CustomName { get; set; } - - - /// /// 统计人名称 /// //[Display(Name = "统计人名称")] public string CreatorName { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootDetailBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootDetailBase.cs index f7beefa5..6ecb29a1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootDetailBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentRootDetailBase.cs @@ -1,14 +1,11 @@ -using Win.Sfs.Shared.Enums; - namespace Win.Sfs.Shared.DomainBase { - public abstract class SettleAccountDocumentRootDetailBase : FullAuditedEntityBase,IDocumentNumber + public abstract class SettleAccountDocumentRootDetailBase : FullAuditedEntityBase, IDocumentNumber { protected SettleAccountDocumentRootDetailBase() { } public SettleAccountDocumentRootDetailBase(TKey id) : base(id) { } - /// /// 年度 /// @@ -19,12 +16,10 @@ namespace Win.Sfs.Shared.DomainBase /// public string Period { set; get; } - /// /// 版本 /// public string Version { set; get; } - /// /// 单据ID @@ -36,19 +31,15 @@ namespace Win.Sfs.Shared.DomainBase /// public string DocumentNumber { get; set; } - - ///// ///// 物品ID ///// //public TKey ItemId { get; set; } - - ///// ///// 物品Code ///// //public string ItemCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentTimeRootBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentTimeRootBase.cs index 1a86120f..1e616be4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentTimeRootBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Bases/SettleAccountDocumentTimeRootBase.cs @@ -1,16 +1,15 @@ -using System; -using Volo.Abp; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Bases { public abstract class SettleAccountDocumentTimeRootBase : FullAuditedDocumentBase { - protected SettleAccountDocumentTimeRootBase(Guid id, Guid branchId, string documentNumber, DateTime beginTime, DateTime endTime, string customCode, string customName, string remark,string creatorName) : base(id) + protected SettleAccountDocumentTimeRootBase(Guid id, Guid branchId, string documentNumber, DateTime beginTime, DateTime endTime, string customCode, string customName, string remark, string creatorName) : base(id) { DocumentNumber = documentNumber; BeginTime = beginTime; - EndTime = endTime; + EndTime = endTime; CustomCode = customCode; CustomName = customName; @@ -30,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Bases //[Display(Name = "统计时间起")] public DateTime BeginTime { get; set; } - /// /// 统计时间止 /// @@ -38,9 +36,6 @@ namespace Win.Sfs.SettleAccount.Bases //[Display(Name = "统计时间止")] public DateTime EndTime { get; set; } - - - /// /// 客户编码 /// @@ -55,7 +50,5 @@ namespace Win.Sfs.SettleAccount.Bases /// public string CreatorName { get; set; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs index 210f8fd6..b50d3e1c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_CAN_SA.cs @@ -1,169 +1,161 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "BBAC可结算导入")] -public class BBAC_CAN_SA : SA_CAN_BASE_MAIN +namespace SettleAccount.Domain.BQ { - - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单据")] - //public string BillNum { get; set; } = null!; - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - - ///// - ///// 1、新建 2、已有出库3、已有扣减寄售库 - ///// - //[Display(Name = "状态")] - //public SettleBillState State { get; set; } - - ///// - ///// 明细记录行数 - ///// - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - public EnumBusinessType BusinessType { get; set; } - public BBAC_CAN_SA() - { - - } - - - public BBAC_CAN_SA(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site, EnumBusinessType businessType) :base(guid) + [Display(Name = "BBAC可结算导入")] + public class BBAC_CAN_SA : SA_CAN_BASE_MAIN { - - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - State = state; - InvGroupNum = invGroupNum; - Site = site; - BusinessType = businessType; - } - - -} + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public EnumBusinessType BusinessType { get; set; } + public BBAC_CAN_SA() + { + + } + + public BBAC_CAN_SA(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum, string site, EnumBusinessType businessType) : base(guid) + { + + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + BusinessType = businessType; + } -[Display(Name = "BBAC可结算导入明细")] -public class BBAC_CAN_SA_DETAIL: SA_CAN_BASE -{ - ///// - ///// 对应字段(Material+ExternalCalNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - ///// - ///// 对应字段Material - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段ExternalCalNumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 选择工厂导入 - /// - //[Display(Name = "工厂地点")] - //public string Site { get; set; } = null!; - - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - /// - /// 匹配价格表对应区间对应地点带出 - /// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - /// - /// 对应字段MovementType,996正常,997为退货 - /// - [Display(Name = "是否退货")] - public bool IsReturn { get; set; } =false; - - - [Display(Name="SA")] - public string ContractDocID { get; set; } - - - - - - - /// - /// 对应字段PostingDate - /// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - /// - /// 对应字段Reference - /// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - /// - /// 是否是买单件 - /// - [Display(Name = "是否是买单件")] - public bool IsMaiDan { get; set; } - - public BBAC_CAN_SA_DETAIL() - { - } - public BBAC_CAN_SA_DETAIL(Guid guid,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, bool isReturn, - DateTime settleDate, string groupNum, string invGroupNum - ,string contactid,string invbillnum,string partcode - ):base(guid) + [Display(Name = "BBAC可结算导入明细")] + public class BBAC_CAN_SA_DETAIL : SA_CAN_BASE { - InvbillNum = invbillnum; - PartCode=partcode; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - BusinessType = category; - IsReturn = isReturn; - SettleDate = settleDate; - GroupNum = groupNum; - InvGroupNum = invGroupNum; - ContractDocID = contactid; + ///// + ///// 对应字段(Material+ExternalCalNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 对应字段Material + ///// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段ExternalCalNumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 选择工厂导入 + /// + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; + + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + /// + /// 匹配价格表对应区间对应地点带出 + /// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + /// + /// 对应字段MovementType,996正常,997为退货 + /// + [Display(Name = "是否退货")] + public bool IsReturn { get; set; } = false; + + [Display(Name = "SA")] + public string ContractDocID { get; set; } + + /// + /// 对应字段PostingDate + /// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + /// + /// 对应字段Reference + /// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + /// + /// 是否是买单件 + /// + [Display(Name = "是否是买单件")] + public bool IsMaiDan { get; set; } + + public BBAC_CAN_SA_DETAIL() + { + + } + + public BBAC_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, bool isReturn, + DateTime settleDate, string groupNum, string invGroupNum + , string contactid, string invbillnum, string partcode + ) : base(guid) + { + InvbillNum = invbillnum; + PartCode = partcode; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + BusinessType = category; + IsReturn = isReturn; + SettleDate = settleDate; + GroupNum = groupNum; + InvGroupNum = invGroupNum; + ContractDocID = contactid; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs index 265401a1..166c79ce 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_NOT_SA_DETAIL.cs @@ -1,114 +1,115 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - - -[Display(Name = "BBAC不可结算导入明细")] -public class BBAC_NOT_SA_DETAIL:SA_NOT_BASE -{ - ///// - ///// 对应字段(Material+ExternalCalNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; - - ///// - ///// 对应字段Material - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段ExternalCalNumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间对应地点带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - /// - /// 对应字段MovementType,996正常,997为退货 - /// - [Display(Name = "是否退货")] - public bool IsReturn { get; set; } =false; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - ///// - ///// 对应字段PostingDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - /// - /// 对应字段Reference - /// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - [Display(Name = "合同号")] - public string ContractDocID { get; set; } - - /// - /// 是否是买单件 - /// - [Display(Name = "是否是买单件")] - public bool IsMaiDan { get; set; } - - public BBAC_NOT_SA_DETAIL() - { - - } +namespace SettleAccount.Domain.BQ +{ - public BBAC_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, bool isReturn, string invGroupNum, DateTime settleDate, string groupNum,string contractDocID,string partcode) + [Display(Name = "BBAC不可结算导入明细")] + public class BBAC_NOT_SA_DETAIL : SA_NOT_BASE { - Id = guid; - - KeyCode = keyCode; - Version = version; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - BusinessType = category; - IsReturn = isReturn; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - GroupNum = groupNum; - ContractDocID = contractDocID; - PartCode = partcode; + ///// + ///// 对应字段(Material+ExternalCalNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string SettleBillNum { get; set; } = null!; + + ///// + ///// 对应字段Material + ///// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段ExternalCalNumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 选择工厂导入 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间对应地点带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + /// + /// 对应字段MovementType,996正常,997为退货 + /// + [Display(Name = "是否退货")] + public bool IsReturn { get; set; } = false; + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + ///// + ///// 对应字段PostingDate + ///// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + /// + /// 对应字段Reference + /// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + [Display(Name = "合同号")] + public string ContractDocID { get; set; } + + /// + /// 是否是买单件 + /// + [Display(Name = "是否是买单件")] + public bool IsMaiDan { get; set; } + + public BBAC_NOT_SA_DETAIL() + { + + } + + public BBAC_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, EnumBusinessType category, bool isReturn, string invGroupNum, DateTime settleDate, string groupNum, string contractDocID, string partcode) + { + Id = guid; + + KeyCode = keyCode; + Version = version; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + BusinessType = category; + IsReturn = isReturn; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + GroupNum = groupNum; + ContractDocID = contractDocID; + PartCode = partcode; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs index 0053f055..a3b018c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD.cs @@ -1,46 +1,44 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "BBAC待扣减")] -public class BBAC_PD : PD_BASE_MAIN +namespace SettleAccount.Domain.BQ { - - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单据")] - //public string BillNum { get; set; } = null!; - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - ///// - ///// 1、新建 2、已有出库3、已有扣减寄售库 - ///// - //[Display(Name = "状态")] - //public SettleBillState State { get; set; } - ///// - ///// 明细记录行数 - ///// - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - public BBAC_PD() - { - - } - public BBAC_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site) + [Display(Name = "BBAC待扣减")] + public class BBAC_PD : PD_BASE_MAIN { - Id = guid; - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - State = state; - InvGroupNum = invGroupNum; - Site = site; - } -} + //[Display(Name = "期间")] + //public int Version { get; set; } + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public BBAC_PD() + { + } + public BBAC_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum, string site) + { + Id = guid; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs index 38c84905..2aca0a74 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_PD_DETAIL.cs @@ -1,83 +1,83 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "BBAC待扣减实体")] -public class BBAC_PD_DETAIL:PD_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+ASN单号")] - //public string KeyCode { get; set; } = null!; + [Display(Name = "BBAC待扣减实体")] + public class BBAC_PD_DETAIL : PD_BASE + { + //[Display(Name = "LU+ASN单号")] + //public string KeyCode { get; set; } = null!; - //[Display(Name = "期间")] - //public int Version { get; set; } + //[Display(Name = "期间")] + //public int Version { get; set; } - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; - //[Display(Name = "替换零件号")] - //public string RELU { get; set; } = null!; + //[Display(Name = "替换零件号")] + //public string RELU { get; set; } = null!; - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; - //[Display(Name = "替换生产号")] - //public string REPN { get; set; } = null!; + //[Display(Name = "替换生产号")] + //public string REPN { get; set; } = null!; - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } - //[Display(Name = "单价")] - //public decimal Price { get; set; } + //[Display(Name = "单价")] + //public decimal Price { get; set; } - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + public bool IsMaiDan { get; set; } - public bool IsMaiDan { get; set; } + public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum + , string extend1, string extend2, string extend3, string extend4, EnumBusinessType p_businessType) - public BBAC_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum - ,string extend1,string extend2,string extend3,string extend4,EnumBusinessType p_businessType) + { + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + RELU = rELU; + PN = pN; + REPN = rEPN; + Site = site; + Qty = qty; + Price = price; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + GroupNum = groupNum; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Extend4 = extend4; + BusinessType = p_businessType; - - { - Id = guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - RELU = rELU; - PN = pN; - REPN = rEPN; - Site = site; - Qty = qty; - Price = price; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - GroupNum = groupNum; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - Extend4 = extend4; - BusinessType = p_businessType; + } - } + public BBAC_PD_DETAIL() + { - public BBAC_PD_DETAIL() - { - + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs index 343e8156..f06522e8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SA.cs @@ -1,151 +1,150 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - - -[Display(Name = "BBAC结算导入")] -public class BBAC_SA : AuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "结算单据")] - - public string BillNum { get; set; } = null!; - - [Display(Name = "出库单号")] - public string DNBillNum { get; set; } = null!; - - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public string State { get; set; } = null!; - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumBusinessType BusinessType { get; set; } - - public BBAC_SA(Guid guid, int version, string billNum, string dNBillNum, string state):base(guid) - { - - Version = version; - BillNum = billNum; - DNBillNum = dNBillNum; - State = state; - } - public BBAC_SA() : base() - { - - - } - - -} -[Display(Name = "BBAC结算导入明细")] -public class BBAC_SA_DETAIL:SA_BASE -{ - /// - /// 对应字段(Material+ExternalCalNumber) - /// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - - /// - /// 对应字段Material - /// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - /// - /// 对应字段ExternalCalNumber - /// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间对应地点带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - /// - /// ExternalCallNumber包含(R0)为买单件 1为JIS 2.为买单件 - /// - [Display(Name = "业务类别")] - public string Category { get; set; } = null!; - - /// - /// 对应字段MovementType,996正常,997为退货 - /// - [Display(Name = "是否退货")] - public string IsReturn { get; set; } = null!; - /// - /// ContractDocID - /// - [MaxLength(100)] - public string ContractDocID { get; set; } - - public BBAC_SA_DETAIL(Guid p_guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, string category, string isReturn, DateTime settleDate, string groupNum, string invGroupNum):base(p_guid) + [Display(Name = "BBAC结算导入")] + public class BBAC_SA : AuditedAggregateRoot { - - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - Category = category; - IsReturn = isReturn; - SettleDate = settleDate; - GroupNum = groupNum; - //InvGroupNum = invGroupNum; - } + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "结算单据")] + + public string BillNum { get; set; } = null!; + + [Display(Name = "出库单号")] + public string DNBillNum { get; set; } = null!; + + /// + /// 1、新建 2、已有出库3、已有扣减寄售库 + /// + [Display(Name = "状态")] + public string State { get; set; } = null!; + /// + /// 选择工厂导入 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumBusinessType BusinessType { get; set; } + + public BBAC_SA(Guid guid, int version, string billNum, string dNBillNum, string state) : base(guid) + { + + Version = version; + BillNum = billNum; + DNBillNum = dNBillNum; + State = state; + } + public BBAC_SA() : base() + { + + } - public BBAC_SA_DETAIL():base() - { - } + [Display(Name = "BBAC结算导入明细")] - public void SetId(Guid id) + public class BBAC_SA_DETAIL : SA_BASE { - Id = id; + /// + /// 对应字段(Material+ExternalCalNumber) + /// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + + /// + /// 对应字段Material + /// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + /// + /// 对应字段ExternalCalNumber + /// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 选择工厂导入 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间对应地点带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + /// + /// ExternalCallNumber包含(R0)为买单件 1为JIS 2.为买单件 + /// + [Display(Name = "业务类别")] + public string Category { get; set; } = null!; + + /// + /// 对应字段MovementType,996正常,997为退货 + /// + [Display(Name = "是否退货")] + public string IsReturn { get; set; } = null!; + /// + /// ContractDocID + /// + [MaxLength(100)] + public string ContractDocID { get; set; } + + public BBAC_SA_DETAIL(Guid p_guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, string category, string isReturn, DateTime settleDate, string groupNum, string invGroupNum) : base(p_guid) + { + + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + Category = category; + IsReturn = isReturn; + SettleDate = settleDate; + GroupNum = groupNum; + //InvGroupNum = invGroupNum; + } + + public BBAC_SA_DETAIL() : base() + { + + } + + public void SetId(Guid id) + { + Id = id; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SEC_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SEC_DETAIL.cs index 257a1276..ee3bfff4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SEC_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SEC_DETAIL.cs @@ -1,166 +1,161 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Entities.BQ; -public class BBAC_SEC_DETAIL : FullAuditedAggregateRoot +namespace Win.Sfs.SettleAccount.Entities.BQ { - /// - /// 类别 - /// 有结算有发运 - /// 有结算无发运 - /// 无结算有发运 - /// - [Display(Name = "类别")] - [ExporterHeader(DisplayName = "类别")] - [ValueMapping("有结算有发运", 1)] - [ValueMapping("有结算无发运", 2)] - [ValueMapping("无结算有发运", 3)] - public EnumPubSaSeCompareCategory Category { get; set; } - - /// - /// Wms发货单号 - /// - [Display(Name = "Wms发货单号")] - [ExporterHeader(DisplayName = "交货单号")] - public string WmsBillNum { get; set; } - - /// - /// - /// - [Display(Name = "发货日期")] - [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime ShippingDate { get; set; } - - /// - /// 生产码 - /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "ASN发货单号")] - public string PN { get; set; } - - /// - /// 物料号 - /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string MaterialNumber { get; set; } - - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - - /// - /// 原始LU - /// - [Display(Name = "原始LU")] - [ExporterHeader(DisplayName = "原始LU")] - public string PrimitiveLU { get; set; } - - /// - ///替换LU - /// - [Display(Name = "替换LU")] - [ExporterHeader(DisplayName = "替换LU")] - public string ReplaceLU { get; set; } - - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - [ExporterHeader(DisplayName = "客户下线时间")] - public DateTime CustomerOfflineTime { get; set; } - - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ExporterHeader(DisplayName = "结算数量")] - public decimal SAQty { get; set; } - - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } - - /// - /// 差异数量 - /// - [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty { set; get; } - - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - public string MateType { get; set; } - - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价")] - public decimal FixPrice { get; set; } - - /// - /// 日顺序号 - /// - [Display(Name = "日顺序号")] - [ExporterHeader(DisplayName = "日顺序号")] - public string SeqNumber { get; set; } - - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - [ExporterHeader(DisplayName = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } - - - - /// - /// PJIS日顺序号 - /// - [Display(Name = "库位")] - [ExporterHeader(DisplayName = "库位")] - public string ErpLoc { get; set; } - - - public BBAC_SEC_DETAIL(Guid guid, EnumPubSaSeCompareCategory category, string wmsBillNum, DateTime shippingDate, string pN, string materialNumber, string materialDes, string primitiveLU, string replaceLU, DateTime customerOfflineTime, decimal sAQty, decimal sEQty, decimal diffQty, string mateType, decimal fixPrice, string seqNumber, string pJISSeqNumber,string erploc) - { - Id = guid; - Category = category; - WmsBillNum = wmsBillNum; - ShippingDate = shippingDate; - PN = pN; - MaterialNumber = materialNumber; - MaterialDes = materialDes; - PrimitiveLU = primitiveLU; - ReplaceLU = replaceLU; - CustomerOfflineTime = customerOfflineTime; - SAQty = sAQty; - SEQty = sEQty; - DiffQty = diffQty; - MateType = mateType; - FixPrice = fixPrice; - SeqNumber = seqNumber; - PJISSeqNumber = pJISSeqNumber; - ErpLoc = erploc; - } - - public BBAC_SEC_DETAIL() + public class BBAC_SEC_DETAIL : FullAuditedAggregateRoot { + /// + /// 类别 + /// 有结算有发运 + /// 有结算无发运 + /// 无结算有发运 + /// + [Display(Name = "类别")] + [ExporterHeader(DisplayName = "类别")] + [ValueMapping("有结算有发运", 1)] + [ValueMapping("有结算无发运", 2)] + [ValueMapping("无结算有发运", 3)] + public EnumPubSaSeCompareCategory Category { get; set; } + + /// + /// Wms发货单号 + /// + [Display(Name = "Wms发货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + + /// + /// + /// + [Display(Name = "发货日期")] + [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] + public DateTime ShippingDate { get; set; } + + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public string PN { get; set; } + + /// + /// 物料号 + /// + [Display(Name = "物料号")] + [ExporterHeader(DisplayName = "厂内物料号")] + public string MaterialNumber { get; set; } + + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDes { get; set; } + + /// + /// 原始LU + /// + [Display(Name = "原始LU")] + [ExporterHeader(DisplayName = "原始LU")] + public string PrimitiveLU { get; set; } + + /// + ///替换LU + /// + [Display(Name = "替换LU")] + [ExporterHeader(DisplayName = "替换LU")] + public string ReplaceLU { get; set; } + + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + [ExporterHeader(DisplayName = "客户下线时间")] + public DateTime CustomerOfflineTime { get; set; } + + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal SAQty { get; set; } + + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } + + /// + /// 差异数量 + /// + [ExporterHeader(DisplayName = "差异数量")] + public decimal DiffQty { set; get; } + + /// + /// 匹配类型 + /// + [Display(Name = "匹配类型")] + [ExporterHeader(DisplayName = "是否完全匹配")] + public string MateType { get; set; } + + /// + /// 定价 + /// + [Display(Name = "定价")] + [ExporterHeader(DisplayName = "定价")] + public decimal FixPrice { get; set; } + + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + [ExporterHeader(DisplayName = "日顺序号")] + public string SeqNumber { get; set; } + + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + [ExporterHeader(DisplayName = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } + + /// + /// PJIS日顺序号 + /// + [Display(Name = "库位")] + [ExporterHeader(DisplayName = "库位")] + public string ErpLoc { get; set; } + + public BBAC_SEC_DETAIL(Guid guid, EnumPubSaSeCompareCategory category, string wmsBillNum, DateTime shippingDate, string pN, string materialNumber, string materialDes, string primitiveLU, string replaceLU, DateTime customerOfflineTime, decimal sAQty, decimal sEQty, decimal diffQty, string mateType, decimal fixPrice, string seqNumber, string pJISSeqNumber, string erploc) + { + Id = guid; + Category = category; + WmsBillNum = wmsBillNum; + ShippingDate = shippingDate; + PN = pN; + MaterialNumber = materialNumber; + MaterialDes = materialDes; + PrimitiveLU = primitiveLU; + ReplaceLU = replaceLU; + CustomerOfflineTime = customerOfflineTime; + SAQty = sAQty; + SEQty = sEQty; + DiffQty = diffQty; + MateType = mateType; + FixPrice = fixPrice; + SeqNumber = seqNumber; + PJISSeqNumber = pJISSeqNumber; + ErpLoc = erploc; + } + + public BBAC_SEC_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs index de2c9de0..2653d961 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_DETAIL.cs @@ -1,35 +1,35 @@ using System; using System.ComponentModel.DataAnnotations; using SettleAccount.Bases; -using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - -[Display(Name = "BBAC发运单")] -public class BBAC_SE_DETAIL : JisSeBase +namespace SettleAccount.Domain.BQ { - public BBAC_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) - { - Id= guid; - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - SeqNumber = seqNumber; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - Qty = qty; - BeginDate = beginDate; - ShippingDate = shippingDate; - WmsBillNum = wmsBillNum; - } - public BBAC_SE_DETAIL() + [Display(Name = "BBAC发运单")] + public class BBAC_SE_DETAIL : JisSeBase { - - } + public BBAC_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) + { + Id = guid; + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + SeqNumber = seqNumber; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + Qty = qty; + BeginDate = beginDate; + ShippingDate = shippingDate; + WmsBillNum = wmsBillNum; + } + public BBAC_SE_DETAIL() + { - public void SetId(Guid id) - { - Id = id; + } + + public void SetId(Guid id) + { + Id = id; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs index 8b603ec7..857704d2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_EDI.cs @@ -2,100 +2,99 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; - -public class SE_EDI : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "LU+生产码")] - public string KeyCode { get; set; } = null!; - - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "零件号")] - public string LU { get; set; } = null!; - - /// - /// 对应字段ExternalCalNumber - /// - [Display(Name = "生产码")] - public string PN { get; set; } = null!; - - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } = null!; - - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } = null!; - - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } = null!; - - [Display(Name = "EDI数量")] - public decimal Qty { get; set; } - - [Display(Name = "订货时间")] - public DateTime BeginDate { get; set; } - - [Display(Name = "工厂")] - public string Site { get; set; } - [Display(Name = "生产码类型")] - public string Extend1 { set; get; } - public string Extend2 { set; get; } - [Display(Name = "生产码序列号")] - public string Extend3 { set; get; } - [Display(Name = "车型")] - public string Extend4 { set; get; } - - /// - /// 是否有发运数据 - /// - [Display(Name = "是否有发运数据")] - public bool IsHaveSeData { get; set; } - /// - /// 生产线 - /// - [Display(Name = "生产线")] - [MaxLength(50)] - public string LineStationCode { set; get; } - - - - [Display(Name = "原客户零件号")] - [MaxLength(50)] - public string CustomerPartCodeNoSpace { set; get; } -} - -[Display(Name = "BBAC的EDI数据")] -public class BBAC_SE_EDI : SE_EDI -{ - public BBAC_SE_EDI() - { } - public BBAC_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate - - ,string site, string extend1, string extend2, string extend3, string extend4,string customerPartCodeNoSpace) + public class SE_EDI : FullAuditedAggregateRoot { - Id = guid; - - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - SeqNumber = seqNumber; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - Qty = qty; - BeginDate = beginDate; - Site = site; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - Extend4 = extend4; - CustomerPartCodeNoSpace = customerPartCodeNoSpace; + [Display(Name = "LU+生产码")] + public string KeyCode { get; set; } = null!; + + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "零件号")] + public string LU { get; set; } = null!; + + /// + /// 对应字段ExternalCalNumber + /// + [Display(Name = "生产码")] + public string PN { get; set; } = null!; + + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } = null!; + + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } = null!; + + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } = null!; + + [Display(Name = "EDI数量")] + public decimal Qty { get; set; } + + [Display(Name = "订货时间")] + public DateTime BeginDate { get; set; } + + [Display(Name = "工厂")] + public string Site { get; set; } + [Display(Name = "生产码类型")] + public string Extend1 { set; get; } + public string Extend2 { set; get; } + [Display(Name = "生产码序列号")] + public string Extend3 { set; get; } + [Display(Name = "车型")] + public string Extend4 { set; get; } + + /// + /// 是否有发运数据 + /// + [Display(Name = "是否有发运数据")] + public bool IsHaveSeData { get; set; } + /// + /// 生产线 + /// + [Display(Name = "生产线")] + [MaxLength(50)] + public string LineStationCode { set; get; } + + [Display(Name = "原客户零件号")] + [MaxLength(50)] + public string CustomerPartCodeNoSpace { set; get; } } - public BBAC_SE_EDI SetQty(decimal qty) + [Display(Name = "BBAC的EDI数据")] + public class BBAC_SE_EDI : SE_EDI { - this.Qty = qty; - return this; + public BBAC_SE_EDI() + { } + public BBAC_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate + + , string site, string extend1, string extend2, string extend3, string extend4, string customerPartCodeNoSpace) + { + Id = guid; + + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + SeqNumber = seqNumber; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + Qty = qty; + BeginDate = beginDate; + Site = site; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Extend4 = extend4; + CustomerPartCodeNoSpace = customerPartCodeNoSpace; + } + + public BBAC_SE_EDI SetQty(decimal qty) + { + this.Qty = qty; + return this; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_REPORT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_REPORT.cs index b8b033f5..b8033874 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_REPORT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_REPORT.cs @@ -1,66 +1,68 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; -[Display(Name = "BBAC发运数据和EDI对比实体")] -public class BBAC_SE_REPORT:FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "LU+生产码")] - public string KeyCode { get; set; } = null!; + [Display(Name = "BBAC发运数据和EDI对比实体")] + public class BBAC_SE_REPORT : FullAuditedAggregateRoot + { + [Display(Name = "LU+生产码")] + public string KeyCode { get; set; } = null!; - [Display(Name = "期间")] - public int Version { get; set; } + [Display(Name = "期间")] + public int Version { get; set; } - [Display(Name = "零件号")] - public string LU { get; set; } = null!; + [Display(Name = "零件号")] + public string LU { get; set; } = null!; - [Display(Name = "生产码")] - public string PN { get; set; } = null!; + [Display(Name = "生产码")] + public string PN { get; set; } = null!; - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } = null!; + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } = null!; - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } = null!; + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } = null!; - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } = null!; + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } = null!; - [Display(Name = "发货数量")] - public decimal Qty { get; set; } + [Display(Name = "发货数量")] + public decimal Qty { get; set; } - [Display(Name = "EDI数量")] - public decimal EDIQty { get; set; } + [Display(Name = "EDI数量")] + public decimal EDIQty { get; set; } - [Display(Name = "订单时间")] - public DateTime BeginDate { get; set; } + [Display(Name = "订单时间")] + public DateTime BeginDate { get; set; } - [Display(Name = "发货时间")] - public DateTime ShippingDate { get; set; } + [Display(Name = "发货时间")] + public DateTime ShippingDate { get; set; } - [Display(Name = "Wms发货单号")] - public string WmsBillNum { get; set; } = null!; + [Display(Name = "Wms发货单号")] + public string WmsBillNum { get; set; } = null!; - public BBAC_SE_REPORT(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, decimal eDIQty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) - { - Id = guid; + public BBAC_SE_REPORT(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, decimal eDIQty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) + { + Id = guid; - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - SeqNumber = seqNumber; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - Qty = qty; - EDIQty = eDIQty; - BeginDate = beginDate; - ShippingDate = shippingDate; - WmsBillNum = wmsBillNum; - } + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + SeqNumber = seqNumber; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + Qty = qty; + EDIQty = eDIQty; + BeginDate = beginDate; + ShippingDate = shippingDate; + WmsBillNum = wmsBillNum; + } - public BBAC_SE_REPORT() - { + public BBAC_SE_REPORT() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_SA_REPORT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_SA_REPORT.cs index 4b37f20c..ce4d5c21 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_SA_REPORT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/BBAC_SE_SA_REPORT.cs @@ -1,82 +1,84 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; -[Display(Name = "BBAC发运数据与结算数据对比实体")] -public class BBAC_SE_SA_REPORT :FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { + [Display(Name = "BBAC发运数据与结算数据对比实体")] + public class BBAC_SE_SA_REPORT : FullAuditedAggregateRoot + { - [Display(Name = "LU+ASN单号")] - public string KeyCode { get; set; } = null!; - - /// - [Display(Name = "类别")] - public string Category { get; set; } = null!; + [Display(Name = "LU+ASN单号")] + public string KeyCode { get; set; } = null!; - [Display(Name = "Wms发货单号")] - public string WmsBillNum { get; set; } = null!; - [Display(Name = "发货时间")] - public DateTime ShippingDate { get; set; } - [Display(Name = "生产码")] - public string PN { get; set; } = null!; - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } = null!; - [Display(Name = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } = null!; - [Display(Name = "物料号")] - public string MaterialNumber { get; set; } = null!; - [Display(Name = "物料描述")] - public string MaterialDes { get; set; } = null!; - [Display(Name = "零件号")] - public string LU { get; set; } = null!; - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - public DateTime CustomerOfflineTime { get; set; } - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } = null!; - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } = null!; - [Display(Name = "结算数量")] - public decimal SEQty { get; set; } - [Display(Name = "发货数量")] - public decimal WMSQty { get; set; } - [Display(Name = "EDI数量")] - public decimal EDIQty { get; set; } - [Display(Name = "匹配类型")] - public string MateType { get; set; } = null!; - [Display(Name = "定价")] - public decimal FixPrice { get; set; } - [Display(Name = "期间")] - public int Version { get; set; } + /// + [Display(Name = "类别")] + public string Category { get; set; } = null!; - public BBAC_SE_SA_REPORT(Guid guid, string keyCode, string category, string wmsBillNum, DateTime shippingDate, string pN, string seqNumber, string pJISSeqNumber, string materialNumber, string materialDes, string lU, DateTime customerOfflineTime, string assemblyCode, string injectionCode, decimal sEQty, decimal wMSQty, decimal eDIQty, string mateType, decimal fixPrice, int version) - { - Id = guid; - KeyCode = keyCode; - Category = category; - WmsBillNum = wmsBillNum; - ShippingDate = shippingDate; - PN = pN; - SeqNumber = seqNumber; - PJISSeqNumber = pJISSeqNumber; - MaterialNumber = materialNumber; - MaterialDes = materialDes; - LU = lU; - CustomerOfflineTime = customerOfflineTime; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - SEQty = sEQty; - WMSQty = wMSQty; - EDIQty = eDIQty; - MateType = mateType; - FixPrice = fixPrice; - Version = version; - } + [Display(Name = "Wms发货单号")] + public string WmsBillNum { get; set; } = null!; + [Display(Name = "发货时间")] + public DateTime ShippingDate { get; set; } + [Display(Name = "生产码")] + public string PN { get; set; } = null!; + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } = null!; + [Display(Name = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } = null!; + [Display(Name = "物料号")] + public string MaterialNumber { get; set; } = null!; + [Display(Name = "物料描述")] + public string MaterialDes { get; set; } = null!; + [Display(Name = "零件号")] + public string LU { get; set; } = null!; + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + public DateTime CustomerOfflineTime { get; set; } + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } = null!; + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } = null!; + [Display(Name = "结算数量")] + public decimal SEQty { get; set; } + [Display(Name = "发货数量")] + public decimal WMSQty { get; set; } + [Display(Name = "EDI数量")] + public decimal EDIQty { get; set; } + [Display(Name = "匹配类型")] + public string MateType { get; set; } = null!; + [Display(Name = "定价")] + public decimal FixPrice { get; set; } + [Display(Name = "期间")] + public int Version { get; set; } - public BBAC_SE_SA_REPORT() - { + public BBAC_SE_SA_REPORT(Guid guid, string keyCode, string category, string wmsBillNum, DateTime shippingDate, string pN, string seqNumber, string pJISSeqNumber, string materialNumber, string materialDes, string lU, DateTime customerOfflineTime, string assemblyCode, string injectionCode, decimal sEQty, decimal wMSQty, decimal eDIQty, string mateType, decimal fixPrice, int version) + { + Id = guid; + KeyCode = keyCode; + Category = category; + WmsBillNum = wmsBillNum; + ShippingDate = shippingDate; + PN = pN; + SeqNumber = seqNumber; + PJISSeqNumber = pJISSeqNumber; + MaterialNumber = materialNumber; + MaterialDes = materialDes; + LU = lU; + CustomerOfflineTime = customerOfflineTime; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + SEQty = sEQty; + WMSQty = wMSQty; + EDIQty = eDIQty; + MateType = mateType; + FixPrice = fixPrice; + Version = version; + } + + public BBAC_SE_SA_REPORT() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs index 0acace87..c3c74e14 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_ADJ_DETAIL.cs @@ -1,130 +1,131 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -// -//[Display(Name = "HBPO不可结算导入")] -//public class HBPO_NOT_SA: BaseEntity -//{ -// [Display(Name = "期间")] -// public int Version { get; set; } - -// [Display(Name = "结算单据")] -// [OneToMany] -// public string BillNum { get; set; } = null!; - -// [Display(Name = "出库单号")] -// public string DNBillNum { get; set; } = null!; - -// /// -// /// 1、新建 2、已有出库3、已有扣减寄售库 -// /// -// [Display(Name = "状态")] -// public string State { get; set; } = null!; - -// /// -// /// 明细记录行数 -// /// -// [Display(Name = "明细记录行数")] -// public string RecordCount { get; set; } = null!; -//} -[Display(Name = "HBPO不可结算导入明细")] -public class HBPO_ADJ_DETAIL : SA_NOT_BASE +namespace SettleAccount.Domain.BQ { - ///// - ///// 对应字段(PartNumber+ProductioNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; - - ///// - ///// 对应字段PartNumber - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段productionlumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 对应字段filename 区分 cn1、cn5 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Qty - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - /// - /// 匹配价格表对应区间带出 - /// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - /// - /// 对应字段ReceiveDate - /// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - ///// - ///// 对应字段DeliveryNode - ///// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - [Display(Name = "作废发票号")] - public string OldInvBillNum { get; set; } - - [Display(Name = "发票号")] - public string InvBillNum { get; set; } - - /// - /// 是否是买单件 - /// - [Display(Name = "是否是买单件")] - public bool IsMaiDan { get; set; } - - - public HBPO_ADJ_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string oldinv, string inv) - { - Id = guid; - KeyCode = keyCode; - Version = version; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - SettleDate = settleDate; - GroupNum = groupNum; - InvGroupNum = invGroupNum; - BusinessType = businessType; - OldInvBillNum = oldinv; - InvBillNum = inv; - } - - public HBPO_ADJ_DETAIL() + // + //[Display(Name = "HBPO不可结算导入")] + //public class HBPO_NOT_SA: BaseEntity + //{ + // [Display(Name = "期间")] + // public int Version { get; set; } + + // [Display(Name = "结算单据")] + // [OneToMany] + // public string BillNum { get; set; } = null!; + + // [Display(Name = "出库单号")] + // public string DNBillNum { get; set; } = null!; + + // /// + // /// 1、新建 2、已有出库3、已有扣减寄售库 + // /// + // [Display(Name = "状态")] + // public string State { get; set; } = null!; + + // /// + // /// 明细记录行数 + // /// + // [Display(Name = "明细记录行数")] + // public string RecordCount { get; set; } = null!; + //} + [Display(Name = "HBPO不可结算导入明细")] + public class HBPO_ADJ_DETAIL : SA_NOT_BASE { + ///// + ///// 对应字段(PartNumber+ProductioNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单号")] + //public string SettleBillNum { get; set; } = null!; + + ///// + ///// 对应字段PartNumber + ///// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段productionlumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 对应字段filename 区分 cn1、cn5 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Qty + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + /// + /// 匹配价格表对应区间带出 + /// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + /// + /// 对应字段ReceiveDate + /// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + ///// + ///// 对应字段DeliveryNode + ///// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + [Display(Name = "作废发票号")] + public string OldInvBillNum { get; set; } + + [Display(Name = "发票号")] + public string InvBillNum { get; set; } + + /// + /// 是否是买单件 + /// + [Display(Name = "是否是买单件")] + public bool IsMaiDan { get; set; } + + public HBPO_ADJ_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string oldinv, string inv) + { + Id = guid; + KeyCode = keyCode; + Version = version; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + SettleDate = settleDate; + GroupNum = groupNum; + InvGroupNum = invGroupNum; + BusinessType = businessType; + OldInvBillNum = oldinv; + InvBillNum = inv; + } + + public HBPO_ADJ_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs index a0056364..0180c791 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_CAN_SA.cs @@ -1,148 +1,147 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO可结算导入")] -public class HBPO_CAN_SA : SA_CAN_BASE_MAIN -{ - //[Display(Name = "期间")] - //public int Version { get; set; } - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - //[Display(Name = "结算单据")] - - //public string BillNum { get; set; } = null!; - - ///// - ///// 1、新建 2、已有出库3、已有扣减寄售库 - ///// - //[Display(Name = "状态")] - //public SettleBillState State { get; set; } - - ///// - ///// 明细记录行数 - ///// - //[Display(Name = "明细记录行数")] - //public string InvGroupNum { get; set; } = null!; - - /// - /// 工厂地点 - /// - //[Display(Name = "工厂地点")] - //public string Site { get; set; } = null!; - /// - /// 业务类型 - /// - public EnumBusinessType BusinessType { get; set; } - - public HBPO_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, string invGroupNum,string site) - { - Version = version; - SettleBillNum = settleBillNum; - BillNum = billNum; - State = state; - InvGroupNum = invGroupNum; - Site = site; - } - - public HBPO_CAN_SA() - { - } -} -[Display(Name = "HBPO可结算导入明细")] - -public class HBPO_CAN_SA_DETAIL:SA_CAN_BASE +namespace SettleAccount.Domain.BQ { - ///// - ///// 对应字段(PartNumber+ProductioNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - /// - /// 对应字段PartNumber - /// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段productionlumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 对应字段filename 区分 cn1、cn5 - /// - //[Display(Name = "工厂地点")] - //public string Site { get; set; } = null!; - - ///// - ///// 对应字段Qty - ///// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - ///// - ///// 对应字段ReceiveDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - /// - /// 对应字段DeliveryNode - /// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - public HBPO_CAN_SA_DETAIL(Guid guid ,string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string invbillnum,string partcode) + [Display(Name = "HBPO可结算导入")] + public class HBPO_CAN_SA : SA_CAN_BASE_MAIN { - InvbillNum=invbillnum; - Id = guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - SettleDate = settleDate; - GroupNum = groupNum; - InvGroupNum = invGroupNum; - BusinessType = businessType; - PartCode = partcode; + //[Display(Name = "期间")] + //public int Version { get; set; } + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + //[Display(Name = "结算单据")] + + //public string BillNum { get; set; } = null!; + + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "明细记录行数")] + //public string InvGroupNum { get; set; } = null!; + + /// + /// 工厂地点 + /// + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + + public HBPO_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, string invGroupNum, string site) + { + Version = version; + SettleBillNum = settleBillNum; + BillNum = billNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } + + public HBPO_CAN_SA() + { + } } + [Display(Name = "HBPO可结算导入明细")] - public HBPO_CAN_SA_DETAIL() + public class HBPO_CAN_SA_DETAIL : SA_CAN_BASE { + ///// + ///// 对应字段(PartNumber+ProductioNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + /// + /// 对应字段PartNumber + /// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段productionlumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 对应字段filename 区分 cn1、cn5 + /// + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; + + ///// + ///// 对应字段Qty + ///// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + ///// + ///// 对应字段ReceiveDate + ///// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + /// + /// 对应字段DeliveryNode + /// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + public HBPO_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string invbillnum, string partcode) + { + InvbillNum = invbillnum; + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + SettleDate = settleDate; + GroupNum = groupNum; + InvGroupNum = invGroupNum; + BusinessType = businessType; + PartCode = partcode; + } + + public HBPO_CAN_SA_DETAIL() + { + } } } - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs index e5e39869..3c27c4c2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_NOT_SA_DETAIL.cs @@ -1,117 +1,119 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -// -//[Display(Name = "HBPO不可结算导入")] -//public class HBPO_NOT_SA: BaseEntity -//{ -// [Display(Name = "期间")] -// public int Version { get; set; } - -// [Display(Name = "结算单据")] -// [OneToMany] -// public string BillNum { get; set; } = null!; - -// [Display(Name = "出库单号")] -// public string DNBillNum { get; set; } = null!; - -// /// -// /// 1、新建 2、已有出库3、已有扣减寄售库 -// /// -// [Display(Name = "状态")] -// public string State { get; set; } = null!; - -// /// -// /// 明细记录行数 -// /// -// [Display(Name = "明细记录行数")] -// public string RecordCount { get; set; } = null!; -//} -[Display(Name = "HBPO不可结算导入明细")] -public class HBPO_NOT_SA_DETAIL :SA_NOT_BASE +namespace SettleAccount.Domain.BQ { - ///// - ///// 对应字段(PartNumber+ProductioNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; - - ///// - ///// 对应字段PartNumber - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段productionlumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 对应字段filename 区分 cn1、cn5 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Qty - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - /// - /// 匹配价格表对应区间带出 - /// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - /// - /// 对应字段ReceiveDate - /// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - ///// - ///// 对应字段DeliveryNode - ///// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - public HBPO_NOT_SA_DETAIL(Guid guid ,string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType,string partcode) - { - Id = guid; - KeyCode = keyCode; - Version = version; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - SettleDate = settleDate; - GroupNum = groupNum; - InvGroupNum = invGroupNum; - BusinessType = businessType; - PartCode = partcode; - } - - public HBPO_NOT_SA_DETAIL() + // + //[Display(Name = "HBPO不可结算导入")] + //public class HBPO_NOT_SA: BaseEntity + //{ + // [Display(Name = "期间")] + // public int Version { get; set; } + + // [Display(Name = "结算单据")] + // [OneToMany] + // public string BillNum { get; set; } = null!; + + // [Display(Name = "出库单号")] + // public string DNBillNum { get; set; } = null!; + + // /// + // /// 1、新建 2、已有出库3、已有扣减寄售库 + // /// + // [Display(Name = "状态")] + // public string State { get; set; } = null!; + + // /// + // /// 明细记录行数 + // /// + // [Display(Name = "明细记录行数")] + // public string RecordCount { get; set; } = null!; + //} + [Display(Name = "HBPO不可结算导入明细")] + public class HBPO_NOT_SA_DETAIL : SA_NOT_BASE { + ///// + ///// 对应字段(PartNumber+ProductioNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单号")] + //public string SettleBillNum { get; set; } = null!; + + ///// + ///// 对应字段PartNumber + ///// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段productionlumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 对应字段filename 区分 cn1、cn5 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Qty + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + /// + /// 匹配价格表对应区间带出 + /// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + /// + /// 对应字段ReceiveDate + /// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + ///// + ///// 对应字段DeliveryNode + ///// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + public HBPO_NOT_SA_DETAIL(Guid guid, string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType, string partcode) + { + Id = guid; + KeyCode = keyCode; + Version = version; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + SettleDate = settleDate; + GroupNum = groupNum; + InvGroupNum = invGroupNum; + BusinessType = businessType; + PartCode = partcode; + } + + public HBPO_NOT_SA_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs index 7e9cc1fc..e1b20ad0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD.cs @@ -1,46 +1,44 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO待扣减")] -public class HBPO_PD : PD_BASE_MAIN +namespace SettleAccount.Domain.BQ { - - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单据")] - //public string BillNum { get; set; } = null!; - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - ///// - ///// 1、新建 2、已有出库3、已有扣减寄售库 - ///// - //[Display(Name = "状态")] - //public SettleBillState State { get; set; } - ///// - ///// 明细记录行数 - ///// - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - public HBPO_PD() - { - - } - public HBPO_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site) + [Display(Name = "HBPO待扣减")] + public class HBPO_PD : PD_BASE_MAIN { - Id = guid; - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - State = state; - InvGroupNum = invGroupNum; - Site = site; - } -} + //[Display(Name = "期间")] + //public int Version { get; set; } + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public HBPO_PD() + { + } + public HBPO_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum, string site) + { + Id = guid; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD_DETAIL.cs index 094dad15..0430252e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_PD_DETAIL.cs @@ -1,76 +1,78 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO待扣减实体")] -public class HBPO_PD_DETAIL :PD_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+ASN单号")] - //public string KeyCode { get; set; } = null!; + [Display(Name = "HBPO待扣减实体")] + public class HBPO_PD_DETAIL : PD_BASE + { + //[Display(Name = "LU+ASN单号")] + //public string KeyCode { get; set; } = null!; - //[Display(Name = "期间")] - //public int Version { get; set; } + //[Display(Name = "期间")] + //public int Version { get; set; } - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; - //[Display(Name = "替换零件号")] - //public string RELU { get; set; } = null!; - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; + //[Display(Name = "替换零件号")] + //public string RELU { get; set; } = null!; + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; - //[Display(Name = "替换生产号")] - //public string REPN { get; set; } = null!; - //[Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + //[Display(Name = "替换生产号")] + //public string REPN { get; set; } = null!; + //[Display(Name = "工厂地点")] + public string Site { get; set; } = null!; - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } - //[Display(Name = "单价")] - //public decimal Price { get; set; } + //[Display(Name = "单价")] + //public decimal Price { get; set; } - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; - public HBPO_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, - DateTime settleDate, string groupNum, string extend1, string extend2, string extend3, string extend4,EnumBusinessType p_businessType - ) - { - Id = guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - RELU = rELU; - PN = pN; - REPN = rEPN; - Site = site; - Qty = qty; - Price = price; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - GroupNum = groupNum; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - Extend4 = extend4; - BusinessType= p_businessType; + public HBPO_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, + DateTime settleDate, string groupNum, string extend1, string extend2, string extend3, string extend4, EnumBusinessType p_businessType + ) + { + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + RELU = rELU; + PN = pN; + REPN = rEPN; + Site = site; + Qty = qty; + Price = price; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + GroupNum = groupNum; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Extend4 = extend4; + BusinessType = p_businessType; - } + } - public HBPO_PD_DETAIL() - { + public HBPO_PD_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs index 74831df8..745f8ed9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SA.cs @@ -1,162 +1,164 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO结算导入")] -public class HBPO_SA : AuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "结算单据")] - - public string BillNum { get; set; } = null!; - - [Display(Name = "出库单号")] - public string DNBillNum { get; set; } = null!; - - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public string State { get; set; } = null!; - - /// - /// 明细记录行数 - /// - [Display(Name = "明细记录行数")] - public string RecordCount { get; set; } = null!; - /// - /// 地点码 - /// - [Display(Name = "地点码")] - [MaxLength(64)] - public string Site { get; set; } - /// - /// 业务类型 - /// - public EnumBusinessType BusinessType { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - [MaxLength(64)] - public string Place { get; set; } - - public HBPO_SA(Guid guid, int version, string billNum, string dNBillNum, string state, string recordCount) + [Display(Name = "HBPO结算导入")] + public class HBPO_SA : AuditedAggregateRoot { - this.Id= guid; - Version = version; - BillNum = billNum; - DNBillNum = dNBillNum; - State = state; - RecordCount = recordCount; + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "结算单据")] + + public string BillNum { get; set; } = null!; + + [Display(Name = "出库单号")] + public string DNBillNum { get; set; } = null!; + + /// + /// 1、新建 2、已有出库3、已有扣减寄售库 + /// + [Display(Name = "状态")] + public string State { get; set; } = null!; + + /// + /// 明细记录行数 + /// + [Display(Name = "明细记录行数")] + public string RecordCount { get; set; } = null!; + /// + /// 地点码 + /// + [Display(Name = "地点码")] + [MaxLength(64)] + public string Site { get; set; } + /// + /// 业务类型 + /// + public EnumBusinessType BusinessType { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [MaxLength(64)] + public string Place { get; set; } + + public HBPO_SA(Guid guid, int version, string billNum, string dNBillNum, string state, string recordCount) + { + this.Id = guid; + Version = version; + BillNum = billNum; + DNBillNum = dNBillNum; + State = state; + RecordCount = recordCount; + } + + public HBPO_SA() + { + } } - public HBPO_SA() - { - } -} - -[Display(Name = "HBPO结算导入明细")] - -public class HBPO_SA_DETAIL : SA_BASE + [Display(Name = "HBPO结算导入明细")] -{ - ///// - ///// 对应字段(PartNumber+ProductioNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - - ///// - ///// 对应字段PartNumber - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段productionlumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 对应字段filename 区分 cn1、cn5 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Qty - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - ///// - ///// 对应字段ReceiveDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - ///// - ///// 对应字段DeliveryNode - ///// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; - /// - /// 地点 - /// - [Display(Name = "地点")] - [MaxLength(64)] - public string Place { get; set; } - - public HBPO_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType) - { - this.Id= guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - SettleDate = settleDate; - GroupNum = groupNum; - InvGroupNum = invGroupNum; - BusinessType= businessType; - } - - public HBPO_SA_DETAIL() - { - } + public class HBPO_SA_DETAIL : SA_BASE - public void SetId(Guid id) { - Id = id; + ///// + ///// 对应字段(PartNumber+ProductioNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + + ///// + ///// 对应字段PartNumber + ///// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段productionlumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 对应字段filename 区分 cn1、cn5 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Qty + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + ///// + ///// 对应字段ReceiveDate + ///// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + ///// + ///// 对应字段DeliveryNode + ///// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; + /// + /// 地点 + /// + [Display(Name = "地点")] + [MaxLength(64)] + public string Place { get; set; } + + public HBPO_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, DateTime settleDate, string groupNum, string invGroupNum, EnumBusinessType businessType) + { + this.Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + SettleDate = settleDate; + GroupNum = groupNum; + InvGroupNum = invGroupNum; + BusinessType = businessType; + } + + public HBPO_SA_DETAIL() + { + } + + public void SetId(Guid id) + { + Id = id; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SEC_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SEC_DETAIL.cs index d45c19cc..de7e01c0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SEC_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SEC_DETAIL.cs @@ -1,17 +1,14 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Entities.BQ; -public class HBPO_SEC_DETAIL: FullAuditedAggregateRoot +namespace Win.Sfs.SettleAccount.Entities.BQ { - + public class HBPO_SEC_DETAIL : FullAuditedAggregateRoot + { + /// /// 类别 /// 有结算有发运 @@ -129,16 +126,14 @@ public class HBPO_SEC_DETAIL: FullAuditedAggregateRoot [ExporterHeader(DisplayName = "PJIS日顺序号")] public string PJISSeqNumber { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "库位")] - [ExporterHeader(DisplayName = "库位")] - public string ErpLoc { get; set; } - - + /// + /// PJIS日顺序号 + /// + [Display(Name = "库位")] + [ExporterHeader(DisplayName = "库位")] + public string ErpLoc { get; set; } - public HBPO_SEC_DETAIL(Guid guid, EnumPubSaSeCompareCategory category, string wmsBillNum, DateTime shippingDate, string pN, string materialNumber, string materialDes, string primitiveLU, string replaceLU, DateTime customerOfflineTime, decimal sAQty, decimal sEQty, decimal diffQty, string mateType, decimal fixPrice, string seqNumber, string pJISSeqNumber,string erploc) + public HBPO_SEC_DETAIL(Guid guid, EnumPubSaSeCompareCategory category, string wmsBillNum, DateTime shippingDate, string pN, string materialNumber, string materialDes, string primitiveLU, string replaceLU, DateTime customerOfflineTime, decimal sAQty, decimal sEQty, decimal diffQty, string mateType, decimal fixPrice, string seqNumber, string pJISSeqNumber, string erploc) { Id = guid; Category = category; @@ -157,10 +152,11 @@ public class HBPO_SEC_DETAIL: FullAuditedAggregateRoot FixPrice = fixPrice; SeqNumber = seqNumber; PJISSeqNumber = pJISSeqNumber; - ErpLoc= erploc; + ErpLoc = erploc; } - public HBPO_SEC_DETAIL() - { + public HBPO_SEC_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs index 5cbf6c4d..1467a514 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_DETAIL.cs @@ -1,35 +1,35 @@ using System; using System.ComponentModel.DataAnnotations; using SettleAccount.Bases; -using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - -[Display(Name = "HBPO发运数据")] -public class HBPO_SE_DETAIL : JisSeBase +namespace SettleAccount.Domain.BQ { - public HBPO_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) + [Display(Name = "HBPO发运数据")] + public class HBPO_SE_DETAIL : JisSeBase { - this.Id = guid; - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - SeqNumber = seqNumber; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - Qty = qty; - BeginDate = beginDate; - ShippingDate = shippingDate; - WmsBillNum = wmsBillNum; - } + public HBPO_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) + { + this.Id = guid; + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + SeqNumber = seqNumber; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + Qty = qty; + BeginDate = beginDate; + ShippingDate = shippingDate; + WmsBillNum = wmsBillNum; + } - public HBPO_SE_DETAIL() - { - } + public HBPO_SE_DETAIL() + { + } - public void SetId(Guid id) - { - Id = id; + public void SetId(Guid id) + { + Id = id; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs index 67b91f75..6d0601ac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_EDI.cs @@ -1,46 +1,47 @@ using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO的EDI数据")] -public class HBPO_SE_EDI : SE_EDI +namespace SettleAccount.Domain.BQ { - public HBPO_SE_EDI(Guid guid ,string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, string site, string extend1, string extend2, string extend3, string extend4, string customerPartCodeNoSpace) + [Display(Name = "HBPO的EDI数据")] + public class HBPO_SE_EDI : SE_EDI { - Id = guid; - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - SeqNumber = seqNumber; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - Qty = qty; - BeginDate = beginDate; - Site = site; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - Extend4 = extend4; - CustomerPartCodeNoSpace = customerPartCodeNoSpace; - } + public HBPO_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate, string site, string extend1, string extend2, string extend3, string extend4, string customerPartCodeNoSpace) + { + Id = guid; + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + SeqNumber = seqNumber; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + Qty = qty; + BeginDate = beginDate; + Site = site; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Extend4 = extend4; + CustomerPartCodeNoSpace = customerPartCodeNoSpace; + } - //public HBPO_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate) - //{ - // Id=guid; - // KeyCode = keyCode; - // Version = version; - // LU = lU; - // PN = pN; - // SeqNumber = seqNumber; - // AssemblyCode = assemblyCode; - // InjectionCode = injectionCode; - // Qty = qty; - // BeginDate = beginDate; - //} + //public HBPO_SE_EDI(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, DateTime beginDate) + //{ + // Id=guid; + // KeyCode = keyCode; + // Version = version; + // LU = lU; + // PN = pN; + // SeqNumber = seqNumber; + // AssemblyCode = assemblyCode; + // InjectionCode = injectionCode; + // Qty = qty; + // BeginDate = beginDate; + //} - public HBPO_SE_EDI() - { + public HBPO_SE_EDI() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_REPORT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_REPORT.cs index 81c0d26c..a9151c2b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_REPORT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_REPORT.cs @@ -1,65 +1,67 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO发运数据和EDI对比实体")] -public class HBPO_SE_REPORT :FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "LU+生产码")] - public string KeyCode { get; set; } = null!; + [Display(Name = "HBPO发运数据和EDI对比实体")] + public class HBPO_SE_REPORT : FullAuditedAggregateRoot + { + [Display(Name = "LU+生产码")] + public string KeyCode { get; set; } = null!; - [Display(Name = "期间")] - public int Version { get; set; } + [Display(Name = "期间")] + public int Version { get; set; } - [Display(Name = "零件号")] - public string LU { get; set; } = null!; + [Display(Name = "零件号")] + public string LU { get; set; } = null!; - [Display(Name = "生产码")] - public string PN { get; set; } = null!; + [Display(Name = "生产码")] + public string PN { get; set; } = null!; - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } = null!; + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } = null!; - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } = null!; + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } = null!; - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } = null!; + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } = null!; - [Display(Name = "发货数量")] - public decimal Qty { get; set; } + [Display(Name = "发货数量")] + public decimal Qty { get; set; } - [Display(Name = "EDI数量")] - public decimal EDIQty { get; set; } + [Display(Name = "EDI数量")] + public decimal EDIQty { get; set; } - [Display(Name = "订单时间")] - public DateTime BeginDate { get; set; } + [Display(Name = "订单时间")] + public DateTime BeginDate { get; set; } - [Display(Name = "发货时间")] - public DateTime ShippingDate { get; set; } + [Display(Name = "发货时间")] + public DateTime ShippingDate { get; set; } - [Display(Name = "Wms发货单号")] - public string WmsBillNum { get; set; } = null!; + [Display(Name = "Wms发货单号")] + public string WmsBillNum { get; set; } = null!; - public HBPO_SE_REPORT(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, decimal eDIQty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) - { - Id = guid; - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - SeqNumber = seqNumber; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - Qty = qty; - EDIQty = eDIQty; - BeginDate = beginDate; - ShippingDate = shippingDate; - WmsBillNum = wmsBillNum; - } + public HBPO_SE_REPORT(Guid guid, string keyCode, int version, string lU, string pN, string seqNumber, string assemblyCode, string injectionCode, decimal qty, decimal eDIQty, DateTime beginDate, DateTime shippingDate, string wmsBillNum) + { + Id = guid; + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + SeqNumber = seqNumber; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + Qty = qty; + EDIQty = eDIQty; + BeginDate = beginDate; + ShippingDate = shippingDate; + WmsBillNum = wmsBillNum; + } - public HBPO_SE_REPORT() - { + public HBPO_SE_REPORT() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_SA_REPORT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_SA_REPORT.cs index bc3f537b..ebcfc24a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_SA_REPORT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/HBPO_SE_SA_REPORT.cs @@ -1,106 +1,106 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; - - -namespace SettleAccount.Domain.BQ; -[Display(Name = "HBPO发运数据与结算数据对比实体")] -public class HBPO_SE_SA_REPORT :RE_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+ASN单号")] - //public string KeyCode { get; set; } = null!; - - /// - /// 有结算无发货(无EDI数据) - ///有结算无发货(有EDI数据) - ///有结算有发货(无EDI数据) - ///有结算有发货(无价格信息) - ///有结算有发货(有EDI数据) - ///无结算有发货(有EDI数据) - ///无结算有发货(无EDI数据) - ///有结算有发货(有EDI数据) - ///有结算有发货(WMS多发) - /// - [Display(Name = "类别")] - public string Category { get; set; } = null!; - - //[Display(Name = "Wms发货单号")] - //public string WmsBillNum { get; set; } = null!; - - //[Display(Name = "发货时间")] - //public DateTime ShippingDate { get; set; } - - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } = null!; - - [Display(Name = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } = null!; - - [Display(Name = "物料号")] - public string MaterialNumber { get; set; } = null!; - - [Display(Name = "物料描述")] - public string MaterialDes { get; set; } = null!; - - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - public DateTime CustomerOfflineTime { get; set; } - - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } = null!; - - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } = null!; - - [Display(Name = "结算数量")] - public decimal SEQty { get; set; } - - [Display(Name = "发货数量")] - public decimal WMSQty { get; set; } - - [Display(Name = "EDI数量")] - public decimal EDIQty { get; set; } - - [Display(Name = "匹配类型")] - public string MateType { get; set; } = null!; - - [Display(Name = "定价")] - public decimal FixPrice { get; set; } - - [Display(Name = "期间")] - public int Version { get; set; } - - public HBPO_SE_SA_REPORT(Guid guid, string keyCode, string category, string pN, string seqNumber, string pJISSeqNumber, string materialNumber, string materialDes, DateTime customerOfflineTime, string assemblyCode, string injectionCode, decimal sEQty, decimal wMSQty, decimal eDIQty, string mateType, decimal fixPrice, int version) - { - Id = guid; - KeyCode = keyCode; - Category = category; - - SeqNumber = seqNumber; - PJISSeqNumber = pJISSeqNumber; - MaterialNumber = materialNumber; - MaterialDes = materialDes; - CustomerOfflineTime = customerOfflineTime; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - SEQty = sEQty; - WMSQty = wMSQty; - EDIQty = eDIQty; - MateType = mateType; - FixPrice = fixPrice; - Version = version; - } - - public HBPO_SE_SA_REPORT() + [Display(Name = "HBPO发运数据与结算数据对比实体")] + public class HBPO_SE_SA_REPORT : RE_BASE { + //[Display(Name = "LU+ASN单号")] + //public string KeyCode { get; set; } = null!; + + /// + /// 有结算无发货(无EDI数据) + ///有结算无发货(有EDI数据) + ///有结算有发货(无EDI数据) + ///有结算有发货(无价格信息) + ///有结算有发货(有EDI数据) + ///无结算有发货(有EDI数据) + ///无结算有发货(无EDI数据) + ///有结算有发货(有EDI数据) + ///有结算有发货(WMS多发) + /// + [Display(Name = "类别")] + public string Category { get; set; } = null!; + + //[Display(Name = "Wms发货单号")] + //public string WmsBillNum { get; set; } = null!; + + //[Display(Name = "发货时间")] + //public DateTime ShippingDate { get; set; } + + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } = null!; + + [Display(Name = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } = null!; + + [Display(Name = "物料号")] + public string MaterialNumber { get; set; } = null!; + + [Display(Name = "物料描述")] + public string MaterialDes { get; set; } = null!; + + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + public DateTime CustomerOfflineTime { get; set; } + + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } = null!; + + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } = null!; + + [Display(Name = "结算数量")] + public decimal SEQty { get; set; } + + [Display(Name = "发货数量")] + public decimal WMSQty { get; set; } + + [Display(Name = "EDI数量")] + public decimal EDIQty { get; set; } + + [Display(Name = "匹配类型")] + public string MateType { get; set; } = null!; + + [Display(Name = "定价")] + public decimal FixPrice { get; set; } + + [Display(Name = "期间")] + public int Version { get; set; } + + public HBPO_SE_SA_REPORT(Guid guid, string keyCode, string category, string pN, string seqNumber, string pJISSeqNumber, string materialNumber, string materialDes, DateTime customerOfflineTime, string assemblyCode, string injectionCode, decimal sEQty, decimal wMSQty, decimal eDIQty, string mateType, decimal fixPrice, int version) + { + Id = guid; + KeyCode = keyCode; + Category = category; + + SeqNumber = seqNumber; + PJISSeqNumber = pJISSeqNumber; + MaterialNumber = materialNumber; + MaterialDes = materialDes; + CustomerOfflineTime = customerOfflineTime; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + SEQty = sEQty; + WMSQty = wMSQty; + EDIQty = eDIQty; + MateType = mateType; + FixPrice = fixPrice; + Version = version; + } + + public HBPO_SE_SA_REPORT() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs index 82806eb2..2a74fac8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_GRP.cs @@ -3,98 +3,91 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "发票分组")] -public class INVOICE_GRP : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "金税发票号")] - public string RealnvBillNum { get; set; } = null!; - - [Display(Name = "系统发票号")] - public string InvbillNum { get; set; } = null!; - - [Display(Name = "未税金额")] - public decimal Amt { get; set; } - - [Display(Name = "税后金额")] - public decimal TaxAmt { get; set; } - - [Display(Name = "税率")] - public decimal Tax { get; set; } - - [Display(Name = "原发票号")] - public string ParentInvbillNum{ get; set; } - - - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; - - [Display(Name = "开票Excel文件")] - public string FileName { get; set; } = null!; - - /// - /// 1-HBPO 2-BBAC(和买单件一起开票,扣减库存时要注意分开) 3-JIT 4-备件、5-印度件 - /// - [Display(Name = "业务类别")] - public EnumBusinessType BusinessType { get; set; } - - - [Display(Name = "状态")] - public SettleBillState State { get; set; } - - [Display(Name = "发票状态")] - public InvoiceBillState InvoiceState { get; set; } - - [Display(Name = "发票税后尾差")] - public decimal PreTaxDiff { get; set; } - - [Display(Name = "发票税后尾差")] - public decimal TaxDiff { get; set; } - [Display(Name = "客户代码")] - public string ClientCode { get; set; } - [Display(Name = "税额")] - public decimal RealAmt { get; set; } - - - [Display(Name = "地点")] - public string Site { get; set; } - - - - - public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, - string invGroupNum, - string fileName, - EnumBusinessType businessType, - SettleBillState state, - InvoiceBillState invoiceBillState, - decimal tax, - string parent, decimal preTaxDiff, decimal taxDiff, string clientCode,decimal realAmt - ) - { - Id= guid; - RealnvBillNum = realnvBillNum; - InvbillNum = invbillNum; - Amt = amt; - TaxAmt = taxAmt; - InvGroupNum = invGroupNum; - FileName = fileName; - BusinessType = businessType; - State = state; - InvoiceState = invoiceBillState; - ParentInvbillNum = parent; - Tax = tax; - PreTaxDiff= preTaxDiff; - TaxDiff= taxDiff; - ClientCode = clientCode; - RealAmt = realAmt; - - } - - - - public INVOICE_GRP() + [Display(Name = "发票分组")] + public class INVOICE_GRP : FullAuditedAggregateRoot { + [Display(Name = "金税发票号")] + public string RealnvBillNum { get; set; } = null!; + + [Display(Name = "系统发票号")] + public string InvbillNum { get; set; } = null!; + + [Display(Name = "未税金额")] + public decimal Amt { get; set; } + + [Display(Name = "税后金额")] + public decimal TaxAmt { get; set; } + + [Display(Name = "税率")] + public decimal Tax { get; set; } + + [Display(Name = "原发票号")] + public string ParentInvbillNum { get; set; } + + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; + + [Display(Name = "开票Excel文件")] + public string FileName { get; set; } = null!; + + /// + /// 1-HBPO 2-BBAC(和买单件一起开票,扣减库存时要注意分开) 3-JIT 4-备件、5-印度件 + /// + [Display(Name = "业务类别")] + public EnumBusinessType BusinessType { get; set; } + + [Display(Name = "状态")] + public SettleBillState State { get; set; } + + [Display(Name = "发票状态")] + public InvoiceBillState InvoiceState { get; set; } + + [Display(Name = "发票税后尾差")] + public decimal PreTaxDiff { get; set; } + + [Display(Name = "发票税后尾差")] + public decimal TaxDiff { get; set; } + [Display(Name = "客户代码")] + public string ClientCode { get; set; } + [Display(Name = "税额")] + public decimal RealAmt { get; set; } + + [Display(Name = "地点")] + public string Site { get; set; } + + public INVOICE_GRP(Guid guid, string realnvBillNum, string invbillNum, decimal amt, decimal taxAmt, + string invGroupNum, + string fileName, + EnumBusinessType businessType, + SettleBillState state, + InvoiceBillState invoiceBillState, + decimal tax, + string parent, decimal preTaxDiff, decimal taxDiff, string clientCode, decimal realAmt + ) + { + Id = guid; + RealnvBillNum = realnvBillNum; + InvbillNum = invbillNum; + Amt = amt; + TaxAmt = taxAmt; + InvGroupNum = invGroupNum; + FileName = fileName; + BusinessType = businessType; + State = state; + InvoiceState = invoiceBillState; + ParentInvbillNum = parent; + Tax = tax; + PreTaxDiff = preTaxDiff; + TaxDiff = taxDiff; + ClientCode = clientCode; + RealAmt = realAmt; + + } + + public INVOICE_GRP() + { + } } } - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_MAP_GROUP.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_MAP_GROUP.cs index 4517eaef..c2e348b7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_MAP_GROUP.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_MAP_GROUP.cs @@ -1,47 +1,48 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; - -[Display(Name = "发票和结算分组对应关系")] - -public class INVOICE_MAP_GROUP : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "发票号")] - public string InvbillNum { get; set; } = null!; - - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; - - [Display(Name = "结算分组号")] - public string SettleGroupNum { get; set; } = null!; - - [Display(Name = "金额")] - public decimal Amt { get; set; } - - [Display(Name = "扩展字段1")] - public string Extend1 { get; set; } = null!; - - [Display(Name = "扩展字段2")] - public string Extend2 { get; set; } = null!; - - public INVOICE_MAP_GROUP(Guid guid, int version, string invbillNum, string invGroupNum, string settleGroupNum, decimal amt, string extend1, string extend2) - { - Id = guid; - Version = version; - InvbillNum = invbillNum; - InvGroupNum = invGroupNum; - SettleGroupNum = settleGroupNum; - Amt = amt; - Extend1 = extend1; - Extend2 = extend2; - } + [Display(Name = "发票和结算分组对应关系")] - public INVOICE_MAP_GROUP() + public class INVOICE_MAP_GROUP : FullAuditedAggregateRoot { + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "发票号")] + public string InvbillNum { get; set; } = null!; + + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; + + [Display(Name = "结算分组号")] + public string SettleGroupNum { get; set; } = null!; + + [Display(Name = "金额")] + public decimal Amt { get; set; } + + [Display(Name = "扩展字段1")] + public string Extend1 { get; set; } = null!; + + [Display(Name = "扩展字段2")] + public string Extend2 { get; set; } = null!; + + public INVOICE_MAP_GROUP(Guid guid, int version, string invbillNum, string invGroupNum, string settleGroupNum, decimal amt, string extend1, string extend2) + { + Id = guid; + Version = version; + InvbillNum = invbillNum; + InvGroupNum = invGroupNum; + SettleGroupNum = settleGroupNum; + Amt = amt; + Extend1 = extend1; + Extend2 = extend2; + } + + public INVOICE_MAP_GROUP() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs index 322e92c6..276c1508 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_NOT_SETTLE.cs @@ -2,58 +2,55 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; - -[Display(Name = "不可结算零件号")] - -public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; - - [Display(Name = "发票号")] - public string InvBillNum { get; set; } = null!; - - - [Display(Name = "结算分组号")] - public string SettleGroupNum { get; set; } = null!; - - [Display(Name = "可结算零件号")] - public string LU { get; set; } = null!; - [Display(Name = "不可结算零件号")] - public string LU1 { get; set; } = null!; - - [Display(Name = "数量")] - public decimal Qty { get; set; } - - [Display(Name = "扩展字段1")] - public string Extend1 { get; set; } = null!; - - [Display(Name = "扩展字段2")] - public string Extend2 { get; set; } = null!; - - - - - public INVOICE_NOT_SETTLE(Guid guid, int version, string invGroupNum, string settleGroupNum, string lU, string lU1, string extend1, string extend2,decimal qty,string p_invbillnum) - { - Id = guid; - Version = version; - InvGroupNum = invGroupNum; - SettleGroupNum = settleGroupNum; - LU = lU; - LU1 = lU1; - Extend1 = extend1; - Extend2 = extend2; - Qty = qty; - InvBillNum = p_invbillnum; - } - public INVOICE_NOT_SETTLE() + public class INVOICE_NOT_SETTLE : FullAuditedAggregateRoot { + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; + + [Display(Name = "发票号")] + public string InvBillNum { get; set; } = null!; + + [Display(Name = "结算分组号")] + public string SettleGroupNum { get; set; } = null!; + + [Display(Name = "可结算零件号")] + public string LU { get; set; } = null!; + + [Display(Name = "不可结算零件号")] + public string LU1 { get; set; } = null!; + + [Display(Name = "数量")] + public decimal Qty { get; set; } + + [Display(Name = "扩展字段1")] + public string Extend1 { get; set; } = null!; + + [Display(Name = "扩展字段2")] + public string Extend2 { get; set; } = null!; + + public INVOICE_NOT_SETTLE(Guid guid, int version, string invGroupNum, string settleGroupNum, string lU, string lU1, string extend1, string extend2, decimal qty, string p_invbillnum) + { + Id = guid; + Version = version; + InvGroupNum = invGroupNum; + SettleGroupNum = settleGroupNum; + LU = lU; + LU1 = lU1; + Extend1 = extend1; + Extend2 = extend2; + Qty = qty; + InvBillNum = p_invbillnum; + } + + public INVOICE_NOT_SETTLE() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs index 761945b7..c1c8b270 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/INVOICE_WAIT_DETAIL.cs @@ -3,79 +3,76 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - - -[Display(Name = "待开票明细")] -public class INVOICE_WAIT_DETAIL :FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "发票号")] - public string InvbillNum { get; set; } = null!; - - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; - - [Display(Name = "零件号")] - public string LU { get; set; } = null!; - - - [Display(Name = "客户零件号")] - public string PartCode { get; set; } = null!; - - - [Display(Name = "单价")] - public decimal PRICE { get; set; } - - [Display(Name = "数量")] - public decimal Qty { get; set; } - - [Display(Name = "金额")] - public decimal Amt { get; set; } - - /// - /// 1、BBAC-JIS 2、HBPO-JIS 3、JIT 4、备件 5、印度件 - /// - [Display(Name = "业务分类")] - public EnumBusinessType BussiessType { get; set; } - - [Display(Name = "扩展字段1")] - public string Extend1 { get; set; } = null!; - - [Display(Name = "扩展字段2")] - public string Extend2 { get; set; } = null!; - - [Display(Name = "价格开始日期")] - public DateTime BeginDate { get; set; } - [Display(Name = "价格结束日期")] - public DateTime EndDate { get; set; } - [Display(Name = "行号")] - public int LineCode { get; set; } - - - - public INVOICE_WAIT_DETAIL(Guid guid, int version, string invbillNum, string invGroupNum, string lU, decimal pRICE, decimal qty, decimal amt, EnumBusinessType bussiessType, string extend1, string extend2,DateTime beginDate,DateTime endDate,string partcode) - { - Id = guid; - Version = version; - InvbillNum = invbillNum; - InvGroupNum = invGroupNum; - LU = lU; - PRICE = pRICE; - Qty = qty; - Amt = amt; - BussiessType = bussiessType; - Extend1 = extend1; - Extend2 = extend2; - BeginDate = beginDate; - EndDate = endDate; - PartCode = partcode; - - } - public INVOICE_WAIT_DETAIL() + [Display(Name = "待开票明细")] + public class INVOICE_WAIT_DETAIL : FullAuditedAggregateRoot { + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "发票号")] + public string InvbillNum { get; set; } = null!; + + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; + + [Display(Name = "零件号")] + public string LU { get; set; } = null!; + + [Display(Name = "客户零件号")] + public string PartCode { get; set; } = null!; + + [Display(Name = "单价")] + public decimal PRICE { get; set; } + + [Display(Name = "数量")] + public decimal Qty { get; set; } + + [Display(Name = "金额")] + public decimal Amt { get; set; } + + /// + /// 1、BBAC-JIS 2、HBPO-JIS 3、JIT 4、备件 5、印度件 + /// + [Display(Name = "业务分类")] + public EnumBusinessType BussiessType { get; set; } + + [Display(Name = "扩展字段1")] + public string Extend1 { get; set; } = null!; + + [Display(Name = "扩展字段2")] + public string Extend2 { get; set; } = null!; + + [Display(Name = "价格开始日期")] + public DateTime BeginDate { get; set; } + [Display(Name = "价格结束日期")] + public DateTime EndDate { get; set; } + [Display(Name = "行号")] + public int LineCode { get; set; } + + public INVOICE_WAIT_DETAIL(Guid guid, int version, string invbillNum, string invGroupNum, string lU, decimal pRICE, decimal qty, decimal amt, EnumBusinessType bussiessType, string extend1, string extend2, DateTime beginDate, DateTime endDate, string partcode) + { + Id = guid; + Version = version; + InvbillNum = invbillNum; + InvGroupNum = invGroupNum; + LU = lU; + PRICE = pRICE; + Qty = qty; + Amt = amt; + BussiessType = bussiessType; + Extend1 = extend1; + Extend2 = extend2; + BeginDate = beginDate; + EndDate = endDate; + PartCode = partcode; + + } + + public INVOICE_WAIT_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/JIT_SE_SA_REPORT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/JIT_SE_SA_REPORT.cs index 753621ec..ed71f8e4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/JIT_SE_SA_REPORT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/JIT_SE_SA_REPORT.cs @@ -1,108 +1,109 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; -namespace SettleAccount.Domain.BQ; -[Display(Name = "JIT发运数据与结算数据对比实体")] -public class JIT_SE_SA_REPORT :RE_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+ASN单号")] - //public string KeyCode { get; set; } = null!; - - /// - /// 有结算无发货(无EDI数据) - ///有结算无发货(有EDI数据) - ///有结算有发货(无EDI数据) - ///有结算有发货(无价格信息) - ///有结算有发货(有EDI数据) - ///无结算有发货(有EDI数据) - ///无结算有发货(无EDI数据) - ///有结算有发货(有EDI数据) - ///有结算有发货(WMS多发) - /// - [Display(Name = "类别")] - public string Category { get; set; } = null!; - - //[Display(Name = "Wms发货单号")] - //public string WmsBillNum { get; set; } = null!; - - //[Display(Name = "发货时间")] - //public DateTime ShippingDate { get; set; } - - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } = null!; - - [Display(Name = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } = null!; - - [Display(Name = "物料号")] - public string MaterialNumber { get; set; } = null!; - - [Display(Name = "物料描述")] - public string MaterialDes { get; set; } = null!; - - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - public DateTime CustomerOfflineTime { get; set; } - - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } = null!; - - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } = null!; - - [Display(Name = "结算数量")] - public decimal SEQty { get; set; } - - [Display(Name = "发货数量")] - public decimal WMSQty { get; set; } - - [Display(Name = "EDI数量")] - public decimal EDIQty { get; set; } - - [Display(Name = "匹配类型")] - public string MateType { get; set; } = null!; - - [Display(Name = "定价")] - public decimal FixPrice { get; set; } - - [Display(Name = "期间")] - public int Version { get; set; } - - public JIT_SE_SA_REPORT(Guid guid , string keyCode, string category, string wmsBillNum, DateTime shippingDate, string pN, string seqNumber, string pJISSeqNumber, string materialNumber, string materialDes, string lU, DateTime customerOfflineTime, string assemblyCode, string injectionCode, decimal sEQty, decimal wMSQty, decimal eDIQty, string mateType, decimal fixPrice, int version) - { - Id = guid; - KeyCode = keyCode; - Category = category; - WmsBillNum = wmsBillNum; - ShippingDate = shippingDate; - PN = pN; - SeqNumber = seqNumber; - PJISSeqNumber = pJISSeqNumber; - MaterialNumber = materialNumber; - MaterialDes = materialDes; - LU = lU; - CustomerOfflineTime = customerOfflineTime; - AssemblyCode = assemblyCode; - InjectionCode = injectionCode; - SEQty = sEQty; - WMSQty = wMSQty; - EDIQty = eDIQty; - MateType = mateType; - FixPrice = fixPrice; - Version = version; - } - - public JIT_SE_SA_REPORT() + [Display(Name = "JIT发运数据与结算数据对比实体")] + public class JIT_SE_SA_REPORT : RE_BASE { + //[Display(Name = "LU+ASN单号")] + //public string KeyCode { get; set; } = null!; + + /// + /// 有结算无发货(无EDI数据) + ///有结算无发货(有EDI数据) + ///有结算有发货(无EDI数据) + ///有结算有发货(无价格信息) + ///有结算有发货(有EDI数据) + ///无结算有发货(有EDI数据) + ///无结算有发货(无EDI数据) + ///有结算有发货(有EDI数据) + ///有结算有发货(WMS多发) + /// + [Display(Name = "类别")] + public string Category { get; set; } = null!; + + //[Display(Name = "Wms发货单号")] + //public string WmsBillNum { get; set; } = null!; + + //[Display(Name = "发货时间")] + //public DateTime ShippingDate { get; set; } + + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } = null!; + + [Display(Name = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } = null!; + + [Display(Name = "物料号")] + public string MaterialNumber { get; set; } = null!; + + [Display(Name = "物料描述")] + public string MaterialDes { get; set; } = null!; + + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + public DateTime CustomerOfflineTime { get; set; } + + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } = null!; + + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } = null!; + + [Display(Name = "结算数量")] + public decimal SEQty { get; set; } + + [Display(Name = "发货数量")] + public decimal WMSQty { get; set; } + + [Display(Name = "EDI数量")] + public decimal EDIQty { get; set; } + + [Display(Name = "匹配类型")] + public string MateType { get; set; } = null!; + + [Display(Name = "定价")] + public decimal FixPrice { get; set; } + + [Display(Name = "期间")] + public int Version { get; set; } + + public JIT_SE_SA_REPORT(Guid guid, string keyCode, string category, string wmsBillNum, DateTime shippingDate, string pN, string seqNumber, string pJISSeqNumber, string materialNumber, string materialDes, string lU, DateTime customerOfflineTime, string assemblyCode, string injectionCode, decimal sEQty, decimal wMSQty, decimal eDIQty, string mateType, decimal fixPrice, int version) + { + Id = guid; + KeyCode = keyCode; + Category = category; + WmsBillNum = wmsBillNum; + ShippingDate = shippingDate; + PN = pN; + SeqNumber = seqNumber; + PJISSeqNumber = pJISSeqNumber; + MaterialNumber = materialNumber; + MaterialDes = materialDes; + LU = lU; + CustomerOfflineTime = customerOfflineTime; + AssemblyCode = assemblyCode; + InjectionCode = injectionCode; + SEQty = sEQty; + WMSQty = wMSQty; + EDIQty = eDIQty; + MateType = mateType; + FixPrice = fixPrice; + Version = version; + } + + public JIT_SE_SA_REPORT() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/M_PD_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/M_PD_DETAIL.cs index add824f7..23303f97 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/M_PD_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/M_PD_DETAIL.cs @@ -1,69 +1,71 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; -[Display(Name = "买单件待扣减实体")] -public class M_PD_DETAIL : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "LU+ASN单号")] - public string KeyCode { get; set; } = null!; + [Display(Name = "买单件待扣减实体")] + public class M_PD_DETAIL : FullAuditedAggregateRoot + { + [Display(Name = "LU+ASN单号")] + public string KeyCode { get; set; } = null!; - [Display(Name = "期间")] - public int Version { get; set; } + [Display(Name = "期间")] + public int Version { get; set; } - [Display(Name = "结算单号")] - public string BillNum { get; set; } = null!; + [Display(Name = "结算单号")] + public string BillNum { get; set; } = null!; - [Display(Name = "零件号")] - public string LU { get; set; } = null!; + [Display(Name = "零件号")] + public string LU { get; set; } = null!; - [Display(Name = "替换零件号")] - public string RELU { get; set; } = null!; + [Display(Name = "替换零件号")] + public string RELU { get; set; } = null!; - [Display(Name = "生产码")] - public string PN { get; set; } = null!; + [Display(Name = "生产码")] + public string PN { get; set; } = null!; - [Display(Name = "替换生产号")] - public string REPN { get; set; } = null!; + [Display(Name = "替换生产号")] + public string REPN { get; set; } = null!; - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; - [Display(Name = "结算数量")] - public decimal Qty { get; set; } + [Display(Name = "结算数量")] + public decimal Qty { get; set; } - [Display(Name = "单价")] - public decimal Price { get; set; } + [Display(Name = "单价")] + public decimal Price { get; set; } - [Display(Name = "发票分组号")] - public string InvGroupNum { get; set; } = null!; + [Display(Name = "发票分组号")] + public string InvGroupNum { get; set; } = null!; - [Display(Name = "结算日期(收货日期)")] - public DateTime SettleDate { get; set; } + [Display(Name = "结算日期(收货日期)")] + public DateTime SettleDate { get; set; } - [Display(Name = "结算分组")] - public string GroupNum { get; set; } = null!; + [Display(Name = "结算分组")] + public string GroupNum { get; set; } = null!; - public M_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum) - { - Id = guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - RELU = rELU; - PN = pN; - REPN = rEPN; - Site = site; - Qty = qty; - Price = price; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - GroupNum = groupNum; - } + public M_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string groupNum) + { + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + RELU = rELU; + PN = pN; + REPN = rEPN; + Site = site; + Qty = qty; + Price = price; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + GroupNum = groupNum; + } - public M_PD_DETAIL() - { + public M_PD_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs index afec629c..0d64cecc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_CAN_SA_MNG.cs @@ -1,29 +1,18 @@ -using EFCore.BulkExtensions; -using Hangfire.Annotations; -using Microsoft.EntityFrameworkCore; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; -using Volo.Abp.ObjectMapping; -using Win.Sfs.SettleAccount.Bases.DomainServices; -using Win.Sfs.SettleAccount.Boms; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { - public class BBAC_CAN_SA_MNG: DomainService - + public class BBAC_CAN_SA_MNG : DomainService + { private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; @@ -43,12 +32,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public virtual async Task SetForwardState(BBAC_CAN_SA p_entiy, SettleBillState state) { - if (await SetForwardState(p_entiy.InvGroupNum, state) == true) + if (await SetForwardState(p_entiy.InvGroupNum, state).ConfigureAwait(false) == true) { return true; } - return false; - + return false; + } /// @@ -67,65 +56,64 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers throw new UserFriendlyException("可结算单有重复"); } var first = ls.FirstOrDefault(); - - switch (state) - { - case SettleBillState.财务已审核: - if (first.State == SettleBillState.商务已审核) - { - first.State = state; - } - else - { - throw new UserFriendlyException("当前状态不是【商务已审核】,无法设置成【财务已审核】状态", "400"); - } - break; - case SettleBillState.商务已审核: - if (first.State == SettleBillState.已开票) - { - first.State = state; - } - else - { - throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【商务已审核】", "400"); - } - break; - case SettleBillState.已开票: - if (first.State == SettleBillState.未结状态) - { + + switch (state) + { + case SettleBillState.财务已审核: + if (first.State == SettleBillState.商务已审核) + { first.State = state; - } - else - { - throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】", "400"); - } - break; - case SettleBillState.已扣减: - if (first.State == SettleBillState.客户已收票) - { + } + else + { + throw new UserFriendlyException("当前状态不是【商务已审核】,无法设置成【财务已审核】状态", "400"); + } + break; + case SettleBillState.商务已审核: + if (first.State == SettleBillState.已开票) + { first.State = state; - } - else - { - throw new UserFriendlyException("当前状态不是[客户收票],无法设置成【财务已审核】状态", "400"); - } - break; - case SettleBillState.客户已收票: - if (first.State == SettleBillState.财务已审核) - { - first.State = state; - } - else - { - throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【客户已收票】状态", "400"); - } - break; + } + else + { + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【商务已审核】", "400"); + } + break; + case SettleBillState.已开票: + if (first.State == SettleBillState.未结状态) + { + first.State = state; + } + else + { + throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】", "400"); + } + break; + case SettleBillState.已扣减: + if (first.State == SettleBillState.客户已收票) + { + first.State = state; + } + else + { + throw new UserFriendlyException("当前状态不是[客户收票],无法设置成【财务已审核】状态", "400"); + } + break; + case SettleBillState.客户已收票: + if (first.State == SettleBillState.财务已审核) + { + first.State = state; + } + else + { + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【客户已收票】状态", "400"); + } + break; } - await _repository.DbContext.BulkUpdateAsync(new List{ first}); - + await _repository.DbContext.BulkUpdateAsync(new List { first }).ConfigureAwait(false); + return true; - - + } /// /// 向后流程 @@ -140,7 +128,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count == 0) { - throw new UserFriendlyException(string.Format("不存在发票分组号为{0}的可结算单", p_billNum),"400"); + throw new UserFriendlyException(string.Format("不存在发票分组号为{0}的可结算单", p_billNum), "400"); } foreach (BBAC_CAN_SA p_entiy in ls) { @@ -164,7 +152,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException("当前状态不是【商务已审核】状态,无法设置成【已开票】","400"); + throw new UserFriendlyException("当前状态不是【商务已审核】状态,无法设置成【已开票】", "400"); } break; case SettleBillState.未结状态: @@ -194,37 +182,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException("当前状态不是[客户已收票],无法设置成【财务已审核】状态","400"); + throw new UserFriendlyException("当前状态不是[客户已收票],无法设置成【财务已审核】状态", "400"); } break; } - await _repository.UpdateAsync(p_entiy); + await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); return true; } return false; } - public virtual async Task SetNewState(BBAC_CAN_SA p_entiy) { - return await SetNewState(p_entiy.BillNum); + return await SetNewState(p_entiy.BillNum).ConfigureAwait(false); } public virtual async Task SetNewState(string billNum) { - var entity= await GetMainAsync(billNum); - if (entity != null ) + var entity = await GetMainAsync(billNum).ConfigureAwait(false); + if (entity != null) { - + entity.State = SettleBillState.未结状态; - - - await _repository.UpdateAsync(entity); + + await _repository.UpdateAsync(entity).ConfigureAwait(false); return true; } return false; - ; + ; } /// /// 获得所有明细 @@ -233,7 +219,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetDetalListAsync(string billNum) { - return await _detailRepository.Where(p=>p.InvGroupNum==billNum).ToListAsync(); + return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false); } /// /// 获得主表信息 @@ -242,7 +228,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task GetMainAsync(string billNum) { - return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync(); + return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync().ConfigureAwait(false); } /// /// 获取发票对应结算分组所有零件 @@ -251,12 +237,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetContainsAsync(string p_invbillnum, List p_list) { - return await _detailRepository.Where(p =>p.InvbillNum== p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync().ConfigureAwait(false); } public virtual async Task> GetContainsAsync(string p_invbillnum) { - return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum).ToListAsync().ConfigureAwait(false); } /// /// 通过发票号获取结算数据 @@ -265,26 +251,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetDetailByInbillNumAsync(List p_invs) { - return await _detailRepository.Where(p =>p_invs.Contains(p.InvbillNum)).ToListAsync(); + return await _detailRepository.Where(p => p_invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false); } - - - - - } - } - - - - - - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs index ec715ff8..262853b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_NOT_SA_MNG.cs @@ -1,16 +1,13 @@ -using SettleAccount.Bases; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Domain.Services; -using Volo.Abp; -using Win.Sfs.Shared.RepositoryBase; -using Win.Sfs.SettleAccount.Bases; using EFCore.BulkExtensions; using SettleAccount.Domain.BQ; +using Volo.Abp.Domain.Services; +using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases.DomainServices; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { @@ -21,7 +18,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// public class BBAC_NOT_SA_MNG : DomainService - + { private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; @@ -50,7 +47,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var first = p_list.FirstOrDefault(); List errors = new List(); - var priceErrors = await _service.CheckPriceList(p_list,first.Site); + var priceErrors = await _service.CheckPriceList(p_list, first.Site).ConfigureAwait(false); if (priceErrors.Count > 0) { foreach (var itm in priceErrors) @@ -94,17 +91,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: billNumber, contactid: itm.ContractDocID, invbillnum: string.Empty, - partcode:itm.PartCode + partcode: itm.PartCode ); _detailEntity.RealPartCode = itm.RealPartCode; _entityList.Add(_detailEntity); } - await _repository.DbContext.BulkDeleteAsync(p_list); - await _repository.DbContext.BulkInsertAsync(new List() { _entity }); - await _repository.DbContext.BulkInsertAsync(_entityList); + await _repository.DbContext.BulkDeleteAsync(p_list).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(new List() { _entity }).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(_entityList).ConfigureAwait(false); return errors; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs index 6ca0ec22..bd62b036 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs @@ -1,61 +1,56 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using EFCore.BulkExtensions; using Microsoft.EntityFrameworkCore; -using SettleAccount.Bases; using SettleAccount.Domain.BQ; -using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Managers; -public class BBAC_PD_MNG:DomainService +namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { - private readonly INormalEfCoreRepository _repository; - private readonly INormalEfCoreRepository _detailRepository; - protected BBAC_PD_MNG( - INormalEfCoreRepository repository, - - INormalEfCoreRepository detailRepository - - ) + public class BBAC_PD_MNG : DomainService { - _repository = repository; - _detailRepository = detailRepository; - } - - public BBAC_PD_MNG() - { - } - - public virtual async Task GetMainAsync(string billNum) - { - return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync(); - } + private readonly INormalEfCoreRepository _repository; + private readonly INormalEfCoreRepository _detailRepository; + protected BBAC_PD_MNG( + INormalEfCoreRepository repository, + + INormalEfCoreRepository detailRepository + + ) + { + _repository = repository; + _detailRepository = detailRepository; + } + + public BBAC_PD_MNG() + { + } + + public virtual async Task GetMainAsync(string billNum) + { + return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync().ConfigureAwait(false); + } + + public virtual async Task> GetDetailAsync(string billNum) + { + return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false); + } + + public virtual bool InsertMain(BBAC_PD p_pd) + { + _repository.DbContext.BulkInsert(new List { p_pd }); + return true; + } + + public virtual bool InsertDetail(List p_list) + { + _repository.DbContext.BulkInsert(p_list); + return false; + } - public virtual async Task> GetDetailAsync(string billNum) - { - return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync(); } - - public virtual bool InsertMain(BBAC_PD p_pd) - { - _repository.DbContext.BulkInsert(new List { p_pd }); - return true; - } - - public virtual bool InsertDetail(List p_list) - { - _repository.DbContext.BulkInsert(p_list); - return false; - } - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs index 6253ccee..54937ee1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_CAN_SA_MNG.cs @@ -1,29 +1,17 @@ -using EFCore.BulkExtensions; -using Hangfire.Annotations; -using Microsoft.EntityFrameworkCore; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; -using Volo.Abp.ObjectMapping; -using Win.Sfs.SettleAccount.Bases.DomainServices; -using Win.Sfs.SettleAccount.Boms; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { - public class HBPO_CAN_SA_MNG: DomainService - + public class HBPO_CAN_SA_MNG : DomainService + { private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; @@ -48,7 +36,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task SetForwardState(HBPO_CAN_SA p_entiy, SettleBillState state) { - if (await SetForwardState(p_entiy.InvGroupNum, state) == true) + if (await SetForwardState(p_entiy.InvGroupNum, state).ConfigureAwait(false) == true) { return true; } @@ -64,9 +52,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public virtual async Task SetForwardState(string p_billNum, SettleBillState state) { var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); - if (ls == null && ls.Count ==0) + if (ls == null && ls.Count == 0) { - throw new UserFriendlyException(string.Format("不存在编号为{0}",p_billNum)); + throw new UserFriendlyException(string.Format("不存在编号为{0}", p_billNum)); } foreach (HBPO_CAN_SA p_entiy in ls) { @@ -99,7 +87,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】","400"); + throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】", "400"); } break; case SettleBillState.已扣减: @@ -123,7 +111,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } break; } - await _repository.UpdateAsync(p_entiy); + await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); return true; } return false; @@ -199,34 +187,32 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } break; } - await _repository.UpdateAsync(p_entiy); + await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); return true; } return false; } - public virtual async Task SetNewState(HBPO_CAN_SA p_entiy) { - - return await SetNewState(p_entiy.BillNum); + + return await SetNewState(p_entiy.BillNum).ConfigureAwait(false); } public virtual async Task SetNewState(string billNum) { - var entity= await GetMainAsync(billNum); - if (entity != null ) + var entity = await GetMainAsync(billNum).ConfigureAwait(false); + if (entity != null) { - + entity.State = SettleBillState.未结状态; - - - await _repository.UpdateAsync(entity); + + await _repository.UpdateAsync(entity).ConfigureAwait(false); return true; } return false; - ; + ; } /// /// 获得所有明细 @@ -235,7 +221,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetDetalListAsync(string billNum) { - return await _detailRepository.Where(p=>p.InvGroupNum==billNum).ToListAsync(); + return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false); } /// /// 获得主表信息 @@ -244,7 +230,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task GetMainAsync(string billNum) { - return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync(); + return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync().ConfigureAwait(false); } /// @@ -254,7 +240,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetContainsAsync(string p_invbillnum, List p_list) { - return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync().ConfigureAwait(false); } /// @@ -264,11 +250,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetContainsAsync(string p_invbillnum) { - return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum).ToListAsync().ConfigureAwait(false); } - - /// /// 通过发票号获取结算数据 /// @@ -276,21 +260,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetDetailByInbillNumAsync(List p_invs) { - return await _detailRepository.Where(p => p_invs.Contains(p.InvbillNum)).ToListAsync(); + return await _detailRepository.Where(p => p_invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false); } } - } - - - - - - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs index 6c61c6bb..79e794db 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/HBPO_NOT_SA_MNG.cs @@ -1,16 +1,13 @@ -using SettleAccount.Bases; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Domain.Services; -using Volo.Abp; -using Win.Sfs.Shared.RepositoryBase; -using Win.Sfs.SettleAccount.Bases; using EFCore.BulkExtensions; using SettleAccount.Domain.BQ; +using Volo.Abp.Domain.Services; +using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases.DomainServices; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { @@ -21,9 +18,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// public class HBPO_NOT_SA_MNG : DomainService - //where TEntity : SA_CAN_BASE_MAIN, new() - //where TEntityDetail : SA_CAN_BASE, new() - //where TNOTDetail : SA_NOT_BASE + //where TEntity : SA_CAN_BASE_MAIN, new() + //where TEntityDetail : SA_CAN_BASE, new() + //where TNOTDetail : SA_NOT_BASE { private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; @@ -48,9 +45,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } public virtual async Task> GenerateSettlementOrder(List p_list) { - var first=p_list.FirstOrDefault(); + var first = p_list.FirstOrDefault(); List errors = new List(); - var priceErrors = await _service.CheckPriceList(p_list,first.Site); + var priceErrors = await _service.CheckPriceList(p_list, first.Site).ConfigureAwait(false); if (priceErrors.Count > 0) { foreach (var itm in priceErrors) @@ -71,7 +68,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return errors; } - } var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var _entity = new HBPO_CAN_SA(); @@ -107,14 +103,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _detailEntity.RealPartCode = itm.RealPartCode; _entityList.Add(_detailEntity); } - await _notRepository.DbContext.BulkDeleteAsync(p_list); - await _repository.DbContext.BulkInsertAsync(new List() { _entity }); - await _repository.DbContext.BulkInsertAsync(_entityList); - + await _notRepository.DbContext.BulkDeleteAsync(p_list).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(new List() { _entity }).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(_entityList).ConfigureAwait(false); return errors; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs index f3109228..25d3f6c5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG.cs @@ -1,38 +1,19 @@ -using EFCore.BulkExtensions; -using EmptyFiles; -using Hangfire; -using Hangfire.Storage.Monitoring; -using Microsoft.AspNetCore.Razor.Language.Intermediate; -using Microsoft.AspNetCore.SignalR; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.EntityFrameworkCore; -using NPOI.SS.Formula.Functions; -using NPOI.Util; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; -using System.Security.Policy; -using System.Text; -using System.Text.Json; using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Bases; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.Auditing; using Volo.Abp.Data; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; -using Volo.Abp.Json; using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Entities.BQ.Temp; -using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.CodeSettings; -using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers @@ -72,7 +53,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers INormalEfCoreRepository nothbpoRepository ) { - + //_canRepository = canRepository; _repository = repository; _detailRepository = detailRepository; @@ -82,9 +63,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _pubMng = pubMng; _bbacMng = bbacMng; _hbpoMng = hbpoMng; - _pdbbacRepository=pdbbacRepository; - _pdhbpoRepository=pdhbpoRepository; - _pdpubRepository =pdpubRepository; + _pdbbacRepository = pdbbacRepository; + _pdhbpoRepository = pdhbpoRepository; + _pdpubRepository = pdpubRepository; _codesetRepository = codesetRepository; _nothbpoRepository = nothbpoRepository; } @@ -114,7 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { itm.FileName = remark; } - await _repository.UpdateManyAsync(ls); + await _repository.UpdateManyAsync(ls).ConfigureAwait(false); return true; } @@ -127,61 +108,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } - - - - private async Task SetSettleState(INVOICE_GRP p_entiy, SettleBillState p_State, bool IsForward = true) - { - if (p_entiy.BusinessType == EnumBusinessType.BeiJian || - p_entiy.BusinessType == EnumBusinessType.YinDuJian || - p_entiy.BusinessType == EnumBusinessType.MaiDanJianBBAC || - p_entiy.BusinessType == EnumBusinessType.MaiDanJianHBPO || - p_entiy.BusinessType == EnumBusinessType.ZhiGongJianBBAC || - p_entiy.BusinessType == EnumBusinessType.ZhiGongJianHBPO - ) - { - bool isSucc = false; - if (IsForward == true) - { - isSucc = await _pubMng.SetForwardState(p_entiy.InvGroupNum, p_State); - } - else - { - isSucc = await _pubMng.SetBackwardState(p_entiy.InvGroupNum, p_State); - } - return isSucc; - } - else if (p_entiy.BusinessType == EnumBusinessType.JisBBAC) - { - bool isSucc = false; - if (IsForward == true) - { - isSucc = await _bbacMng.SetForwardState(p_entiy.InvGroupNum, p_State); - } - else - { - isSucc = await _bbacMng.SetBackwardState(p_entiy.InvGroupNum, p_State); - } - return isSucc; - - } - else if (p_entiy.BusinessType == EnumBusinessType.JisHBPO) - { - bool isSucc = false; - - if (IsForward == true) - { - isSucc = await _hbpoMng.SetForwardState(p_entiy.InvGroupNum, p_State); - } - else - { - isSucc = await _hbpoMng.SetBackwardState(p_entiy.InvGroupNum, p_State); - } - - return isSucc; - } - return false; - } /// /// 发票向前流程 /// @@ -205,7 +131,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (nols.Count > 0) { var invs = nols.Select(p => p.InvbillNum); - throw new BusinessException("8989",$"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); + throw new BusinessException("8989", $"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作"); } var state = p_State; switch (p_State) @@ -268,7 +194,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers break; } - await _repository.DbContext.BulkUpdateAsync(appls); + await _repository.DbContext.BulkUpdateAsync(appls).ConfigureAwait(false); return true; } @@ -301,7 +227,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (nols.Count > 0) { var invs = nols.Select(p => p.InvbillNum); - throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作","400"); + throw new UserFriendlyException($"选择发票{string.Join(",", invs)}已报废或者已收票不能进行操作", "400"); } var state = p_State; switch (p_State) @@ -364,7 +290,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers break; } - await _repository.BatchUpdateAsync(appls); + await _repository.BatchUpdateAsync(appls).ConfigureAwait(false); return true; } @@ -375,15 +301,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } - - /// /// 获得发票主表 /// /// /// - - /// /// 获得发票主表 @@ -392,7 +314,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task GetMainAsync(string p_invbillNum) { - return await _repository.Where(p => p.InvbillNum == p_invbillNum).FirstOrDefaultAsync(); + return await _repository.Where(p => p.InvbillNum == p_invbillNum).FirstOrDefaultAsync().ConfigureAwait(false); } /// @@ -402,11 +324,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetMainListAsync(string p_invgroupNum) { - return await _repository.Where(p => p.InvGroupNum == p_invgroupNum).ToListAsync(); + return await _repository.Where(p => p.InvGroupNum == p_invgroupNum).ToListAsync().ConfigureAwait(false); } - - /// /// 获得发票主表 /// @@ -414,11 +334,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task GetInvoiceAsync(string p_invbillNum) { - return await _repository.Where(p => p.InvbillNum == p_invbillNum).FirstOrDefaultAsync(); + return await _repository.Where(p => p.InvbillNum == p_invbillNum).FirstOrDefaultAsync().ConfigureAwait(false); } - - /// /// 获得发票主表 /// @@ -426,14 +344,14 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetInvoiceListAsync(List invs) { - return await _repository.Where(p => invs.Contains(p.InvbillNum)).ToListAsync(); + return await _repository.Where(p => invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false); } /// /// 客户已收票 /// /// 发票分组号 /// - public virtual async Task ReceivedAsync(List p_invs) + public virtual async Task ReceivedAsync(List p_invs) { var invList = _repository.Where(p => p_invs.Contains(p.InvbillNum)).ToList();//所有提交发票信息 int count = invList.Select(p => p.InvGroupNum).Distinct().Count(); @@ -441,11 +359,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { throw new UserFriendlyException($"发票不属于一个发票分组"); } - var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState.报废 || p.State !=SettleBillState.财务已审核).ToList(); + var lostlist = invList.Where(p => p.InvoiceState == InvoiceBillState.报废 || p.State != SettleBillState.财务已审核).ToList(); if (lostlist.Count > 0) { - var invs=lostlist.Select(p => p.InvbillNum).ToList(); - throw new UserFriendlyException($"发票{string.Join(",",invs)}已经报废或不是财务审核状态!","400"); + var invs = lostlist.Select(p => p.InvbillNum).ToList(); + throw new UserFriendlyException($"发票{string.Join(",", invs)}已经报废或不是财务审核状态!", "400"); } var inv = invList.FirstOrDefault(); if (inv.BusinessType == EnumBusinessType.JisBBAC) @@ -454,7 +372,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (pdlist != null && pdlist.Count > 0) { var invs = pdlist.Select(p => p.BillNum).ToList(); - throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交","400"); + throw new UserFriendlyException($"发票{string.Join(",", invs)}已经生成待扣减过不能再次提交", "400"); } var parentList = invList.Select(p => p.ParentInvbillNum).ToList();//所有发票存在父发票号 List oldinvs = new List(); @@ -475,11 +393,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var namelist = invList.Select(p => p.InvbillNum).ToList(); if (oldlist.Count > 0) { - var involdList= invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList(); - var involdname=involdList.Select(p => p.InvbillNum); - var adjlist=_adjRepository.Where(p => involdname.Contains(p.InvBillNum)); - - if (adjlist != null && adjlist.Count() > 0) + var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList(); + var involdname = involdList.Select(p => p.InvbillNum); + var adjlist = _adjRepository.Where(p => involdname.Contains(p.InvBillNum)); + + if (adjlist != null && adjlist.Any()) { foreach (var itm in adjlist) { @@ -511,9 +429,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (newlist.Count > 0) { var entitys = invList.Where(p => newlist.Contains(p.InvbillNum)).ToList(); - var entityDetail = await _bbacMng.GetDetailByInbillNumAsync(newlist);//结算明细 + var entityDetail = await _bbacMng.GetDetailByInbillNumAsync(newlist).ConfigureAwait(false);//结算明细 var adjlist = _adjRepository.Where(p => newlist.Contains(p.InvBillNum)).ToList();//发票关联调整表明细 - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -549,55 +467,55 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var bbac = new BBAC_PD( guid: itm.Id, - version:int.Parse(DateTime.Now.ToString("yyyyMM")), + version: int.Parse(DateTime.Now.ToString("yyyyMM")), billNum: itm.InvbillNum, settleBillNum: itm.InvGroupNum, state: SettleBillState.客户已收票, invGroupNum: itm.InvGroupNum, site: string.Empty ); - bbacmainlist.Add( bbac ); + bbacmainlist.Add(bbac); } var bbacDetail = new List(); foreach (var itm in entityList) { - var detail= new BBAC_PD_DETAIL( - guid: itm.Id, - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvbillNum, - lU: itm.LU, - rELU: string.Empty, - pN: itm.PN, - rEPN: string.Empty, - site: itm.Site, - qty: itm.Qty, - price: 0, - invGroupNum: itm.InvGroupNum, - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - extend1: string.Empty, - extend2: string.Empty, - extend3: string.Empty, - extend4: itm.PartCode, - p_businessType:itm.BusinessType - );//厂内实际零件号 + var detail = new BBAC_PD_DETAIL( + guid: itm.Id, + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvbillNum, + lU: itm.LU, + rELU: string.Empty, + pN: itm.PN, + rEPN: string.Empty, + site: itm.Site, + qty: itm.Qty, + price: 0, + invGroupNum: itm.InvGroupNum, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + extend1: string.Empty, + extend2: string.Empty, + extend3: string.Empty, + extend4: itm.PartCode, + p_businessType: itm.BusinessType + );//厂内实际零件号 detail.RELU = string.IsNullOrEmpty(itm.RealPartCode) ? itm.PartCode : itm.RealPartCode;//厂内替换零件号 detail.Extend2 = itm.ErpLoc;//ERP库位 bbacDetail.Add(detail); } - await _repository.DbContext.BulkInsertAsync(bbacmainlist); - await _repository.DbContext.BulkInsertAsync(bbacDetail); + await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); foreach (var itm in invList) { itm.State = SettleBillState.客户已收票; }; - await _repository.DbContext.BulkUpdateAsync(invList); + await _repository.DbContext.BulkUpdateAsync(invList).ConfigureAwait(false); return true; } - else if (inv.BusinessType == EnumBusinessType.JisHBPO || inv.BusinessType == EnumBusinessType.MaiDanJianHBPO) + else if (inv.BusinessType == EnumBusinessType.JisHBPO || inv.BusinessType == EnumBusinessType.MaiDanJianHBPO) { var pdlist = _pdhbpoRepository.Where(p => p_invs.Contains(p.BillNum)).ToList();//包含发票号的代扣减单 if (pdlist != null && pdlist.Count > 0) @@ -629,7 +547,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var involdname = involdList.Select(p => p.InvbillNum); var adjlist = _adjRepository.Where(p => involdname.Contains(p.InvBillNum)); - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Any()) { foreach (var itm in adjlist) { @@ -660,29 +578,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (newlist.Count > 0) { var entitys = invList.Where(p => newlist.Contains(p.InvbillNum)).ToList(); - var entityDetail = await _hbpoMng.GetDetailByInbillNumAsync(newlist);//结算明细 + var entityDetail = await _hbpoMng.GetDetailByInbillNumAsync(newlist).ConfigureAwait(false);//结算明细 var adjlist = _adjRepository.Where(p => newlist.Contains(p.InvBillNum)).ToList();//发票关联调整表明细 - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { - var entity= new HBPO_CAN_SA_DETAIL( - guid: GuidGenerator.Create(), - keyCode: itm.KeyCode, - version: itm.Version, - billNum: itm.InvGroupNum, - settleBillNum: itm.SettleBillNum, - lU: itm.LU, - pN: itm.PN, - site: itm.Site, - qty: itm.Qty, - price: 0, - businessType: itm.BusinessType, - settleDate: itm.SettleDate, - groupNum: itm.GroupNum, - invGroupNum: itm.InvGroupNum, - invbillnum: itm.InvBillNum, - partcode: itm.PartCode); + var entity = new HBPO_CAN_SA_DETAIL( + guid: GuidGenerator.Create(), + keyCode: itm.KeyCode, + version: itm.Version, + billNum: itm.InvGroupNum, + settleBillNum: itm.SettleBillNum, + lU: itm.LU, + pN: itm.PN, + site: itm.Site, + qty: itm.Qty, + price: 0, + businessType: itm.BusinessType, + settleDate: itm.SettleDate, + groupNum: itm.GroupNum, + invGroupNum: itm.InvGroupNum, + invbillnum: itm.InvBillNum, + partcode: itm.PartCode); entity.ErpLoc = itm.ErpLoc;//补字段库位 entity.PartCode = itm.RealPartCode;//真实零件号 @@ -727,7 +645,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend2: string.Empty, extend3: string.Empty, extend4: itm.PartCode, - p_businessType:itm.BusinessType + p_businessType: itm.BusinessType ); entity.RELU = string.IsNullOrEmpty(itm.RealPartCode) ? itm.PartCode : itm.RealPartCode;//厂内替换零件号 entity.Extend2 = itm.ErpLoc;//ERP库位 @@ -735,13 +653,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers bbacDetail.Add(entity ); } - await _repository.DbContext.BulkInsertAsync(bbacmainlist); - await _repository.DbContext.BulkInsertAsync(bbacDetail); + await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); foreach (var itm in invList) { itm.State = SettleBillState.客户已收票; }; - await _repository.DbContext.BulkUpdateAsync(invList); + await _repository.DbContext.BulkUpdateAsync(invList).ConfigureAwait(false); return true; } else @@ -774,7 +692,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var involdList = invList.Where(p => oldinvs.Contains(p.ParentInvbillNum)).ToList(); var involdname = involdList.Select(p => p.InvbillNum); var adjlist = _adjRepository.Where(p => involdname.Contains(p.InvBillNum)); - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Any()) { foreach (var itm in adjlist) { @@ -806,9 +724,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (newlist.Count > 0) { var entitys = invList.Where(p => newlist.Contains(p.InvbillNum)).ToList(); - var entityDetail = await _pubMng.GetDetailByInbillNumAsync(newlist);//结算明细 + var entityDetail = await _pubMng.GetDetailByInbillNumAsync(newlist).ConfigureAwait(false);//结算明细 var adjlist = _adjRepository.Where(p => newlist.Contains(p.InvBillNum)).ToList();//发票关联调整表明细 - if (adjlist != null && adjlist.Count() > 0) + if (adjlist != null && adjlist.Count > 0) { foreach (var itm in adjlist) { @@ -878,32 +796,35 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend4: itm.PartCode ); - entity.RELU =string.IsNullOrEmpty(itm.RealPartCode)?itm.PartCode:itm.RealPartCode;//厂内替换零件号 + entity.RELU = string.IsNullOrEmpty(itm.RealPartCode) ? itm.PartCode : itm.RealPartCode;//厂内替换零件号 entity.Extend2 = itm.ErpLoc;//ERP库位 bbacDetail.Add(entity ); } - await _repository.DbContext.BulkInsertAsync(bbacmainlist); - await _repository.DbContext.BulkInsertAsync(bbacDetail); + await _repository.DbContext.BulkInsertAsync(bbacmainlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(bbacDetail).ConfigureAwait(false); foreach (var itm in invList) { itm.State = SettleBillState.客户已收票; }; - await _repository.DbContext.BulkUpdateAsync(invList); + await _repository.DbContext.BulkUpdateAsync(invList).ConfigureAwait(false); return true; } - + } public virtual async Task Reject(INVOICE_GRP p_entity) { - if (await Reject(p_entity.InvGroupNum)) - + if (await Reject(p_entity.InvGroupNum).ConfigureAwait(false)) + { return true; + } else + { return false; + } } /// /// 同一退回 @@ -913,10 +834,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public virtual async Task Reject(string groupbillNum) { - var ls = await _repository.Where(p => p.InvGroupNum == groupbillNum).ToListAsync(); + var ls = await _repository.Where(p => p.InvGroupNum == groupbillNum).ToListAsync().ConfigureAwait(false); if (ls != null && ls.Count > 0) { - var count=ls.Select(p => p.State).Distinct().Count(); + var count = ls.Select(p => p.State).Distinct().Count(); if (count > 1) { throw new UserFriendlyException($"发票分组{groupbillNum}包含发票不是同一状态不能退回", "400"); @@ -924,7 +845,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var first = ls.FirstOrDefault(); if (first.State == SettleBillState.客户已收票 || first.State == SettleBillState.已扣减) { - throw new UserFriendlyException( $"发票分组{groupbillNum}客户已经是客户已收票不能退回", "400"); + throw new UserFriendlyException($"发票分组{groupbillNum}客户已经是客户已收票不能退回", "400"); } foreach (var p_entity in ls) { @@ -935,21 +856,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var groupList = _groupRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var notList = _notRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); var detailList = _detailRepository.Where(p => p.InvGroupNum == p_entity.InvGroupNum).ToList(); - await _repository.DbContext.BulkDeleteAsync(entList); - await _repository.DbContext.BulkDeleteAsync(groupList); - await _repository.DbContext.BulkDeleteAsync(notList); - await _repository.DbContext.BulkDeleteAsync(detailList); + await _repository.DbContext.BulkDeleteAsync(entList).ConfigureAwait(false); + await _repository.DbContext.BulkDeleteAsync(groupList).ConfigureAwait(false); + await _repository.DbContext.BulkDeleteAsync(notList).ConfigureAwait(false); + await _repository.DbContext.BulkDeleteAsync(detailList).ConfigureAwait(false); if (first.BusinessType == EnumBusinessType.JisBBAC) { - await _bbacMng.SetNewState(groupbillNum); + await _bbacMng.SetNewState(groupbillNum).ConfigureAwait(false); } - else if (first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType==EnumBusinessType.JisHBPO) + else if (first.BusinessType == EnumBusinessType.JisHBPO || first.BusinessType == EnumBusinessType.JisHBPO) { - await _hbpoMng.SetNewState(groupbillNum); + await _hbpoMng.SetNewState(groupbillNum).ConfigureAwait(false); } else { - await _pubMng.SetNewState(groupbillNum); + await _pubMng.SetNewState(groupbillNum).ConfigureAwait(false); } //await _repository.DbContext.BulkUpdateAsync(canList); } @@ -971,7 +892,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public virtual async Task BackAsync(string billNum) { - var _ls = await _repository.Where(p => p.InvGroupNum == billNum).ToListAsync(); + var _ls = await _repository.Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false); if (_ls != null && _ls.Count > 0) { foreach (var p_entity in _ls) @@ -1200,7 +1121,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers groupList.AddRange(group1); } - var lst=dtos.Where(p => !string.IsNullOrEmpty(p.Site)).ToList(); + var lst = dtos.Where(p => !string.IsNullOrEmpty(p.Site)).ToList(); string site = lst.FirstOrDefault().Site; string clientCode = string.Empty; switch (site) @@ -1238,21 +1159,19 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers ); invbill.ClientCode = clientCode; - - invbill.Site = dtos.FirstOrDefault().Site; invlist.Add(invbill); } - await _repository.DbContext.BulkInsertAsync(invlist); - await _repository.DbContext.BulkInsertAsync(groupList); - await _repository.DbContext.BulkInsertAsync(detailList); + await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); if (salist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(salist); + await _repository.DbContext.BulkUpdateAsync(salist).ConfigureAwait(false); } if (adjlist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(adjlist); + await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); } //await _repository.DbContext.BulkInsertAsync(notDetialList); _invls = invlist.Select(p => p.InvbillNum).ToList(); @@ -1362,10 +1281,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers EndDate = itm.Key.EndDate }).ToList(); decimal amt = detailDtos.Sum(k => k.Amt);//金额 - decimal txtAmt =detailDtos.Sum(k => k.Amt) + Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税后金额 + decimal txtAmt = detailDtos.Sum(k => k.Amt) + Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税后金额 decimal realAmt = Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税额 - - + var mapList = new List(); foreach (var groupnum in ls) { @@ -1482,10 +1400,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers realAmt: realAmt ); - string site = dtos.Where(p=>!string.IsNullOrEmpty(p.Site)).FirstOrDefault().Site; + string site = dtos.Where(p => !string.IsNullOrEmpty(p.Site)).FirstOrDefault().Site; string clientCode = string.Empty; - switch(site) + switch (site) { case "1040": clientCode = "C001"; @@ -1498,7 +1416,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers break; } invbill.ClientCode = clientCode; - invbill.Site= dtos.FirstOrDefault().Site; + invbill.Site = dtos.FirstOrDefault().Site; invbill.CreationTime = DateTime.Now; invlist.Add(invbill); i++; @@ -1507,23 +1425,23 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers //{ // try // { - // 执行批量数据操作 - if (salist.Count > 0) - { - await _repository.DbContext.BulkUpdateAsync(salist); - } - await _repository.DbContext.BulkInsertAsync(invlist); - await _repository.DbContext.BulkInsertAsync(groupList); - await _repository.DbContext.BulkInsertAsync(detailList); + // 执行批量数据操作 + if (salist.Count > 0) + { + await _repository.DbContext.BulkUpdateAsync(salist).ConfigureAwait(false); + } + await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); - if (adjlist.Count > 0) - { - await _repository.DbContext.BulkUpdateAsync(adjlist); - } - if (notDetialList.Count > 0) - { - await _repository.DbContext.BulkInsertAsync(notDetialList); - } + if (adjlist.Count > 0) + { + await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); + } + if (notDetialList.Count > 0) + { + await _repository.DbContext.BulkInsertAsync(notDetialList).ConfigureAwait(false); + } // 提交事务 // transaction.Commit(); // } @@ -1537,16 +1455,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _invls = invlist.Select(p => p.InvbillNum).ToList(); } - return _invls; } - - - - - - /// /// hbpojis /// @@ -1687,7 +1598,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers if (p_first == true)//第一次开票需要有分组号 { var mapList = new List(); - var invoiceGroupList = query.GroupBy(p => new { p.GroupNum, p.PN }).Select(p => p.FirstOrDefault()).ToList(); + var invoiceGroupList = query.GroupBy(p => new { p.GroupNum, p.PN }).Select(p => p.FirstOrDefault()).ToList(); foreach (var groupnum in invoiceGroupList)//一次开票可结 { mapList.Add(new INVOICE_MAP_GROUP( @@ -1706,9 +1617,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { groupList.AddRange(mapList); } - var notsettle= _nothbpoRepository.Where(p => p.SettleBillNum == p_InvGroupNum);//一次开票时查找不可结数据,追加需求 + var notsettle = _nothbpoRepository.Where(p => p.SettleBillNum == p_InvGroupNum);//一次开票时查找不可结数据,追加需求 - if (notsettle != null && notsettle.Count() > 0) + if (notsettle != null && notsettle.Any()) { var innotls = new List(); foreach (var nitm in notsettle) @@ -1785,18 +1696,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invbill.CreationTime = DateTime.Now; invlist.Add(invbill); } - await _repository.DbContext.BulkInsertAsync(invlist); - await _repository.DbContext.BulkInsertAsync(groupList); - await _repository.DbContext.BulkInsertAsync(detailList); + await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); if (salist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(salist); + await _repository.DbContext.BulkUpdateAsync(salist).ConfigureAwait(false); } if (adjlist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(adjlist); + await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); } - await _repository.DbContext.BulkInsertAsync(notDetialList); + await _repository.DbContext.BulkInsertAsync(notDetialList).ConfigureAwait(false); _invls = invlist.Select(p => p.InvbillNum).ToList(); } return _invls; @@ -1812,8 +1723,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public async Task> JITInvoice(List p_list,List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType,bool p_first) - where TDetail:SA_CAN_BASE + public async Task> JITInvoice(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first) + where TDetail : SA_CAN_BASE { List _invls = new List(); var _query = dtos.GroupBy(p => new { p.GroupNum }).Select(p => new { GroupNum = p.Key.GroupNum, Amt = p.Sum(itm => itm.Amt) }); @@ -1903,7 +1814,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) .Select(itm => new { - PartCode=itm.Key.PartCode, + PartCode = itm.Key.PartCode, InvGroupNum = itm.Key.InvGroupNum, LU = itm.Key.PartCode, ContactDocID = itm.Key.ContractDocID, @@ -1915,7 +1826,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers }) .ToList(); decimal amt = detailDtos.Sum(k => k.Amt);//金额 - decimal txtAmt = detailDtos.Sum(k => k.Amt)+ Math.Round(detailDtos.Sum(k => k.Amt)*0.13m, 2);//税后金额 + decimal txtAmt = detailDtos.Sum(k => k.Amt) + Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税后金额 decimal realAmt = Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税额 var mapList = new List(); foreach (var groupnum in ls) @@ -1954,7 +1865,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend2: string.Empty, beginDate: detail.BeginDate, endDate: detail.EndDate, - partcode:detail.PartCode + partcode: detail.PartCode )); } if (_entityDetailList.Count > 0) @@ -1998,18 +1909,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invbill.CreationTime = DateTime.Now; invlist.Add(invbill); } - await _repository.DbContext.BulkInsertAsync(invlist); - await _repository.DbContext.BulkInsertAsync(groupList); - await _repository.DbContext.BulkInsertAsync(detailList); - if(salist.Count>0) + await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); + if (salist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(salist); + await _repository.DbContext.BulkUpdateAsync(salist).ConfigureAwait(false); } - if(adjlist.Count > 0) + if (adjlist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(adjlist); + await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); } - if(p_notlist.Count > 0) + if (p_notlist.Count > 0) { var innotls = new List(); var notls = p_notlist.GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); @@ -2030,16 +1941,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers )); } - await _repository.DbContext.BulkInsertAsync(innotls); + await _repository.DbContext.BulkInsertAsync(innotls).ConfigureAwait(false); } _invls = invlist.Select(p => p.InvbillNum).ToList(); } return _invls; } - - - [UnitOfWork(false)] /// /// 重开一次开票 @@ -2049,12 +1957,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public async Task ReissueFirstInvoice(List p_list,List p_adjlist, List dtos, string p_OldInvBillNum, int p_version) - where TDetail:SA_CAN_BASE + public async Task ReissueFirstInvoice(List p_list, List p_adjlist, List dtos, string p_OldInvBillNum, int p_version) + where TDetail : SA_CAN_BASE { if (!string.IsNullOrEmpty(p_OldInvBillNum)) { - var inv = await GetInvoiceAsync(p_OldInvBillNum); + var inv = await GetInvoiceAsync(p_OldInvBillNum).ConfigureAwait(false); if (inv == null) { @@ -2071,28 +1979,28 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers switch (inv.BusinessType) { case EnumBusinessType.MaiDanJianHBPO: - invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true); + invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianBBAC: - invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true); + invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true);//重开可以变多张发票 + invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.ZhiGongJianHBPO: - invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true);//重开可以变多张发票 + invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.BeiJian: - invlist = await BJInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum,inv.InvbillNum, inv.BusinessType, true); + invlist = await BJInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - invlist = await FirstInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType);//重开可以变多张发票 + invlist = await FirstInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.JisHBPO: - invlist = await FirstInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType);//重开可以变多张发票 + invlist = await FirstInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.YinDuJian: - invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true);//重开可以变多张发票 + invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票 break; } @@ -2107,7 +2015,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers return false; } - public async Task> BJInvoice(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType,bool p_first=true) + public async Task> BJInvoice(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first = true) where TDetail : SA_CAN_BASE { List _invls = new List(); @@ -2131,7 +2039,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("CINV"); } - + List invoiceGroupNumList = new List();//每个发票对应的结算分组号 List List = new List(); decimal sum = itm.Value;//初始分组合计金额 @@ -2213,20 +2121,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers .ToList(); var query = from inv1 in invdetails join dto1 in dtos on - new { inv1.LU,inv1.PartCode, inv1.PN,inv1.Id } equals new { dto1.LU,dto1.PartCode, dto1.PN ,dto1.Id + new { inv1.LU, inv1.PartCode, inv1.PN, inv1.Id } equals new + { + dto1.LU, + dto1.PartCode, + dto1.PN, + dto1.Id } select new { PartCode = inv1.PartCode, InvGroupNum = inv1.InvGroupNum, LU = inv1.LU, - GroupNum=inv1.GroupNum, + GroupNum = inv1.GroupNum, Price = dto1.Price, Amt = dto1.Amt, Qty = dto1.Qty, BeginDate = dto1.BeginDate, EndDate = dto1.EndDate, - LineCode=dto1.LineCode, + LineCode = dto1.LineCode, DeliveryNumber = inv1.GetProperty("DeliveryNumber", ""),//交货号 InvoiceNumber = inv1.GetProperty("InvoiceNumber", ""),//发票号 VendorCode = inv1.GetProperty("VendorCode", ""),//供应商代码 @@ -2236,13 +2149,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers PartName = inv1.GetProperty("PartName", ""),//零件名称 }; - decimal amt = detailDtos.Sum(k => k.Amt);//金额 decimal txtAmt = detailDtos.Sum(k => k.Amt) + Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税后金额 decimal readAmt = Math.Round(detailDtos.Sum(k => k.Amt) * 0.13m, 2);//税额 - - var mapList = new List(); foreach (var groupnum in ls) { @@ -2263,7 +2173,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers groupList.AddRange(mapList); } List _entityDetailList = new List(); - foreach (var detail in query.ToList()) { @@ -2283,15 +2192,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers beginDate: detail.BeginDate, endDate: detail.EndDate, partcode: detail.PartCode); - entity.LineCode = detail.LineCode; - entity.SetProperty("DeliveryNumber", detail.DeliveryIndexNumber);//交货号 - entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 - entity.SetProperty("VendorName", detail.VendorName);//供应商名称 - entity.SetProperty("PurchaseOrderNumber", "");//采购订单号 - entity.SetProperty("DeliveryIndexNumber", "");//交付索引号 - entity.SetProperty("PartName", "");//零件名称 - - _entityDetailList.Add(entity); + entity.LineCode = detail.LineCode; + entity.SetProperty("DeliveryNumber", detail.DeliveryIndexNumber);//交货号 + entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 + entity.SetProperty("VendorName", detail.VendorName);//供应商名称 + entity.SetProperty("PurchaseOrderNumber", "");//采购订单号 + entity.SetProperty("DeliveryIndexNumber", "");//交付索引号 + entity.SetProperty("PartName", "");//零件名称 + + _entityDetailList.Add(entity); } if (_entityDetailList.Count > 0) { @@ -2319,21 +2228,21 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invbill.ClientCode = "C001"; invlist.Add(invbill); } - await _repository.DbContext.BulkInsertAsync(invlist); - await _repository.DbContext.BulkInsertAsync(groupList); - await _repository.DbContext.BulkInsertAsync(detailList); + await _repository.DbContext.BulkInsertAsync(invlist).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(groupList).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(detailList).ConfigureAwait(false); if (salist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(salist); + await _repository.DbContext.BulkUpdateAsync(salist).ConfigureAwait(false); } if (adjlist.Count > 0) { - await _repository.DbContext.BulkUpdateAsync(adjlist); + await _repository.DbContext.BulkUpdateAsync(adjlist).ConfigureAwait(false); } if (notDetialList.Count > 0) { - await _repository.DbContext.BulkInsertAsync(notDetialList); + await _repository.DbContext.BulkInsertAsync(notDetialList).ConfigureAwait(false); } _invls = invlist.Select(p => p.InvbillNum).ToList(); } @@ -2353,7 +2262,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { if (!string.IsNullOrEmpty(p_OldInvBillNum)) { - var inv = await GetInvoiceAsync(p_OldInvBillNum); + var inv = await GetInvoiceAsync(p_OldInvBillNum).ConfigureAwait(false); if (inv == null) { @@ -2370,30 +2279,30 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers switch (inv.BusinessType) { case EnumBusinessType.MaiDanJianHBPO: - invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false); + invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianBBAC: - invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false); + invlist = await MakeInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType,false);//重开可以变多张发票 + invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.ZhiGongJianHBPO: - invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false);//重开可以变多张发票 + invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.BeiJian: - invlist = await BJInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false); + invlist = await BJInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - invlist = await SecInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType); + invlist = await SecInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false); break; case EnumBusinessType.JisHBPO: - invlist = await SecInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType); + invlist = await SecInvoice(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false); break; case EnumBusinessType.YinDuJian: - invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false);//重开可以变多张发票 + invlist = await JITInvoice(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false);//重开可以变多张发票 break; - + } if (invlist.Count == 0) @@ -2412,12 +2321,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } return false; } - - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs index b4f02911..865e83d3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/INV_MNG_EXT.cs @@ -1,37 +1,21 @@ -using EFCore.BulkExtensions; -using EmptyFiles; -using Hangfire; -using Microsoft.AspNetCore.SignalR; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.EntityFrameworkCore; -using NPOI.SS.Formula.Functions; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; using System; -using System.Collections; using System.Collections.Generic; using System.Linq; -using System.Security.Policy; -using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Bases; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.Auditing; using Volo.Abp.Data; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Entities.BQ.Temp; -using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { public partial class INV_MNG : DomainService { - /// /// hbpo、jit、备件等 @@ -42,13 +26,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// 原发票号 public async Task> SecInvoiceExtend(List p_list, List p_ajdlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType) where TDetail : SA_CAN_BASE - + { var detailList = new List(); List _invls = new List(); - var groups1 = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups1 = dtos.GroupBy(p => new { p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { - PartCode=p.Key.PartCode, + PartCode = p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -57,7 +41,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers BeginDate = p.Key.BeginDate, EndDate = p.Key.EndDate }).ToList();//汇总记录不出现重复值 - var groups = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups = dtos.GroupBy(p => new { p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { PartCode = p.Key.PartCode, LU = p.Key.LU, @@ -72,7 +56,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var group in groups) { int i = groups1.Count(p => p.LU == group.LU - && p.PartCode==group.PartCode + && p.PartCode == group.PartCode && p.BeginDate == group.BeginDate && p.EndDate == group.EndDate && p.ContractDocID == group.ContractDocID @@ -111,8 +95,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invoiceMap.Add(invoiceBillNum, tempList); var query = from itm in groups1 //更新分组 join itm1 in tempList - on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode} - equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp + on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID, itm.PartCode } + equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID, itm1.PartCode } into temp from tm in temp where tm == null select new TMEP_INV @@ -132,7 +116,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var groupList = new List(); var notDetialList = new List(); - + var invlist = new List(); var salist = new List(); var adjlist = new List(); @@ -140,26 +124,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var key = group.Key;//发票票号 var ls = group.Value;//发票明细 - - //反向查找结算数据 - var query = from itm in dtos - join itm1 in ls - on new { itm.LU,itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate } - join itm2 in p_list on new { itm.PartCode,itm.PN, itm.SettleDate } equals new { itm2.PartCode,itm2.PN, itm2.SettleDate } - select itm2; - foreach (var itm in query) - { - itm.InvbillNum = key; - salist.Add(itm); - } + + //反向查找结算数据 + var query = from itm in dtos + join itm1 in ls + on new { itm.LU, itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.PartCode, itm1.BeginDate, itm1.EndDate } + join itm2 in p_list on new { itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.PartCode, itm2.PN, itm2.SettleDate } + select itm2; + foreach (var itm in query) + { + itm.InvbillNum = key; + salist.Add(itm); + } if (!string.IsNullOrEmpty(p_parentInvBillNum)) { //反向查找调整数据 var query1 = from itm in dtos - join itm1 in ls - on new { itm.LU,itm.PartCode ,itm.BeginDate, itm.EndDate } equals new { itm1.LU,itm1.PartCode, itm1.BeginDate, itm1.EndDate } - join itm2 in p_ajdlist on new { itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.PartCode, itm2.PN, itm2.SettleDate } - select itm2; + join itm1 in ls + on new { itm.LU, itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.PartCode, itm1.BeginDate, itm1.EndDate } + join itm2 in p_ajdlist on new { itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.PartCode, itm2.PN, itm2.SettleDate } + select itm2; foreach (var itm in query1) { @@ -169,7 +153,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } - List < INVOICE_WAIT_DETAIL > _entityDetailList = new List(); + List _entityDetailList = new List(); foreach (var detail in ls) { _entityDetailList.Add( @@ -187,7 +171,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend2: string.Empty, beginDate: detail.BeginDate, endDate: detail.EndDate, - partcode:detail.PartCode + partcode: detail.PartCode )); } if (_entityDetailList.Count > 0) @@ -312,7 +296,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = itm.Value;//结算分组号列表 //反向查找结算数据 var invdetails = p_list.Where(p => ls.Contains(p.GroupNum)).ToList(); - var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode,p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) + var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }) .Select(itm => new { PartCode = itm.Key.PartCode, @@ -384,13 +368,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// 版本号 /// 发票分组 /// 原发票号 - public async Task> MakeInvoiceExtend(List details,List p_adjlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first) where TDetail : SA_CAN_BASE + public async Task> MakeInvoiceExtend(List details, List p_adjlist, List dtos, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first) where TDetail : SA_CAN_BASE { List _invls = new List(); var detailList = new List(); - var groups1 = dtos.GroupBy(p => new { p.PartCode,p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups1 = dtos.GroupBy(p => new { p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { - PartCode=p.Key.PartCode, + PartCode = p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -399,9 +383,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers BeginDate = p.Key.BeginDate, EndDate = p.Key.EndDate }).ToList();//汇总记录不出现重复值 - var groups = dtos.GroupBy(p => new {p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV + var groups = dtos.GroupBy(p => new { p.PartCode, p.LU, p.Price, p.BeginDate, p.EndDate, p.ContractDocID }).Select(p => new TMEP_INV { - PartCode=p.Key.PartCode, + PartCode = p.Key.PartCode, LU = p.Key.LU, Amt = p.Sum(itm => itm.Amt), Qty = p.Sum(itm => itm.Qty), @@ -414,7 +398,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var group in groups) { int i = groups1.Count(p => p.LU == group.LU - && p.PartCode==group.PartCode + && p.PartCode == group.PartCode && p.BeginDate == group.BeginDate && p.EndDate == group.EndDate && p.ContractDocID == group.ContractDocID @@ -439,7 +423,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers && group.BeginDate == group1.BeginDate && group.EndDate == group1.EndDate && group1.ContractDocID == group.ContractDocID - && group1.PartCode== group1.PartCode + && group1.PartCode == group1.PartCode ) { tempList.Add(group1); @@ -461,13 +445,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invoiceMap.Add(invoiceBillNum, tempList);//每张发票的明细记录 var query = from itm in groups1 join itm1 in tempList - on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID ,itm.PartCode} - equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID,itm1.PartCode } into temp + on new { itm.LU, itm.BeginDate, itm.EndDate, itm.ContractDocID, itm.PartCode } + equals new { itm1.LU, itm1.BeginDate, itm1.EndDate, itm1.ContractDocID, itm1.PartCode } into temp from tm in temp where tm == null select new TMEP_INV { - PartCode= itm.PartCode, + PartCode = itm.PartCode, LU = itm.LU, Amt = itm.Amt, Qty = itm.Qty, @@ -489,22 +473,22 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var key = group.Key;//发票票号 var ls = group.Value;//发票明细 - //更新结算记录更新 - var query = from itm in dtos - join itm1 in ls - on new { LU=itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } - join itm2 in details on new { itm.LU,itm.PartCode,itm.PN, itm.SettleDate } equals new { itm2.LU,itm2.PartCode,itm2.PN,itm2.SettleDate } - select itm2; - foreach (var itm in query) - { - itm.InvbillNum = key; - salist.Add(itm); - } + //更新结算记录更新 + var query = from itm in dtos + join itm1 in ls + on new { LU = itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } + join itm2 in details on new { itm.LU, itm.PartCode, itm.PN, itm.SettleDate } equals new { itm2.LU, itm2.PartCode, itm2.PN, itm2.SettleDate } + select itm2; + foreach (var itm in query) + { + itm.InvbillNum = key; + salist.Add(itm); + } if (!string.IsNullOrEmpty(p_parentInvBillNum))//发票作废开票 { var query1 = from itm in dtos join itm1 in ls - on new {LU= itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } + on new { LU = itm.PartCode, itm.BeginDate, itm.EndDate } equals new { itm1.LU, itm1.BeginDate, itm1.EndDate } join itm2 in p_adjlist on new { itm.LU, itm.SettleDate } equals new { itm2.LU, itm2.SettleDate } select itm2; foreach (var itm in query1) @@ -531,8 +515,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend2: string.Empty, beginDate: detail.BeginDate, endDate: detail.EndDate, - partcode:detail.PartCode - + partcode: detail.PartCode + )); } if (_entityDetailList.Count > 0) @@ -556,15 +540,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invoiceBillState: InvoiceBillState.正常, tax: 0, parent: p_parentInvBillNum, - preTaxDiff:0, - taxDiff:0, - clientCode:string.Empty, - realAmt:realAmt + preTaxDiff: 0, + taxDiff: 0, + clientCode: string.Empty, + realAmt: realAmt ); invlist.Add(invbill); } - + } return detailList; } @@ -579,8 +563,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public async Task> JITInvoiceExtend(List p_list,List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType,bool p_first) - where TDetail:SA_CAN_BASE + public async Task> JITInvoiceExtend(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first) + where TDetail : SA_CAN_BASE { List _invls = new List(); var detailList = new List(); @@ -604,7 +588,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("CINV"); } - + List invoiceGroupNumList = new List();//每个发票对应的结算分组号 List List = new List(); decimal sum = itm.Value;//初始分组合计金额 @@ -644,7 +628,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var groupList = new List(); var notDetialList = new List(); - + var invlist = new List(); //var salist = new List(); var adjlist = new List(); @@ -670,10 +654,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers // adjlist.Add(detail); // } //} - var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID,p.LU }) + var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID, p.LU }) .Select(itm => new { - PartCode=itm.Key.PartCode, + PartCode = itm.Key.PartCode, InvGroupNum = itm.Key.InvGroupNum, LU = itm.Key.LU, ContactDocID = itm.Key.ContractDocID, @@ -724,7 +708,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend2: string.Empty, beginDate: detail.BeginDate, endDate: detail.EndDate, - partcode:detail.PartCode + partcode: detail.PartCode )); } if (_entityDetailList.Count > 0) @@ -734,7 +718,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var innotls = new List(); if (p_notlist != null && p_notlist.Count > 0) { - var notls = p_notlist.Where(p=>ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); + var notls = p_notlist.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.GroupNum, p.LU }).Select(p => new { GroupNum = p.Key.GroupNum, LU = p.Key.LU, Qty = p.Sum(itm => itm.Qty) }); foreach (var nitm in notls) { innotls.Add(new INVOICE_NOT_SETTLE( @@ -747,7 +731,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers extend1: string.Empty, extend2: string.Empty, qty: nitm.Qty, - p_invbillnum:key + p_invbillnum: key )); } if (innotls.Count > 0) @@ -787,18 +771,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// /// - public async Task> ReissueFirstInvoiceExtend(List p_list,List p_adjlist, List dtos, string p_OldInvBillNum, int p_version) - where TDetail:SA_CAN_BASE + public async Task> ReissueFirstInvoiceExtend(List p_list, List p_adjlist, List dtos, string p_OldInvBillNum, int p_version) + where TDetail : SA_CAN_BASE { List invlist = new List(); if (!string.IsNullOrEmpty(p_OldInvBillNum)) { - - var inv = await GetInvoiceAsync(p_OldInvBillNum); + + var inv = await GetInvoiceAsync(p_OldInvBillNum).ConfigureAwait(false); if (inv == null) { - throw new UserFriendlyException( $"找不到选择要重开发票号{p_OldInvBillNum}不能重开", "400"); + throw new UserFriendlyException($"找不到选择要重开发票号{p_OldInvBillNum}不能重开", "400"); } if (inv.InvoiceState == InvoiceBillState.报废) { @@ -806,33 +790,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } //inv.InvoiceState = InvoiceBillState.报废; - - switch (inv.BusinessType) { case EnumBusinessType.MaiDanJianHBPO: - invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, true); + invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, true).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianBBAC: - invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, true); + invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, true).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true);//重开可以变多张发票 + invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.ZhiGongJianHBPO: - invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true);//重开可以变多张发票 + invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.BeiJian: - invlist = await BJInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true); + invlist = await BJInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - invlist = await FirstInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType);//重开可以变多张发票 + invlist = await FirstInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.JisHBPO: - invlist = await FirstInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType);//重开可以变多张发票 + invlist = await FirstInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.YinDuJian: - invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true);//重开可以变多张发票 + invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, true).ConfigureAwait(false);//重开可以变多张发票 break; } @@ -840,11 +822,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } return invlist; - - } - public async Task> BJInvoiceExtend(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType,bool p_first=true) + public async Task> BJInvoiceExtend(List p_list, List p_adjlist, List dtos, List p_notlist, int p_version, string p_InvGroupNum, string p_parentInvBillNum, EnumBusinessType businessType, bool p_first = true) where TDetail : SA_CAN_BASE { List _invls = new List(); @@ -869,7 +849,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { invoiceBillNum = OrderNumberGenerator.GenerateOrderNumber("CINV"); } - + List invoiceGroupNumList = new List();//每个发票对应的结算分组号 List List = new List(); decimal sum = itm.Value;//初始分组合计金额 @@ -909,7 +889,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var groupList = new List(); var notDetialList = new List(); - + var invlist = new List(); var salist = new List(); var adjlist = new List(); @@ -932,11 +912,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers foreach (var detail in adjdetails) { detail.InvBillNum = key; - + } } - var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID,p.LU }) + var detailDtos = dtos.Where(p => ls.Contains(p.GroupNum)).GroupBy(p => new { p.InvGroupNum, p.PartCode, p.Price, p.BeginDate, p.EndDate, p.ContractDocID, p.LU }) .Select(itm => new { PartCode = itm.Key.PartCode, @@ -953,13 +933,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var query = from inv1 in invdetails join dto1 in dtos on - new { inv1.LU, inv1.PN,inv1.Id } equals new { dto1.LU, dto1.PN, dto1.Id } + new { inv1.LU, inv1.PN, inv1.Id } equals new { dto1.LU, dto1.PN, dto1.Id } select new { PartCode = inv1.PartCode, InvGroupNum = inv1.InvGroupNum, LU = inv1.LU, - GroupNum=inv1.GroupNum, + GroupNum = inv1.GroupNum, Price = inv1.Price, Amt = dto1.Amt, Qty = dto1.Qty, @@ -1015,15 +995,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers beginDate: detail.BeginDate, endDate: detail.EndDate, partcode: detail.PartCode); - entity.SetProperty("DeliveryNumber", detail.DeliveryIndexNumber);//交货号 - entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 + entity.SetProperty("DeliveryNumber", detail.DeliveryIndexNumber);//交货号 + entity.SetProperty("VendorCode", detail.VendorCode);//供应商代码 entity.SetProperty("VendorName", detail.VendorName);//供应商名称 entity.SetProperty("PurchaseOrderNumber", "");//采购订单号 entity.SetProperty("DeliveryIndexNumber", "");//交付索引号 entity.SetProperty("PartName", "");//零件名称 - _entityDetailList.Add( entity - + _entityDetailList.Add(entity + ); } if (_entityDetailList.Count > 0) @@ -1073,7 +1053,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers ); invlist.Add(invbill); } - + } return detailList; @@ -1092,7 +1072,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers List invlist = new List(); if (!string.IsNullOrEmpty(p_OldInvBillNum)) { - var inv = await GetInvoiceAsync(p_OldInvBillNum); + var inv = await GetInvoiceAsync(p_OldInvBillNum).ConfigureAwait(false); if (inv == null) { @@ -1107,33 +1087,32 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers switch (inv.BusinessType) { case EnumBusinessType.MaiDanJianHBPO: - invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, false); + invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, false).ConfigureAwait(false); break; case EnumBusinessType.MaiDanJianBBAC: - invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, false); + invlist = await MakeInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, string.Empty, inv.BusinessType, false).ConfigureAwait(false); break; case EnumBusinessType.ZhiGongJianBBAC: - invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false);//重开可以变多张发票 + invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.ZhiGongJianHBPO: - invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false);//重开可以变多张发票 + invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false);//重开可以变多张发票 break; case EnumBusinessType.BeiJian: - invlist = await BJInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false); + invlist = await BJInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false); break; case EnumBusinessType.JisBBAC: - invlist = await SecInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType); + invlist = await SecInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false); break; case EnumBusinessType.JisHBPO: - invlist = await SecInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType); + invlist = await SecInvoiceExtend(p_list, p_adjlist, dtos, p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType).ConfigureAwait(false); break; case EnumBusinessType.YinDuJian: - invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false);//重开可以变多张发票 + invlist = await JITInvoiceExtend(p_list, p_adjlist, dtos, new List(), p_version, inv.InvGroupNum, inv.InvbillNum, inv.BusinessType, false).ConfigureAwait(false);//重开可以变多张发票 break; } - } return invlist; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/MaterialRelationshipManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/MaterialRelationshipManager.cs index 9cda2e60..218a64a3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/MaterialRelationshipManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/MaterialRelationshipManager.cs @@ -2,45 +2,45 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Services; -using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Managers; -/// -/// 客户零件关系 -/// -public class MaterialRelationshipManager : DomainService +namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { /// - /// 客户零件关系仓储 + /// 客户零件关系 /// - private readonly INormalEfCoreRepository _materialRelationshipRepository; - - public MaterialRelationshipManager(INormalEfCoreRepository materialRelationshipRepository) + public class MaterialRelationshipManager : DomainService { - _materialRelationshipRepository = materialRelationshipRepository; - } + /// + /// 客户零件关系仓储 + /// + private readonly INormalEfCoreRepository _materialRelationshipRepository; - /// - /// 添加零件关系 - /// - public async Task AddNewMaterialRelationships(IEnumerable materialRelationships) - { - //新客户零件号和厂内零件号 - var noHaveLuRePartCodes = from item1 in materialRelationships - join item2 in _materialRelationshipRepository - on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } - into temp - from item3 in temp.DefaultIfEmpty() - where item3 == null - select item1; + public MaterialRelationshipManager(INormalEfCoreRepository materialRelationshipRepository) + { + _materialRelationshipRepository = materialRelationshipRepository; + } - if (noHaveLuRePartCodes.Any()) + /// + /// 添加零件关系 + /// + public async Task AddNewMaterialRelationships(IEnumerable materialRelationships) { - await _materialRelationshipRepository.InsertManyAsync(noHaveLuRePartCodes).ConfigureAwait(false); + //新客户零件号和厂内零件号 + var noHaveLuRePartCodes = from item1 in materialRelationships + join item2 in _materialRelationshipRepository + on new { item1.ErpMaterialCode, item1.SettleMaterialCode } equals new { item2.ErpMaterialCode, item2.SettleMaterialCode } + into temp + from item3 in temp.DefaultIfEmpty() + where item3 == null + select item1; + + if (noHaveLuRePartCodes.Any()) + { + await _materialRelationshipRepository.InsertManyAsync(noHaveLuRePartCodes).ConfigureAwait(false); + } } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PD_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PD_MNG.cs index a4c0a959..6b4961c5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PD_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PD_MNG.cs @@ -1,54 +1,47 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using SettleAccount.Bases; -using SettleAccount.Domain.BQ; -using Volo.Abp.Application.Dtos; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Win.Sfs.Shared.RepositoryBase; -namespace Win.Sfs.SettleAccount.Entities.BQ.Managers; -public class PD_MNG:DomainService - where TEntity : PD_BASE_MAIN - where TEntityDetail : PD_BASE - +namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { + public class PD_MNG : DomainService + where TEntity : PD_BASE_MAIN + where TEntityDetail : PD_BASE - private readonly INormalEfCoreRepository _repository; - private readonly INormalEfCoreRepository _detailRepository; - protected PD_MNG( - INormalEfCoreRepository repository, - - INormalEfCoreRepository detailRepository - - ) - { - _repository = repository; - _detailRepository = detailRepository; - } - - public PD_MNG() { - } - public virtual async Task GetMainAsync(string billNum) - { - return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync(); - } + private readonly INormalEfCoreRepository _repository; + private readonly INormalEfCoreRepository _detailRepository; + protected PD_MNG( + INormalEfCoreRepository repository, - public virtual async Task> GetDetailAsync(string billNum) - { - return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync(); - } + INormalEfCoreRepository detailRepository + ) + { + _repository = repository; + _detailRepository = detailRepository; + } - - + public PD_MNG() + { + } + public virtual async Task GetMainAsync(string billNum) + { + return await _repository.Where(p => p.InvGroupNum == billNum).FirstOrDefaultAsync().ConfigureAwait(false); + } + public virtual async Task> GetDetailAsync(string billNum) + { + return await _detailRepository.Where(p => p.InvGroupNum == billNum).ToListAsync().ConfigureAwait(false); + } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs index 1f0e22f6..e16c0c5f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_CAN_SA_MNG.cs @@ -1,29 +1,17 @@ -using EFCore.BulkExtensions; -using Hangfire.Annotations; -using Microsoft.EntityFrameworkCore; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using SettleAccount.Domain.BQ; using Volo.Abp; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; -using Volo.Abp.ObjectMapping; -using Win.Sfs.SettleAccount.Bases.DomainServices; -using Win.Sfs.SettleAccount.Boms; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { - public class PUB_CAN_SA_MNG: DomainService - + public class PUB_CAN_SA_MNG : DomainService + { private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; @@ -43,16 +31,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers public virtual async Task SetForwardState(PUB_CAN_SA p_entiy, SettleBillState state) { - if (await SetForwardState(p_entiy.InvGroupNum, state) == true) + if (await SetForwardState(p_entiy.InvGroupNum, state).ConfigureAwait(false) == true) { return true; } - return false; - - } - - + return false; + } /// /// 向前流程 @@ -65,9 +50,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); - if (ls == null && ls.Count ==0) + if (ls == null && ls.Count == 0) { - throw new UserFriendlyException( string.Format("不存在编号为{0}",p_billNum), "400"); + throw new UserFriendlyException(string.Format("不存在编号为{0}", p_billNum), "400"); } foreach (PUB_CAN_SA p_entiy in ls) { @@ -80,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是【商务已审核】,无法设置成【财务已审核】状态", "400"); + throw new UserFriendlyException("当前状态不是【商务已审核】,无法设置成【财务已审核】状态", "400"); } break; case SettleBillState.商务已审核: @@ -90,7 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是【已开票】状态,无法设置成【商务已审核】", "400"); + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【商务已审核】", "400"); } break; case SettleBillState.已开票: @@ -100,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是【未结状态】状态,无法设置成【已开票】", "400"); + throw new UserFriendlyException("当前状态不是【未结状态】状态,无法设置成【已开票】", "400"); } break; case SettleBillState.已扣减: @@ -110,7 +95,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是[客户收票],无法设置成【财务已审核】状态", "400"); + throw new UserFriendlyException("当前状态不是[客户收票],无法设置成【财务已审核】状态", "400"); } break; case SettleBillState.客户已收票: @@ -120,11 +105,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是[财务已审核],无法设置成【客户已收票】状态", "400"); + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【客户已收票】状态", "400"); } break; } - await _repository.UpdateAsync(p_entiy); + await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); return true; } return false; @@ -142,7 +127,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var ls = _repository.Where(p => p.InvGroupNum == p_billNum).ToList(); if (ls == null && ls.Count == 0) { - throw new UserFriendlyException( string.Format("不存在发票分组号为{0}的可结算单", p_billNum), "400"); + throw new UserFriendlyException(string.Format("不存在发票分组号为{0}的可结算单", p_billNum), "400"); } foreach (PUB_CAN_SA p_entiy in ls) { @@ -156,7 +141,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是【财务已审核】,无法设置成【商务已审核】状态", "400"); + throw new UserFriendlyException("当前状态不是【财务已审核】,无法设置成【商务已审核】状态", "400"); } break; case SettleBillState.已开票: @@ -166,7 +151,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是【商务已审核】状态,无法设置成【已开票】", "400"); + throw new UserFriendlyException("当前状态不是【商务已审核】状态,无法设置成【已开票】", "400"); } break; case SettleBillState.未结状态: @@ -176,7 +161,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是【已开票】状态,无法设置成【未结状态】", "400"); + throw new UserFriendlyException("当前状态不是【已开票】状态,无法设置成【未结状态】", "400"); } break; case SettleBillState.客户已收票: @@ -186,7 +171,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态", "400"); + throw new UserFriendlyException("当前状态不是[财务已审核],无法设置成【财务已审核客户收票】状态", "400"); } break; case SettleBillState.财务已审核: @@ -196,35 +181,34 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } else { - throw new UserFriendlyException( "当前状态不是[客户已收票],无法设置成【财务已审核】状态", "400"); + throw new UserFriendlyException("当前状态不是[客户已收票],无法设置成【财务已审核】状态", "400"); } break; } - await _repository.UpdateAsync(p_entiy); + await _repository.UpdateAsync(p_entiy).ConfigureAwait(false); return true; } return false; } - public virtual async Task SetNewState(PUB_CAN_SA p_entiy) { - - return await SetNewState(p_entiy.BillNum); + + return await SetNewState(p_entiy.BillNum).ConfigureAwait(false); } public virtual async Task SetNewState(string billNum) { - var entity= await GetMainAsync(billNum); - if (entity != null ) + var entity = await GetMainAsync(billNum).ConfigureAwait(false); + if (entity != null) { entity.State = SettleBillState.未结状态; - await _repository.UpdateAsync(entity); + await _repository.UpdateAsync(entity).ConfigureAwait(false); return true; } return false; - ; + ; } /// /// 获得所有明细 @@ -233,7 +217,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetDetalListAsync(string billNum) { - return await _detailRepository.Where(p=>p.BillNum==billNum).ToListAsync(); + return await _detailRepository.Where(p => p.BillNum == billNum).ToListAsync().ConfigureAwait(false); } /// /// 获得主表信息 @@ -242,7 +226,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task GetMainAsync(string billNum) { - return await _repository.Where(p => p.BillNum == billNum).FirstOrDefaultAsync(); + return await _repository.Where(p => p.BillNum == billNum).FirstOrDefaultAsync().ConfigureAwait(false); } /// /// 获取发票对应结算分组所有零件 @@ -251,10 +235,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetContainsAsync(string p_invbillnum, List p_list) { - return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum && p_list.Contains(p.GroupNum)).ToListAsync().ConfigureAwait(false); } - /// /// 获取发票对应结算分组所有零件 /// @@ -262,11 +245,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetContainsAsync(string p_invbillnum) { - return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum).ToListAsync(); + return await _detailRepository.Where(p => p.InvbillNum == p_invbillnum).ToListAsync().ConfigureAwait(false); } - - /// /// 通过发票号获取结算数据 /// @@ -274,21 +255,10 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// public virtual async Task> GetDetailByInbillNumAsync(List p_invs) { - return await _detailRepository.Where(p => p_invs.Contains(p.InvbillNum)).ToListAsync(); + return await _detailRepository.Where(p => p_invs.Contains(p.InvbillNum)).ToListAsync().ConfigureAwait(false); } } - } - - - - - - - - - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index 3ba16169..88809c83 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -1,17 +1,13 @@ -using SettleAccount.Bases; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; -using Volo.Abp.Domain.Services; -using Volo.Abp; -using Win.Sfs.Shared.RepositoryBase; -using Win.Sfs.SettleAccount.Bases; using EFCore.BulkExtensions; using SettleAccount.Domain.BQ; -using System.Security.Cryptography; +using Volo.Abp.Domain.Services; +using Win.Sfs.SettleAccount.Bases; using Win.Sfs.SettleAccount.Bases.DomainServices; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers { @@ -22,9 +18,9 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers /// /// public class PUB_NOT_SA_MNG : DomainService - //where TEntity : SA_CAN_BASE_MAIN, new() - //where TEntityDetail : SA_CAN_BASE, new() - //where TNOTDetail : SA_NOT_BASE + //where TEntity : SA_CAN_BASE_MAIN, new() + //where TEntityDetail : SA_CAN_BASE, new() + //where TNOTDetail : SA_NOT_BASE { private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; @@ -64,7 +60,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers } } - var first= p_list.FirstOrDefault(); + var first = p_list.FirstOrDefault(); if (first.BusinessType == EnumBusinessType.ZhiGongJianBBAC || first.BusinessType == EnumBusinessType.ZhiGongJianHBPO || first.BusinessType == EnumBusinessType.BeiJian || first.BusinessType == EnumBusinessType.YinDuJian ) @@ -75,12 +71,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers string name = "ASN单号或发运ID"; if (first.BusinessType == EnumBusinessType.BeiJian) { - name = "备件"; - priceErrors = await _service.CheckPriceList(notlist,first.Site,true); + name = "备件"; + priceErrors = await _service.CheckPriceList(notlist, first.Site, true).ConfigureAwait(false); } else { - priceErrors = await _service.CheckPriceList(notlist,first.Site); + priceErrors = await _service.CheckPriceList(notlist, first.Site).ConfigureAwait(false); } if (priceErrors.Count > 0) { @@ -124,15 +120,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers invGroupNum: billNumber, invbillnum: string.Empty, partcode: itm.PartCode, - pobillnum:string.Empty + pobillnum: string.Empty ); _detailEntity.IndexNum = itm.IndexNum; _detailEntity.RealPartCode = itm.RealPartCode; _entityList.Add(_detailEntity); } - await _repository.DbContext.BulkDeleteAsync(p_list); - await _repository.DbContext.BulkInsertAsync(new List() { _entity }); - await _repository.DbContext.BulkInsertAsync(_entityList); + await _repository.DbContext.BulkDeleteAsync(p_list).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(new List() { _entity }).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(_entityList).ConfigureAwait(false); } else @@ -142,7 +138,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers _entity.SetId(Guid.NewGuid()); _entity.BillNum = billNumber; _entity.InvGroupNum = billNumber; - _entity.Version =int.Parse( DateTime.Now.ToString("yyyymm")); + _entity.Version = int.Parse(DateTime.Now.ToString("yyyymm")); _entity.State = SettleBillState.未结状态; _entity.SettleBillNum = string.Empty; var _entityList = new List(); @@ -167,19 +163,18 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers partcode: itm.PartCode, pobillnum: string.Empty ); - _detailEntity.RealPartCode =string.IsNullOrEmpty(itm.RealPartCode)?itm.PartCode:itm.RealPartCode; + _detailEntity.RealPartCode = string.IsNullOrEmpty(itm.RealPartCode) ? itm.PartCode : itm.RealPartCode; _entityList.Add(_detailEntity); } - // _repository.DbContext.Database.BeginTransaction(); - await _repository.DbContext.BulkDeleteAsync(p_list); - await _repository.DbContext.BulkInsertAsync(new List() { _entity }); - await _repository.DbContext.BulkInsertAsync(_entityList); + // _repository.DbContext.Database.BeginTransaction(); + await _repository.DbContext.BulkDeleteAsync(p_list).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(new List() { _entity }).ConfigureAwait(false); + await _repository.DbContext.BulkInsertAsync(_entityList).ConfigureAwait(false); //_repository.DbContext.Database.CommitTransaction(); } return errors; - - } + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs index 1c9279d5..97492391 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_ADJ_DETAIL.cs @@ -1,100 +1,100 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - -[Display(Name = "PUB不可结算导入明细")] -public class PUB_ADJ_DETAIL : SA_NOT_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } + [Display(Name = "PUB不可结算导入明细")] + public class PUB_ADJ_DETAIL : SA_NOT_BASE + { + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } - /// - /// 对应字段Material - /// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string SettleBillNum { get; set; } = null!; - ///// - ///// 对应字段ExternalCalNumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; + /// + /// 对应字段Material + /// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + ///// + ///// 对应字段ExternalCalNumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } + /// + /// 选择工厂导入 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; - [Display(Name = "扩展1")] - public string Extend1 { get; set; } = null!; + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + [Display(Name = "扩展1")] + public string Extend1 { get; set; } = null!; - //[Display(Name = "单价")] - //public decimal Price { get; set; } - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - /// - /// 对应字段PostingDate - /// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - [Display(Name = "作废发票号")] - public string OldInvBillNum { get; set; } + //[Display(Name = "单价")] + //public decimal Price { get; set; } + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + /// + /// 对应字段PostingDate + /// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + [Display(Name = "作废发票号")] + public string OldInvBillNum { get; set; } - [Display(Name = "发票号")] - public string InvBillNum { get; set; } + [Display(Name = "发票号")] + public string InvBillNum { get; set; } - [Display(Name = "是否是买单件")] - public bool IsMaiDan { get; set; } + [Display(Name = "是否是买单件")] + public bool IsMaiDan { get; set; } - public PUB_ADJ_DETAIL(Guid id, string keyCode, int version, string settleBillNum, string lU, string pN, - string site, decimal qty, string extend1, decimal price, string invGroupNum, DateTime settleDate, - EnumBusinessType businessType, string groupNum,string oldinv,string inv,string partcode) - { - Id= id; - KeyCode = keyCode; - Version = version; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Extend1 = extend1; - Price = price; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - BusinessType = businessType; - GroupNum = groupNum; - OldInvBillNum= oldinv; - InvBillNum = inv; - PartCode = partcode; - } + public PUB_ADJ_DETAIL(Guid id, string keyCode, int version, string settleBillNum, string lU, string pN, + string site, decimal qty, string extend1, decimal price, string invGroupNum, DateTime settleDate, + EnumBusinessType businessType, string groupNum, string oldinv, string inv, string partcode) + { + Id = id; + KeyCode = keyCode; + Version = version; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Extend1 = extend1; + Price = price; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + BusinessType = businessType; + GroupNum = groupNum; + OldInvBillNum = oldinv; + InvBillNum = inv; + PartCode = partcode; + } - public PUB_ADJ_DETAIL() - { + public PUB_ADJ_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs index 96e74ebe..1438029c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_CAN_SA.cs @@ -1,150 +1,151 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "PUB可结算导入")] -public class PUB_CAN_SA : SA_CAN_BASE_MAIN -{ - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - - //[Display(Name = "结算单据")] - //public string BillNum { get; set; } = null!; - - ///// - ///// 1、新建 2、已有出库3、已有扣减寄售库 - ///// - //[Display(Name = "状态")] - //public SettleBillState State { get; set; } - ///// - ///// 1、JIT 2、买单件 3、备件 3、印度件 - ///// - [Display(Name = "业务分类")] - public EnumBusinessType BusinessType { get; set; } - - //[Display(Name = "明细记录行数")] - //public string InvGroupNum { get; set; } = null!; - - public PUB_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum) - { - Id = guid; - Version = version; - SettleBillNum = settleBillNum; - BillNum = billNum; - State = state; - BusinessType = businessType; - InvGroupNum = invGroupNum; - } - - public PUB_CAN_SA() - { - } -} -[Display(Name = "PUB可结算导入明细")] -public class PUB_CAN_SA_DETAIL : SA_CAN_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+ASN单号")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - - /// - /// 对应字段PartNumber - /// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段productionlumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 对应字段filename 区分 cn1、cn5 - /// - //[Display(Name = "工厂地点")] - //public string Site { get; set; } = null!; - - /// - /// 对应字段Qty - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - ///// - ///// 对应字段ReceiveDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - [Display(Name = "订单号")] - public string PoBillNum { get; set; } - /// - /// 计数 - /// - [Display(Name = "计数")] - public int IndexNum { get; set; } - /// - /// 对应字段DeliveryNode - /// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - public PUB_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType,string partcode, - string groupNum, - string invbillnum, - string pobillnum - ) + [Display(Name = "PUB可结算导入")] + public class PUB_CAN_SA : SA_CAN_BASE_MAIN { - InvbillNum=invbillnum; - Id = guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - BusinessType = businessType; - GroupNum = groupNum; - PartCode = partcode; - PoBillNum = pobillnum; + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 1、JIT 2、买单件 3、备件 3、印度件 + ///// + [Display(Name = "业务分类")] + public EnumBusinessType BusinessType { get; set; } + + //[Display(Name = "明细记录行数")] + //public string InvGroupNum { get; set; } = null!; + + public PUB_CAN_SA(Guid guid, int version, string settleBillNum, string billNum, SettleBillState state, EnumBusinessType businessType, string invGroupNum) + { + Id = guid; + Version = version; + SettleBillNum = settleBillNum; + BillNum = billNum; + State = state; + BusinessType = businessType; + InvGroupNum = invGroupNum; + } + + public PUB_CAN_SA() + { + } } - - public PUB_CAN_SA_DETAIL() + [Display(Name = "PUB可结算导入明细")] + public class PUB_CAN_SA_DETAIL : SA_CAN_BASE { + //[Display(Name = "LU+ASN单号")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + + /// + /// 对应字段PartNumber + /// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段productionlumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 对应字段filename 区分 cn1、cn5 + /// + //[Display(Name = "工厂地点")] + //public string Site { get; set; } = null!; + + /// + /// 对应字段Qty + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + ///// + ///// 对应字段ReceiveDate + ///// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + [Display(Name = "订单号")] + public string PoBillNum { get; set; } + /// + /// 计数 + /// + [Display(Name = "计数")] + public int IndexNum { get; set; } + /// + /// 对应字段DeliveryNode + /// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + public PUB_CAN_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string settleBillNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string partcode, + string groupNum, + string invbillnum, + string pobillnum + ) + { + InvbillNum = invbillnum; + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + BusinessType = businessType; + GroupNum = groupNum; + PartCode = partcode; + PoBillNum = pobillnum; + } + + public PUB_CAN_SA_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs index e6b0fc06..457763c4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_NOT_SA_DETAIL.cs @@ -1,102 +1,103 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - -[Display(Name = "PUB不可结算导入明细")] -public class PUB_NOT_SA_DETAIL : SA_NOT_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; + [Display(Name = "PUB不可结算导入明细")] + public class PUB_NOT_SA_DETAIL : SA_NOT_BASE + { + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string SettleBillNum { get; set; } = null!; - /// - /// 对应字段Material - /// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; + /// + /// 对应字段Material + /// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; - ///// - ///// 对应字段ExternalCalNumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; + ///// + ///// 对应字段ExternalCalNumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; + /// + /// 选择工厂导入 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } - [Display(Name = "扩展1")] - public string Extend1 { get; set; } = null!; + [Display(Name = "扩展1")] + public string Extend1 { get; set; } = null!; - [Display(Name = "扩展2")] - public string Extend2 { get; set; } = null!; + [Display(Name = "扩展2")] + public string Extend2 { get; set; } = null!; - [Display(Name = "扩展3")] - public string Extend3 { get; set; } = null!; + [Display(Name = "扩展3")] + public string Extend3 { get; set; } = null!; - //[Display(Name = "单价")] - //public decimal Price { get; set; } - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - /// - /// 对应字段PostingDate - /// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - [Display(Name ="订单号")] - public string PoBillNum { get; set; } - /// - /// 计数 - /// - [Display(Name = "计数")] - public int IndexNum { get; set; } + //[Display(Name = "单价")] + //public decimal Price { get; set; } + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + /// + /// 对应字段PostingDate + /// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + [Display(Name = "订单号")] + public string PoBillNum { get; set; } + /// + /// 计数 + /// + [Display(Name = "计数")] + public int IndexNum { get; set; } - public PUB_NOT_SA_DETAIL(string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, string extend2, string extend3, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum,string partcode,string pobillnum) - { - KeyCode = keyCode; - Version = version; - SettleBillNum = settleBillNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - Price = price; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - BusinessType = businessType; - GroupNum = groupNum; - PartCode = partcode; - PoBillNum = pobillnum; - } + public PUB_NOT_SA_DETAIL(string keyCode, int version, string settleBillNum, string lU, string pN, string site, decimal qty, string extend1, string extend2, string extend3, decimal price, string invGroupNum, DateTime settleDate, EnumBusinessType businessType, string groupNum, string partcode, string pobillnum) + { + KeyCode = keyCode; + Version = version; + SettleBillNum = settleBillNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Price = price; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + BusinessType = businessType; + GroupNum = groupNum; + PartCode = partcode; + PoBillNum = pobillnum; + } - public PUB_NOT_SA_DETAIL() - { + public PUB_NOT_SA_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs index b6b9478d..c23b67d8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD.cs @@ -1,46 +1,44 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Domain.Entities.Auditing; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "PUB待扣减")] -public class PUB_PD : PD_BASE_MAIN +namespace SettleAccount.Domain.BQ { - - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单据")] - //public string BillNum { get; set; } = null!; - //[Display(Name = "关联结算单号")] - //public string SettleBillNum { get; set; } = null!; - ///// - ///// 1、新建 2、已有出库3、已有扣减寄售库 - ///// - //[Display(Name = "状态")] - //public SettleBillState State { get; set; } - ///// - ///// 明细记录行数 - ///// - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - public PUB_PD() - { - - } - public PUB_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum,string site) + [Display(Name = "PUB待扣减")] + public class PUB_PD : PD_BASE_MAIN { - Id = guid; - Version = version; - BillNum = billNum; - SettleBillNum = settleBillNum; - State = state; - InvGroupNum = invGroupNum; - Site = site; - } -} + //[Display(Name = "期间")] + //public int Version { get; set; } + //[Display(Name = "结算单据")] + //public string BillNum { get; set; } = null!; + //[Display(Name = "关联结算单号")] + //public string SettleBillNum { get; set; } = null!; + ///// + ///// 1、新建 2、已有出库3、已有扣减寄售库 + ///// + //[Display(Name = "状态")] + //public SettleBillState State { get; set; } + ///// + ///// 明细记录行数 + ///// + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + public PUB_PD() + { + } + public PUB_PD(Guid guid, int version, string billNum, string settleBillNum, SettleBillState state, string invGroupNum, string site) + { + Id = guid; + Version = version; + BillNum = billNum; + SettleBillNum = settleBillNum; + State = state; + InvGroupNum = invGroupNum; + Site = site; + } + } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs index c899c21e..995c6933 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_PD_DETAIL.cs @@ -1,89 +1,87 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "PUB待扣减实体")] -public class PUB_PD_DETAIL :PD_BASE +namespace SettleAccount.Domain.BQ { - //[Display(Name = "LU+ASN单号")] - //public string KeyCode { get; set; } = null!; - - //[Display(Name = "期间")] - //public int Version { get; set; } - - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - //[Display(Name = "替换零件号")] - //public string RELU { get; set; } = null!; - - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - //[Display(Name = "替换生产号")] - //public string REPN { get; set; } = null!; - - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - /// - /// 1、JIT 2、买单件 3、备件 3、印度件 - /// - [Display(Name = "业务类别")] - public EnumBusinessType BusinessType { get; set; } - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - public PUB_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, EnumBusinessType businessType, string invGroupNum, DateTime settleDate, string groupNum - , string extend1, string extend2, string extend3, string extend4 - - - - ) - { - Id = guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - RELU = rELU; - PN = pN; - REPN = rEPN; - Site = site; - Qty = qty; - Price = price; - BusinessType = businessType; - InvGroupNum = invGroupNum; - SettleDate = settleDate; - GroupNum = groupNum; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - Extend4 = extend4; - - - - } - - public PUB_PD_DETAIL() + [Display(Name = "PUB待扣减实体")] + public class PUB_PD_DETAIL : PD_BASE { + //[Display(Name = "LU+ASN单号")] + //public string KeyCode { get; set; } = null!; + + //[Display(Name = "期间")] + //public int Version { get; set; } + + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + //[Display(Name = "替换零件号")] + //public string RELU { get; set; } = null!; + + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + //[Display(Name = "替换生产号")] + //public string REPN { get; set; } = null!; + + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + /// + /// 1、JIT 2、买单件 3、备件 3、印度件 + /// + [Display(Name = "业务类别")] + public EnumBusinessType BusinessType { get; set; } + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + public PUB_PD_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string rELU, string pN, string rEPN, string site, decimal qty, decimal price, EnumBusinessType businessType, string invGroupNum, DateTime settleDate, string groupNum + , string extend1, string extend2, string extend3, string extend4 + + ) + { + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + RELU = rELU; + PN = pN; + REPN = rEPN; + Site = site; + Qty = qty; + Price = price; + BusinessType = businessType; + InvGroupNum = invGroupNum; + SettleDate = settleDate; + GroupNum = groupNum; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + Extend4 = extend4; + + } + + public PUB_PD_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs index 0c14cd2f..d2066fd6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SA.cs @@ -1,158 +1,158 @@ -using SettleAccount.Bases; using System; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; -[Display(Name = "公用结算导入主表")] -public class PUB_SA : AuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - [Display(Name = "期间")] - public int Version { get; set; } - - [Display(Name = "结算单据")] - public string BillNum { get; set; } = null!; - - /// - /// 1、新建 2、已有出库3、已有扣减寄售库 - /// - [Display(Name = "状态")] - public string State { get; set; } = null!; - - /// - /// 业务分类 - /// - [Display(Name = "业务分类")] - public EnumBusinessType BusinessType { get; set; } - /// - /// 地点码 - /// - [Display(Name = "地点码")] - [MaxLength(64)] - public string Site { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - [MaxLength(64)] - public string Place { get; set; } - - public PUB_SA(Guid guid, int version, string billNum, string state) + [Display(Name = "公用结算导入主表")] + public class PUB_SA : AuditedAggregateRoot { - Version = version; - BillNum = billNum; - State = state; + [Display(Name = "期间")] + public int Version { get; set; } + + [Display(Name = "结算单据")] + public string BillNum { get; set; } = null!; + + /// + /// 1、新建 2、已有出库3、已有扣减寄售库 + /// + [Display(Name = "状态")] + public string State { get; set; } = null!; + + /// + /// 业务分类 + /// + [Display(Name = "业务分类")] + public EnumBusinessType BusinessType { get; set; } + /// + /// 地点码 + /// + [Display(Name = "地点码")] + [MaxLength(64)] + public string Site { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [MaxLength(64)] + public string Place { get; set; } + + public PUB_SA(Guid guid, int version, string billNum, string state) + { + Version = version; + BillNum = billNum; + State = state; + } + + public PUB_SA() + { + } } - - public PUB_SA() - { - } -} -[Display(Name = "公用结算导入明细")] -public class PUB_SA_DETAIL:SA_BASE -{ - ///// - ///// 对应字段(Material+External Delivery ID) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 版本号 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string BillNum { get; set; } = null!; - - /// - /// 对应字段Material - /// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 取值字段External Delivery ID - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间对应地点带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - - - - ///// - ///// 对应字段PostingDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - [Display(Name = "扩展字段1")] - public string Extend1 { get; set; } = null!; - - [Display(Name = "扩展字段2")] - public string Extend2 { get; set; } = null!; - - [Display(Name = "扩展字段3")] - public string Extend3 { get; set; } = null!; - /// - /// 计数 - /// - [Display(Name = "计数")] - public int IndexNum { get; set; } - /// - /// 地点 - /// - [Display(Name = "地点")] - [MaxLength(64)] - public string Place { get; set; } - - public PUB_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string extend1, string extend2, string extend3, string groupNum) - { - Id=guid; - KeyCode = keyCode; - Version = version; - BillNum = billNum; - LU = lU; - PN = pN; - Site = site; - Qty = qty; - Price = price; - - SettleDate = settleDate; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - GroupNum = groupNum; - } - - public PUB_SA_DETAIL() - { - } - - public void SetId(Guid id) + [Display(Name = "公用结算导入明细")] + public class PUB_SA_DETAIL : SA_BASE { - Id = id; + ///// + ///// 对应字段(Material+External Delivery ID) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 版本号 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string BillNum { get; set; } = null!; + + /// + /// 对应字段Material + /// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 取值字段External Delivery ID + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间对应地点带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + + ///// + ///// 对应字段PostingDate + ///// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + [Display(Name = "扩展字段1")] + public string Extend1 { get; set; } = null!; + + [Display(Name = "扩展字段2")] + public string Extend2 { get; set; } = null!; + + [Display(Name = "扩展字段3")] + public string Extend3 { get; set; } = null!; + /// + /// 计数 + /// + [Display(Name = "计数")] + public int IndexNum { get; set; } + /// + /// 地点 + /// + [Display(Name = "地点")] + [MaxLength(64)] + public string Place { get; set; } + + public PUB_SA_DETAIL(Guid guid, string keyCode, int version, string billNum, string lU, string pN, string site, decimal qty, decimal price, string invGroupNum, DateTime settleDate, string extend1, string extend2, string extend3, string groupNum) + { + Id = guid; + KeyCode = keyCode; + Version = version; + BillNum = billNum; + LU = lU; + PN = pN; + Site = site; + Qty = qty; + Price = price; + + SettleDate = settleDate; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + GroupNum = groupNum; + } + + public PUB_SA_DETAIL() + { + } + + public void SetId(Guid id) + { + Id = id; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SEC_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SEC_DETAIL.cs index b4047694..869220dc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SEC_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SEC_DETAIL.cs @@ -1,16 +1,13 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Entities.BQ; -public class PUB_SEC_DETAIL:FullAuditedAggregateRoot +namespace Win.Sfs.SettleAccount.Entities.BQ { + public class PUB_SEC_DETAIL : FullAuditedAggregateRoot + { /// /// 类别 /// 有结算有发运 @@ -128,37 +125,37 @@ public class PUB_SEC_DETAIL:FullAuditedAggregateRoot [ExporterHeader(DisplayName = "PJIS日顺序号")] public string PJISSeqNumber { get; set; } - - /// - /// PJIS日顺序号 - /// - [Display(Name = "库位")] - [ExporterHeader(DisplayName = "库位")] - public string ErpLoc { get; set; } - - public PUB_SEC_DETAIL(Guid guid, EnumPubSaSeCompareCategory category, string wmsBillNum, DateTime shippingDate, string pN, string materialNumber, string materialDes, string primitiveLU, string replaceLU, DateTime customerOfflineTime, decimal sAQty, decimal sEQty, decimal diffQty, string mateType, decimal fixPrice, string seqNumber, string pJISSeqNumber,string erploc) - { - Id = guid; - Category = category; - WmsBillNum = wmsBillNum; - ShippingDate = shippingDate; - PN = pN; - MaterialNumber = materialNumber; - MaterialDes = materialDes; - PrimitiveLU = primitiveLU; - ReplaceLU = replaceLU; - CustomerOfflineTime = customerOfflineTime; - SAQty = sAQty; - SEQty = sEQty; - DiffQty = diffQty; - MateType = mateType; - FixPrice = fixPrice; - SeqNumber = seqNumber; - PJISSeqNumber = pJISSeqNumber; - ErpLoc = erploc; - } - - public PUB_SEC_DETAIL() - { + /// + /// PJIS日顺序号 + /// + [Display(Name = "库位")] + [ExporterHeader(DisplayName = "库位")] + public string ErpLoc { get; set; } + + public PUB_SEC_DETAIL(Guid guid, EnumPubSaSeCompareCategory category, string wmsBillNum, DateTime shippingDate, string pN, string materialNumber, string materialDes, string primitiveLU, string replaceLU, DateTime customerOfflineTime, decimal sAQty, decimal sEQty, decimal diffQty, string mateType, decimal fixPrice, string seqNumber, string pJISSeqNumber, string erploc) + { + Id = guid; + Category = category; + WmsBillNum = wmsBillNum; + ShippingDate = shippingDate; + PN = pN; + MaterialNumber = materialNumber; + MaterialDes = materialDes; + PrimitiveLU = primitiveLU; + ReplaceLU = replaceLU; + CustomerOfflineTime = customerOfflineTime; + SAQty = sAQty; + SEQty = sEQty; + DiffQty = diffQty; + MateType = mateType; + FixPrice = fixPrice; + SeqNumber = seqNumber; + PJISSeqNumber = pJISSeqNumber; + ErpLoc = erploc; + } + + public PUB_SEC_DETAIL() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs index 2c34b432..4abf279b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PUB_SE_DETAIL.cs @@ -1,192 +1,194 @@ -using SettleAccount.Bases; using System; using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using SettleAccount.Bases; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -namespace SettleAccount.Domain.BQ; -[Display(Name = "PUB发运数据")] -public class PUB_SE_DETAIL :SE_BASE +namespace SettleAccount.Domain.BQ { - [Display(Name = "扩展1")] - public string Extend1 { get; set; } = null!; + [Display(Name = "PUB发运数据")] + public class PUB_SE_DETAIL : SE_BASE + { + [Display(Name = "扩展1")] + public string Extend1 { get; set; } = null!; - [Display(Name = "扩展2")] - public string Extend2 { get; set; } = null!; + [Display(Name = "扩展2")] + public string Extend2 { get; set; } = null!; - [Display(Name = "扩展3")] - public string Extend3 { get; set; } = null!; - /// - /// UID - /// - [Display(Name = "UID")] - [DisplayName("UID")] - public long UID { get; set; } - /// - /// 发货单号 - /// - [Display(Name = "发货单号")] - public string BillNum { get; set; } - /// - /// 发货时间 - /// - [Display(Name = "发货时间")] - public DateTime? BillTime { get; set; } - /// - /// 订单时间 - /// - [Display(Name = "订单时间")] - public DateTime AssembleData { get; set; } - /// - /// 零件号 - /// - [Display(Name = "零件号")] - public string PartCode { get; set; } - /// - /// 批次 - /// - [Display(Name = "批次")] - public string Batch { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - public string CustPartCode { get; set; } - /// - /// 发货人 - /// - [Display(Name = "发货人")] - public string Oper { get; set; } - /// - /// DN单据号 - /// - [Display(Name = "DN单据号")] - public string DnBillNum { get; set; } - /// - /// DN单据时间 - /// - [Display(Name = "DN单据时间")] - public DateTime DnBillTime { get; set; } - /// - /// DN单添加人 - /// - [Display(Name = "DN单添加人")] - public string DnOper { get; set; } - /// - /// 交付索引 - /// - [Display(Name = "交付索引")] - public string DeliveryIndex { get; set; } - /// - /// 客户 - /// - [Display(Name = "客户")] - public string CustId { get; set; } - /// - /// 发货仓库 - /// - [Display(Name = "发货仓库")] - public string DeliveryHose { get; set; } - /// - /// 来源库位 - /// - [Display(Name = "来源库位")] - public string FromLocCode { get; set; } - /// - /// 来源仓库 - /// - [Display(Name = "来源仓库")] - public string FromHose { get; set; } - /// - /// 来源ERP库存 - /// - [Display(Name = "来源ERP库存")] - public string FromErpLocCode { get; set; } - /// - /// 目标库位 - /// - [Display(Name = "目标库位")] - public string ToLocCode { get; set; } - /// - /// 目标仓库 - /// - [Display(Name = "目标仓库")] - public string ToHose { get; set; } - /// - /// 目标Erp库位 - /// - [Display(Name = "目标Erp库位")] - public string ToErpLocCode { get; set; } - /// - /// 状态 - /// - [Display(Name = "状态")] - public EnumBillState State { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - public string Remark { get; set; } - /// - /// 单据类型 - /// - [Display(Name = "单据类型")] - public EnumBillType BillType { get; set; } - /// - /// 子单据类型 - /// - [Display(Name = "子单据类型")] - public EnumSubBillType SubBillType { get; set; } - /// - /// 业务类型 - /// - [Display(Name = "业务类型")] - public EnumProTpe ProType { get; set; } - /// - /// 事务类型 - /// - [Display(Name = "事务类型")] - public EnumDelTransType TransType { get; set; } - /// - /// 发运主类型 - /// - [Display(Name = "发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } - /// - /// 发运子类型 - /// - [Display(Name = "发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } - /// - /// 创建时间 - /// - [Display(Name = "创建时间")] - public DateTime CreateTime { get; set; } + [Display(Name = "扩展3")] + public string Extend3 { get; set; } = null!; + /// + /// UID + /// + [Display(Name = "UID")] + [DisplayName("UID")] + public long UID { get; set; } + /// + /// 发货单号 + /// + [Display(Name = "发货单号")] + public string BillNum { get; set; } + /// + /// 发货时间 + /// + [Display(Name = "发货时间")] + public DateTime? BillTime { get; set; } + /// + /// 订单时间 + /// + [Display(Name = "订单时间")] + public DateTime AssembleData { get; set; } + /// + /// 零件号 + /// + [Display(Name = "零件号")] + public string PartCode { get; set; } + /// + /// 批次 + /// + [Display(Name = "批次")] + public string Batch { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + public string CustPartCode { get; set; } + /// + /// 发货人 + /// + [Display(Name = "发货人")] + public string Oper { get; set; } + /// + /// DN单据号 + /// + [Display(Name = "DN单据号")] + public string DnBillNum { get; set; } + /// + /// DN单据时间 + /// + [Display(Name = "DN单据时间")] + public DateTime DnBillTime { get; set; } + /// + /// DN单添加人 + /// + [Display(Name = "DN单添加人")] + public string DnOper { get; set; } + /// + /// 交付索引 + /// + [Display(Name = "交付索引")] + public string DeliveryIndex { get; set; } + /// + /// 客户 + /// + [Display(Name = "客户")] + public string CustId { get; set; } + /// + /// 发货仓库 + /// + [Display(Name = "发货仓库")] + public string DeliveryHose { get; set; } + /// + /// 来源库位 + /// + [Display(Name = "来源库位")] + public string FromLocCode { get; set; } + /// + /// 来源仓库 + /// + [Display(Name = "来源仓库")] + public string FromHose { get; set; } + /// + /// 来源ERP库存 + /// + [Display(Name = "来源ERP库存")] + public string FromErpLocCode { get; set; } + /// + /// 目标库位 + /// + [Display(Name = "目标库位")] + public string ToLocCode { get; set; } + /// + /// 目标仓库 + /// + [Display(Name = "目标仓库")] + public string ToHose { get; set; } + /// + /// 目标Erp库位 + /// + [Display(Name = "目标Erp库位")] + public string ToErpLocCode { get; set; } + /// + /// 状态 + /// + [Display(Name = "状态")] + public EnumBillState State { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + public string Remark { get; set; } + /// + /// 单据类型 + /// + [Display(Name = "单据类型")] + public EnumBillType BillType { get; set; } + /// + /// 子单据类型 + /// + [Display(Name = "子单据类型")] + public EnumSubBillType SubBillType { get; set; } + /// + /// 业务类型 + /// + [Display(Name = "业务类型")] + public EnumProTpe ProType { get; set; } + /// + /// 事务类型 + /// + [Display(Name = "事务类型")] + public EnumDelTransType TransType { get; set; } + /// + /// 发运主类型 + /// + [Display(Name = "发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + /// + /// 发运子类型 + /// + [Display(Name = "发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + /// + /// 创建时间 + /// + [Display(Name = "创建时间")] + public DateTime CreateTime { get; set; } - public PUB_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, decimal qty, string extend1, string extend2, string extend3, EnumBusinessType businessType, DateTime beginDate, DateTime shippingDate, string wmsBillNum) - { - Id=guid; - KeyCode = keyCode; - Version = version; - LU = lU; - PN = pN; - Qty = qty; - Extend1 = extend1; - Extend2 = extend2; - Extend3 = extend3; - BusinessType = businessType; - BeginDate = beginDate; - ShippingDate = shippingDate; - WmsBillNum = wmsBillNum; - } + public PUB_SE_DETAIL(Guid guid, string keyCode, int version, string lU, string pN, decimal qty, string extend1, string extend2, string extend3, EnumBusinessType businessType, DateTime beginDate, DateTime shippingDate, string wmsBillNum) + { + Id = guid; + KeyCode = keyCode; + Version = version; + LU = lU; + PN = pN; + Qty = qty; + Extend1 = extend1; + Extend2 = extend2; + Extend3 = extend3; + BusinessType = businessType; + BeginDate = beginDate; + ShippingDate = shippingDate; + WmsBillNum = wmsBillNum; + } - public PUB_SE_DETAIL() - { - } + public PUB_SE_DETAIL() + { + } - public void SetId(Guid id) - { - Id = id; + public void SetId(Guid id) + { + Id = id; + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs index c5f01d9e..2123a4e5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/PURCHASE_PRICE.cs @@ -1,33 +1,34 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace SettleAccount.Domain.BQ; - -/// -/// 采购价格单 -/// -[Display(Name = "采购价格单")] -public class PURCHASE_PRICE : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { /// - /// 物料号 + /// 采购价格单 /// - [Display(Name = "物料号")] - public string LU { get; set; } + [Display(Name = "采购价格单")] + public class PURCHASE_PRICE : FullAuditedAggregateRoot + { + /// + /// 物料号 + /// + [Display(Name = "物料号")] + public string LU { get; set; } - /// - /// 价格 - /// - [Display(Name = "价格")] - public decimal Price { get; set; } + /// + /// 价格 + /// + [Display(Name = "价格")] + public decimal Price { get; set; } - /// - /// 更新 - /// - public void Update(decimal price) - { - Price = price; - } + /// + /// 更新 + /// + public void Update(decimal price) + { + Price = price; + } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/SyncPositionFlag.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/SyncPositionFlag.cs index f5d869f4..92687f43 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/SyncPositionFlag.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/SyncPositionFlag.cs @@ -2,27 +2,28 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// 同步位置标记 -/// -public class SyncPositionFlag : AuditedAggregateRoot +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { /// - /// 表名称 + /// 同步位置标记 /// - [Display(Name = "表名称")] - public string TableName { get; set; } + public class SyncPositionFlag : AuditedAggregateRoot + { + /// + /// 表名称 + /// + [Display(Name = "表名称")] + public string TableName { get; set; } - /// - /// 位置(可排序) - /// - [Display(Name = "位置")] - public string Position { get; set; } + /// + /// 位置(可排序) + /// + [Display(Name = "位置")] + public string Position { get; set; } - /// - /// 构造 - /// - public SyncPositionFlag() { } + /// + /// 构造 + /// + public SyncPositionFlag() { } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs index d866c643..4ae010f1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIS_RECORD.cs @@ -3,123 +3,124 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -[Table("TM_BJBMPT_JIS_RECORD")] -public class TM_BJBMPT_JIS_RECORD +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int UID { get; set; } + [Table("TM_BJBMPT_JIS_RECORD")] + public class TM_BJBMPT_JIS_RECORD + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int UID { get; set; } - [DisplayName("JIS单据编号")] - public string JISNum { get; set; } + [DisplayName("JIS单据编号")] + public string JISNum { get; set; } - [DisplayName("发货时间")] - public DateTime? BillTime { get; set; } + [DisplayName("发货时间")] + public DateTime? BillTime { get; set; } - [DisplayName("发货人")] - public string Oper { get; set; } + [DisplayName("发货人")] + public string Oper { get; set; } - [DisplayName("JIS排序单号")] - public string OrderNum { get; set; } + [DisplayName("JIS排序单号")] + public string OrderNum { get; set; } - [DisplayName("订单序号")] - public string Seq { get; set; } + [DisplayName("订单序号")] + public string Seq { get; set; } - [DisplayName("JIS实际生产码")] - public string RealCode { get; set; } + [DisplayName("JIS实际生产码")] + public string RealCode { get; set; } - [DisplayName("订单生产码")] - public string VinCode { get; set; } + [DisplayName("订单生产码")] + public string VinCode { get; set; } - [DisplayName("JIS生产码类型")] - public string CodeType { get; set; } + [DisplayName("JIS生产码类型")] + public string CodeType { get; set; } - //[DisplayName("状态")] - //public EnumBillState State { get; set; } + //[DisplayName("状态")] + //public EnumBillState State { get; set; } - [DisplayName("订单零件号")] - public string RealPartCode { get; set; } + [DisplayName("订单零件号")] + public string RealPartCode { get; set; } - [DisplayName("父级零件号")] - public string PartCode { get; set; } + [DisplayName("父级零件号")] + public string PartCode { get; set; } - [DisplayName("批次")] - public string Batch { get; set; } + [DisplayName("批次")] + public string Batch { get; set; } - [DisplayName("客户零件号")] - public string CustPartCode { get; set; } + [DisplayName("客户零件号")] + public string CustPartCode { get; set; } - [DisplayName("数量")] - public decimal? Qty { get; set; } + [DisplayName("数量")] + public decimal? Qty { get; set; } - [DisplayName("发货单号")] - public string BillNum { get; set; } + [DisplayName("发货单号")] + public string BillNum { get; set; } - [DisplayName("MES配置码")] - public string MESConfigCode { get; set; } + [DisplayName("MES配置码")] + public string MESConfigCode { get; set; } - [DisplayName("订单时间")] - public DateTime? AssembleData { get; set; } + [DisplayName("订单时间")] + public DateTime? AssembleData { get; set; } - [DisplayName("来源库位")] - public string FromLoc { get; set; } + [DisplayName("来源库位")] + public string FromLoc { get; set; } - [DisplayName("目标库位")] - public string ToLoc { get; set; } + [DisplayName("目标库位")] + public string ToLoc { get; set; } - [DisplayName("参照订单生产码")] - public string RefVinCode { get; set; } + [DisplayName("参照订单生产码")] + public string RefVinCode { get; set; } - [DisplayName("单据类型")] - public int? BillType { get; set; } + [DisplayName("单据类型")] + public int? BillType { get; set; } - [DisplayName("子单据类型")] - public int? SubBillType { get; set; } + [DisplayName("子单据类型")] + public int? SubBillType { get; set; } - [DisplayName("单据性质")] - public string BillCharacter { get; set; } + [DisplayName("单据性质")] + public string BillCharacter { get; set; } - [DisplayName("事务类型")] - public int? TransType { get; set; } + [DisplayName("事务类型")] + public int? TransType { get; set; } - [DisplayName("发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + [DisplayName("发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } - [DisplayName("发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } + [DisplayName("发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } - [DisplayName("发货关联单号")] - public string RefBillNum { get; set; } + [DisplayName("发货关联单号")] + public string RefBillNum { get; set; } - [DisplayName("Erp目标库位")] - public string ErpToLoc { get; set; } + [DisplayName("Erp目标库位")] + public string ErpToLoc { get; set; } - [DisplayName("原生产码")] - public string OrigiCode { get; set; } + [DisplayName("原生产码")] + public string OrigiCode { get; set; } - [DisplayName("备注")] - public string Remark { get; set; } + [DisplayName("备注")] + public string Remark { get; set; } - [DisplayName("塑件唯一码")] - public string UniqueCode { get; set; } + [DisplayName("塑件唯一码")] + public string UniqueCode { get; set; } - [DisplayName("PJS顺序号")] - public string PjsNum { get; set; } + [DisplayName("PJS顺序号")] + public string PjsNum { get; set; } - [DisplayName("虚拟小总成")] - public string MatchNumber { get; set; } + [DisplayName("虚拟小总成")] + public string MatchNumber { get; set; } - [DisplayName("业务类型")] - public int? ProType { get; set; } + [DisplayName("业务类型")] + public int? ProType { get; set; } - [DisplayName("发货条码")] - public string DeliverCode { get; set; } + [DisplayName("发货条码")] + public string DeliverCode { get; set; } - [DisplayName("客户位置")] - public string Position { get; set; } + [DisplayName("客户位置")] + public string Position { get; set; } - [DisplayName("创建时间")] - public DateTime? CreateTime { get; set; } + [DisplayName("创建时间")] + public DateTime? CreateTime { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs index 775a4cf7..e164160c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_JIT_RECORD.cs @@ -3,207 +3,208 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// Jis小件 -/// -[Table("TM_BJBMPT_JIT_RECORD")] -public class TM_BJBMPT_JIT_RECORD +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public int UID { get; set; } - - [DisplayName("JIT订单号")] - public string JISNum { get; set; } - - [DisplayName("JIT排序生产码")] - public string VinCode { get; set; } - - [DisplayName("JIT排序生产码类型")] - public string CodeType { get; set; } - - [DisplayName("订单零件号")] - public string PartCode { get; set; } - - [DisplayName("订单零件号")] - public string RealPartCode { get; set; } - - [DisplayName("批次")] - public string Batch { get; set; } - - [DisplayName("客户零件号")] - public string CustPartCode { get; set; } - - [DisplayName("订单序号")] - public string Seq { get; set; } - - [DisplayName("订单时间")] - public DateTime? AssembleData { get; set; } - - [DisplayName("发货条码")] - public string DeliverCode { get; set; } - - [DisplayName("数量")] - public decimal? Qty { get; set; } - - [DisplayName("发货单号")] - public string BillNum { get; set; } - - [DisplayName("发货时间")] - public DateTime? BillTime { get; set; } - - [DisplayName("发货人")] - public string Oper { get; set; } - - [DisplayName("客户位置")] - public string Position { get; set; } + /// + /// Jis小件 + /// + [Table("TM_BJBMPT_JIT_RECORD")] + public class TM_BJBMPT_JIT_RECORD + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public int UID { get; set; } - [DisplayName("工厂")] - public string Factory { get; set; } + [DisplayName("JIT订单号")] + public string JISNum { get; set; } - [DisplayName("MES配置码")] - public string MESConfigCode { get; set; } + [DisplayName("JIT排序生产码")] + public string VinCode { get; set; } - [DisplayName("目标库位")] - public string ToLoc { get; set; } + [DisplayName("JIT排序生产码类型")] + public string CodeType { get; set; } - [DisplayName("单据类型")] - public int? BillType { get; set; } + [DisplayName("订单零件号")] + public string PartCode { get; set; } - [DisplayName("子单据类型")] - public int? SubBillType { get; set; } + [DisplayName("订单零件号")] + public string RealPartCode { get; set; } - [DisplayName("事务类型")] - public int? TransType { get; set; } + [DisplayName("批次")] + public string Batch { get; set; } - [DisplayName("发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + [DisplayName("客户零件号")] + public string CustPartCode { get; set; } - [DisplayName("发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } + [DisplayName("订单序号")] + public string Seq { get; set; } - [DisplayName("单据性质")] - public string BillCharacter { get; set; } + [DisplayName("订单时间")] + public DateTime? AssembleData { get; set; } - [DisplayName("原生产码")] - public string OrigiCode { get; set; } + [DisplayName("发货条码")] + public string DeliverCode { get; set; } - [DisplayName("备注")] - public string Remark { get; set; } + [DisplayName("数量")] + public decimal? Qty { get; set; } - [DisplayName("业务类型")] - public int? ProType { get; set; } + [DisplayName("发货单号")] + public string BillNum { get; set; } - [DisplayName("JIS排序单号")] - public string OrderNum { get; set; } + [DisplayName("发货时间")] + public DateTime? BillTime { get; set; } - [DisplayName("JIS实际生产码")] - public string RealCode { get; set; } + [DisplayName("发货人")] + public string Oper { get; set; } - [DisplayName("来源库位")] - public string FromLoc { get; set; } + [DisplayName("客户位置")] + public string Position { get; set; } - [DisplayName("参照订单生产码")] - public string RefVinCode { get; set; } + [DisplayName("工厂")] + public string Factory { get; set; } - [DisplayName("发货关联单号")] - public string RefBillNum { get; set; } + [DisplayName("MES配置码")] + public string MESConfigCode { get; set; } - [DisplayName("Erp目标库位")] - public string ErpToLoc { get; set; } + [DisplayName("目标库位")] + public string ToLoc { get; set; } - [DisplayName("塑件唯一码")] - public string UniqueCode { get; set; } + [DisplayName("单据类型")] + public int? BillType { get; set; } - [DisplayName("PJS顺序号")] - public string PjsNum { get; set; } + [DisplayName("子单据类型")] + public int? SubBillType { get; set; } - [DisplayName("虚拟小总成")] - public string MatchNumber { get; set; } + [DisplayName("事务类型")] + public int? TransType { get; set; } - //[DisplayName("状态")] - //public EnumBillState State { get; set; } - - [DisplayName("创建时间")] - public DateTime? CreateTime { get; set; } -} - -public enum EnumProTpe -{ - 无 = 0, - Jit发货 = 1, - Jit补发订单 = 2, - Jit备件 = 3, - Jit买单件 = 4, - Jit匹配件 = 5, - Jis发货 = 6, - Jis备件 = 7, - Jis买单件 = 8, - Jis匹配件 = 9, - Jis补发订单 = 10, - Jis退货 = 11, - Jis备件退货 = 12, - Jis买单件退货 = 13, - Jis匹配件退货 = 14, - Jis补发订单退货 = 15, - Jit退货 = 16, - Jit备件退货 = 17, - Jit买单件退货 = 18, - Jit匹配件退货 = 19, - Jit补发订单退货 = 20, - 北汽4S发货 = 21, - HBPO发货 = 22, - 直供件发货 = 23, - 印度件发货 = 24, - 北汽4S退货 = 25, - HBPO退货 = 26, - 直供件退货 = 27, - 印度件退货 = 28, -} - -public enum EnumBillType { } - -public enum EnumSubBillType { } - -/// -/// 事务类型 -/// -public enum EnumDelTransType -{ - 发货 = 1, - 退货 = -1, -} - -/// -/// 发运主类型 -/// -public enum EnumDeliverBjBmpBillType -{ - 无 = 0, - JIS件 = 1, - JIT直供件 = 2, - 印度件 = 3, - 北汽4S备件 = 4, -} - -/// -/// 发运子类型 -/// -public enum EnumDeliverSubBillType -{ - 无 = 0, - 保险杠BBAC = 1, - 保险杠HBPO = 2, - 买单件保险杠BBAC = 3, - 买单件保险杠HBPO = 4, - 买单件小件BBAC = 5, - 买单件小件HBPO = 6, - 小件BBAC = 7, - 小件HBPO = 8, - JIT直供件BBAC = 9, - JIT直供件HBPO = 10, - 印度件BBAC = 11, - 北汽4S备件BBAC = 12, + [DisplayName("发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + + [DisplayName("发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } + + [DisplayName("单据性质")] + public string BillCharacter { get; set; } + + [DisplayName("原生产码")] + public string OrigiCode { get; set; } + + [DisplayName("备注")] + public string Remark { get; set; } + + [DisplayName("业务类型")] + public int? ProType { get; set; } + + [DisplayName("JIS排序单号")] + public string OrderNum { get; set; } + + [DisplayName("JIS实际生产码")] + public string RealCode { get; set; } + + [DisplayName("来源库位")] + public string FromLoc { get; set; } + + [DisplayName("参照订单生产码")] + public string RefVinCode { get; set; } + + [DisplayName("发货关联单号")] + public string RefBillNum { get; set; } + + [DisplayName("Erp目标库位")] + public string ErpToLoc { get; set; } + + [DisplayName("塑件唯一码")] + public string UniqueCode { get; set; } + + [DisplayName("PJS顺序号")] + public string PjsNum { get; set; } + + [DisplayName("虚拟小总成")] + public string MatchNumber { get; set; } + + //[DisplayName("状态")] + //public EnumBillState State { get; set; } + + [DisplayName("创建时间")] + public DateTime? CreateTime { get; set; } + } + + public enum EnumProTpe + { + 无 = 0, + Jit发货 = 1, + Jit补发订单 = 2, + Jit备件 = 3, + Jit买单件 = 4, + Jit匹配件 = 5, + Jis发货 = 6, + Jis备件 = 7, + Jis买单件 = 8, + Jis匹配件 = 9, + Jis补发订单 = 10, + Jis退货 = 11, + Jis备件退货 = 12, + Jis买单件退货 = 13, + Jis匹配件退货 = 14, + Jis补发订单退货 = 15, + Jit退货 = 16, + Jit备件退货 = 17, + Jit买单件退货 = 18, + Jit匹配件退货 = 19, + Jit补发订单退货 = 20, + 北汽4S发货 = 21, + HBPO发货 = 22, + 直供件发货 = 23, + 印度件发货 = 24, + 北汽4S退货 = 25, + HBPO退货 = 26, + 直供件退货 = 27, + 印度件退货 = 28, + } + + public enum EnumBillType { } + + public enum EnumSubBillType { } + + /// + /// 事务类型 + /// + public enum EnumDelTransType + { + 发货 = 1, + 退货 = -1, + } + + /// + /// 发运主类型 + /// + public enum EnumDeliverBjBmpBillType + { + 无 = 0, + JIS件 = 1, + JIT直供件 = 2, + 印度件 = 3, + 北汽4S备件 = 4, + } + + /// + /// 发运子类型 + /// + public enum EnumDeliverSubBillType + { + 无 = 0, + 保险杠BBAC = 1, + 保险杠HBPO = 2, + 买单件保险杠BBAC = 3, + 买单件保险杠HBPO = 4, + 买单件小件BBAC = 5, + 买单件小件HBPO = 6, + 小件BBAC = 7, + 小件HBPO = 8, + JIT直供件BBAC = 9, + JIT直供件HBPO = 10, + 印度件BBAC = 11, + 北汽4S备件BBAC = 12, + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs index e83a4caf..36d9fd35 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Syncs/TM_BJBMPT_OTHER_RECORD.cs @@ -3,102 +3,103 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs; - -/// -/// Jit(非Jis) -/// -[Table("TM_BJBMPT_OTHER_RECORD")] -public class TM_BJBMPT_OTHER_RECORD +namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { - [Key] - [DatabaseGenerated(DatabaseGeneratedOption.Identity)] - public long UID { get; set; } + /// + /// Jit(非Jis) + /// + [Table("TM_BJBMPT_OTHER_RECORD")] + public class TM_BJBMPT_OTHER_RECORD + { + [Key] + [DatabaseGenerated(DatabaseGeneratedOption.Identity)] + public long UID { get; set; } - [DisplayName("发货单号")] - public string BillNum { get; set; } + [DisplayName("发货单号")] + public string BillNum { get; set; } - [DisplayName("发货时间")] - public DateTime? BillTime { get; set; } + [DisplayName("发货时间")] + public DateTime? BillTime { get; set; } - [DisplayName("订单时间")] - public DateTime? AssembleData { get; set; } + [DisplayName("订单时间")] + public DateTime? AssembleData { get; set; } - [DisplayName("零件号")] - public string PartCode { get; set; } + [DisplayName("零件号")] + public string PartCode { get; set; } - [DisplayName("批次")] - public string Batch { get; set; } + [DisplayName("批次")] + public string Batch { get; set; } - [DisplayName("客户零件号")] - public string CustPartCode { get; set; } + [DisplayName("客户零件号")] + public string CustPartCode { get; set; } - [DisplayName("发货人")] - public string Oper { get; set; } + [DisplayName("发货人")] + public string Oper { get; set; } - [DisplayName("DN单据号")] - public string DnBillNum { get; set; } + [DisplayName("DN单据号")] + public string DnBillNum { get; set; } - [DisplayName("DN单据时间")] - public DateTime? DnBillTime { get; set; } + [DisplayName("DN单据时间")] + public DateTime? DnBillTime { get; set; } - [DisplayName("DN单添加人")] - public string DnOper { get; set; } + [DisplayName("DN单添加人")] + public string DnOper { get; set; } - [DisplayName("交付索引")] - public string DeliveryIndex { get; set; } + [DisplayName("交付索引")] + public string DeliveryIndex { get; set; } - [DisplayName("客户")] - public string CustId { get; set; } + [DisplayName("客户")] + public string CustId { get; set; } - [DisplayName("发货仓库")] - public string DeliveryHose { get; set; } + [DisplayName("发货仓库")] + public string DeliveryHose { get; set; } - [DisplayName("来源库位")] - public string FromLocCode { get; set; } + [DisplayName("来源库位")] + public string FromLocCode { get; set; } - [DisplayName("来源仓库")] - public string FromHose { get; set; } + [DisplayName("来源仓库")] + public string FromHose { get; set; } - [DisplayName("来源ERP库存")] - public string FromErpLocCode { get; set; } + [DisplayName("来源ERP库存")] + public string FromErpLocCode { get; set; } - [DisplayName("目标库位")] - public string ToLocCode { get; set; } + [DisplayName("目标库位")] + public string ToLocCode { get; set; } - [DisplayName("目标仓库")] - public string ToHose { get; set; } + [DisplayName("目标仓库")] + public string ToHose { get; set; } - [DisplayName("目标Erp库位")] - public string ToErpLocCode { get; set; } + [DisplayName("目标Erp库位")] + public string ToErpLocCode { get; set; } - //[DisplayName("状态")] - //public EnumBillState State { get; set; } + //[DisplayName("状态")] + //public EnumBillState State { get; set; } - [DisplayName("数量")] - public decimal? Qty { get; set; } + [DisplayName("数量")] + public decimal? Qty { get; set; } - [DisplayName("备注")] - public string Remark { get; set; } + [DisplayName("备注")] + public string Remark { get; set; } - [DisplayName("单据类型")] - public int? BillType { get; set; } + [DisplayName("单据类型")] + public int? BillType { get; set; } - [DisplayName("子单据类型")] - public int? SubBillType { get; set; } + [DisplayName("子单据类型")] + public int? SubBillType { get; set; } - [DisplayName("业务类型")] - public int? ProType { get; set; } + [DisplayName("业务类型")] + public int? ProType { get; set; } - [DisplayName("事务类型")] - public int? TransType { get; set; } + [DisplayName("事务类型")] + public int? TransType { get; set; } - [DisplayName("发运主类型")] - public EnumDeliverBjBmpBillType DeliverBillType { get; set; } + [DisplayName("发运主类型")] + public EnumDeliverBjBmpBillType DeliverBillType { get; set; } - [DisplayName("发运子类型")] - public EnumDeliverSubBillType DeliverSubBillType { get; set; } + [DisplayName("发运子类型")] + public EnumDeliverSubBillType DeliverSubBillType { get; set; } - [DisplayName("创建时间")] - public DateTime? CreateTime { get; set; } + [DisplayName("创建时间")] + public DateTime? CreateTime { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs index c771d098..9298b5a6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TB_RePartsRelationship.cs @@ -3,48 +3,49 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.SettleAccount; -namespace SettleAccount.Domain.BQ; - - -[Display(Name = "客户替换件关系")] -public class TB_RePartsRelationship : FullAuditedAggregateRoot +namespace SettleAccount.Domain.BQ { - /// - /// 取值字段【零件号】 - /// - [Display(Name = "零件号")] - public string LU { set; get; } = null!; - - /// - /// 取值字段【替换零件号】 - /// - [Display(Name = "替换零件号")] - public string RepLU { set; get; } = null!; - - [Display(Name = "客户编码")] - public string ClientCode { set; get; } = null!; - [Display(Name = "业务类型")] - public EnumBusinessType BusinessType { get; set; } - - public TB_RePartsRelationship() - { - - } - public TB_RePartsRelationship(string lU, string repLU, string clientCode, EnumBusinessType businessType) + [Display(Name = "客户替换件关系")] + public class TB_RePartsRelationship : FullAuditedAggregateRoot { - LU = lU; - RepLU = repLU; - ClientCode = clientCode; - BusinessType = businessType; - } + /// + /// 取值字段【零件号】 + /// + [Display(Name = "零件号")] + public string LU { set; get; } = null!; + + /// + /// 取值字段【替换零件号】 + /// + [Display(Name = "替换零件号")] + public string RepLU { set; get; } = null!; + + [Display(Name = "客户编码")] + public string ClientCode { set; get; } = null!; + [Display(Name = "业务类型")] + public EnumBusinessType BusinessType { get; set; } + + public TB_RePartsRelationship() + { + + } + + public TB_RePartsRelationship(string lU, string repLU, string clientCode, EnumBusinessType businessType) + { + LU = lU; + RepLU = repLU; + ClientCode = clientCode; + BusinessType = businessType; + } + + public void Update(string lU, string repLU, string clientCode, EnumBusinessType businessType) + { + LU = lU; + RepLU = repLU; + ClientCode = clientCode; + BusinessType = businessType; + } - public void Update(string lU, string repLU, string clientCode, EnumBusinessType businessType) - { - LU = lU; - RepLU = repLU; - ClientCode = clientCode; - BusinessType = businessType; } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SA_INV.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SA_INV.cs index 917bd372..14d3d4e9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SA_INV.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SA_INV.cs @@ -1,142 +1,136 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.Entities.BQ; -public class TED_SA_INV { - - - public Guid GUID { set; get; } - - public Guid TaskID { set; get; } - - public int UID { set; get; } - - - /// - /// 发票号 - /// - public string InvoiceNumber { set; get; } - /// - /// 结算系统发票号 - /// - public string SASInvoiceNumber { set; get; } - - /// - /// 客户代码 - /// - public string Customer { set; get; } - - /// - /// 开票至 - /// - public string BillTo { set; get; } - - /// - /// 发票日期 - /// - public DateTime InvoiceDate { set; get; } - /// - /// 地点 - /// - public string Site { set; get; } - /// - /// 单据类型 - /// - public string TYPE { set; get; } - /// - /// 零件号 - /// - public string PartNumber { set; get; } - /// - /// 发票数量 - /// - public decimal InvoiceQuatity { set; get; } - /// - /// 发票价格 - /// - public decimal Price { set; get; } - /// - /// 供应商 - /// - public string Supplier { set; get; } - /// - /// 备注 - /// - public string Remark { set; get; } - /// - /// 发票未税金额 - /// - public decimal InvoiceNetAmount { set; get; } - /// - /// 发票税额 - /// - public decimal InvoiceTaxAmount { set; get; } - /// - /// 税率 - /// - public decimal TaxRate { set; get; } - /// - /// 库位 - /// - public string Location { set; get; } - - /// - /// 发票未税尾差 - /// - public decimal InvoiceNet { set; get; } - - /// - /// 发票税额尾差 - /// - public decimal InvoiceTax { set; get; } - - /// - /// 开始时间 - /// - public DateTime begintime { set; get; } - - /// - /// 结束时间 - /// - public DateTime endtime { set; get; } - - - public string Domain { set; get; } - - public TED_SA_INV(Guid gUID, Guid taskID, int uID, string invoiceNumber, string sASInvoiceNumber, string customer, string billTo, DateTime invoiceDate, string site, string tYPE, string partNumber, decimal invoiceQuatity, decimal price, string supplier, string remark, decimal invoiceNetAmount, decimal invoiceTaxAmount, decimal taxRate, string location, decimal invoiceNet, decimal invoiceTax, DateTime begintime, DateTime endtime, string domain) +namespace Win.Sfs.SettleAccount.Entities.BQ +{ + public class TED_SA_INV { - GUID = gUID; - TaskID = taskID; - UID = uID; - InvoiceNumber = invoiceNumber; - SASInvoiceNumber = sASInvoiceNumber; - Customer = customer; - BillTo = billTo; - InvoiceDate = invoiceDate; - Site = site; - TYPE = tYPE; - PartNumber = partNumber; - InvoiceQuatity = invoiceQuatity; - Price = price; - Supplier = supplier; - Remark = remark; - InvoiceNetAmount = invoiceNetAmount; - InvoiceTaxAmount = invoiceTaxAmount; - TaxRate = taxRate; - Location = location; - InvoiceNet = invoiceNet; - InvoiceTax = invoiceTax; - this.begintime = begintime; - this.endtime = endtime; - Domain = domain; - } - public TED_SA_INV() - { + public Guid GUID { set; get; } + + public Guid TaskID { set; get; } + + public int UID { set; get; } + + /// + /// 发票号 + /// + public string InvoiceNumber { set; get; } + /// + /// 结算系统发票号 + /// + public string SASInvoiceNumber { set; get; } + + /// + /// 客户代码 + /// + public string Customer { set; get; } + + /// + /// 开票至 + /// + public string BillTo { set; get; } + + /// + /// 发票日期 + /// + public DateTime InvoiceDate { set; get; } + /// + /// 地点 + /// + public string Site { set; get; } + /// + /// 单据类型 + /// + public string TYPE { set; get; } + /// + /// 零件号 + /// + public string PartNumber { set; get; } + /// + /// 发票数量 + /// + public decimal InvoiceQuatity { set; get; } + /// + /// 发票价格 + /// + public decimal Price { set; get; } + /// + /// 供应商 + /// + public string Supplier { set; get; } + /// + /// 备注 + /// + public string Remark { set; get; } + /// + /// 发票未税金额 + /// + public decimal InvoiceNetAmount { set; get; } + /// + /// 发票税额 + /// + public decimal InvoiceTaxAmount { set; get; } + /// + /// 税率 + /// + public decimal TaxRate { set; get; } + /// + /// 库位 + /// + public string Location { set; get; } + + /// + /// 发票未税尾差 + /// + public decimal InvoiceNet { set; get; } + + /// + /// 发票税额尾差 + /// + public decimal InvoiceTax { set; get; } + + /// + /// 开始时间 + /// + public DateTime begintime { set; get; } + + /// + /// 结束时间 + /// + public DateTime endtime { set; get; } + + public string Domain { set; get; } + + public TED_SA_INV(Guid gUID, Guid taskID, int uID, string invoiceNumber, string sASInvoiceNumber, string customer, string billTo, DateTime invoiceDate, string site, string tYPE, string partNumber, decimal invoiceQuatity, decimal price, string supplier, string remark, decimal invoiceNetAmount, decimal invoiceTaxAmount, decimal taxRate, string location, decimal invoiceNet, decimal invoiceTax, DateTime begintime, DateTime endtime, string domain) + { + GUID = gUID; + TaskID = taskID; + UID = uID; + InvoiceNumber = invoiceNumber; + SASInvoiceNumber = sASInvoiceNumber; + Customer = customer; + BillTo = billTo; + InvoiceDate = invoiceDate; + Site = site; + TYPE = tYPE; + PartNumber = partNumber; + InvoiceQuatity = invoiceQuatity; + Price = price; + Supplier = supplier; + Remark = remark; + InvoiceNetAmount = invoiceNetAmount; + InvoiceTaxAmount = invoiceTaxAmount; + TaxRate = taxRate; + Location = location; + InvoiceNet = invoiceNet; + InvoiceTax = invoiceTax; + this.begintime = begintime; + this.endtime = endtime; + Domain = domain; + } + + public TED_SA_INV() + { + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs index 07b60472..bc6ef6d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Temp/TempClass.cs @@ -1,238 +1,219 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using SettleAccount.Bases; using SettleAccount.Domain.BQ; -using Volo.Abp.Application.Dtos; -namespace Win.Sfs.SettleAccount.Entities.BQ.Temp; -public class TMEP_INV +namespace Win.Sfs.SettleAccount.Entities.BQ.Temp { - public string PartCode { set; get; } - public string LU { set; get; } - /// - /// 合同号 - /// - public string ContractDocID { set; get; } - public decimal Amt { set; get; } - public decimal Qty { set; get; } - public decimal Price { set; get; } - /// - /// 开始日期 - /// - public DateTime BeginDate { get; set; } - /// - /// 结束日期 - /// - public DateTime EndDate { get; set; } -} -public class INVOICE_GRP_DETAIL -{ - /// - /// 发票明细 - /// - public List INVOICE_DETAIL { get; set; } - /// - /// 发票和结算分组对应关系 - /// - public List INVOICE_MAP_GROUP { get; set; } - - /// - /// 发票调整明细 - /// - public List ADJ_DETAIL { get; set; } - -} - - - - - -public class TEMP_CAN_SA_DETAIL -{ - public Guid Id { set; get; } - /// - ///关联结算单号 - /// - public string SettleBillNum { get; set; } - /// - ///工厂地点 - /// - - public string Site { get; set; } - /// - /// 版本 - /// - public int Version { get; set; } - /// - /// 单价 - /// - public decimal Price { get; set; } - /// - /// 结算单号(发票分组号) - /// - public string BillNum { get; set; } - /// - /// 结算日期 - /// - public DateTime SettleDate { get; set; } - /// - ///发票组号 - /// - public string InvGroupNum { get; set; } - /// - /// 零件号 - /// - public string LU { get; set; } - - - /// - /// 物料描述 - /// - public string MaterialDesc { get; set; } - - - /// - /// 生产号 - /// - public string PN { get; set; } - /// - /// 结算数量 - /// - public decimal Qty { get; set; } - /// - /// 结算分组号 - /// - public string GroupNum { get; set; } - /// - /// 金额 - /// - public decimal Amt { get; set; } - - /// - /// 合同号 - /// - public string ContractDocID { set; get; } - /// - /// 开始日期 - /// - public DateTime BeginDate { get; set; } - /// - /// 结束日期 - /// - public DateTime EndDate { get; set; } - - /// - /// 客户零件号 - /// - public string PartCode { get; set; } - - - /// - /// 订单号 - /// - public string PoNum { get; set; } - - - - /// - /// 行號 - /// - public int LineCode { get; set; } - - - - - -} -public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE -{ - ///// - ///// 对应字段(Material+ExternalCalNumber) - ///// - //[Display(Name = "LU+生产码")] - //public string KeyCode { get; set; } = null!; - - ///// - ///// 期间 - ///// - //[Display(Name = "期间")] - //public int Version { get; set; } - - ///// - ///// 结算单号 - ///// - //[Display(Name = "结算单号")] - //public string SettleBillNum { get; set; } = null!; - - ///// - ///// 对应字段Material - ///// - //[Display(Name = "零件号")] - //public string LU { get; set; } = null!; - - ///// - ///// 对应字段ExternalCalNumber - ///// - //[Display(Name = "生产码")] - //public string PN { get; set; } = null!; - - /// - /// 选择工厂导入 - /// - [Display(Name = "工厂地点")] - public string Site { get; set; } = null!; - - /// - /// 对应字段Quantity - /// - //[Display(Name = "结算数量")] - //public decimal Qty { get; set; } - - ///// - ///// 匹配价格表对应区间对应地点带出 - ///// - //[Display(Name = "单价")] - //public decimal Price { get; set; } - /// - /// 对应字段MovementType,996正常,997为退货 - /// - [Display(Name = "是否退货")] - public string IsReturn { get; set; } = null!; - - //[Display(Name = "发票分组号")] - //public string InvGroupNum { get; set; } = null!; - - ///// - ///// 对应字段PostingDate - ///// - //[Display(Name = "结算日期(收货日期)")] - //public DateTime SettleDate { get; set; } - - /// - /// 对应字段Reference - /// - //[Display(Name = "结算分组")] - //public string GroupNum { get; set; } = null!; - - [Display(Name = "合同号")] - public string ContractDocID { get; set; } - - -} - - - -public class TEMP_PD_SW -{ - public string LU { set; get; } - public string PN { set; get; } - public string RepLU { set; get; } - public string BusinessType { set; get; } - public string KeyCode { set; get; } - - + public class TMEP_INV + { + public string PartCode { set; get; } + public string LU { set; get; } + /// + /// 合同号 + /// + public string ContractDocID { set; get; } + public decimal Amt { set; get; } + public decimal Qty { set; get; } + public decimal Price { set; get; } + /// + /// 开始日期 + /// + public DateTime BeginDate { get; set; } + /// + /// 结束日期 + /// + public DateTime EndDate { get; set; } + } + public class INVOICE_GRP_DETAIL + { + /// + /// 发票明细 + /// + public List INVOICE_DETAIL { get; set; } + /// + /// 发票和结算分组对应关系 + /// + public List INVOICE_MAP_GROUP { get; set; } + + /// + /// 发票调整明细 + /// + public List ADJ_DETAIL { get; set; } + + } + + public class TEMP_CAN_SA_DETAIL + { + public Guid Id { set; get; } + /// + ///关联结算单号 + /// + public string SettleBillNum { get; set; } + /// + ///工厂地点 + /// + + public string Site { get; set; } + /// + /// 版本 + /// + public int Version { get; set; } + /// + /// 单价 + /// + public decimal Price { get; set; } + /// + /// 结算单号(发票分组号) + /// + public string BillNum { get; set; } + /// + /// 结算日期 + /// + public DateTime SettleDate { get; set; } + /// + ///发票组号 + /// + public string InvGroupNum { get; set; } + /// + /// 零件号 + /// + public string LU { get; set; } + + /// + /// 物料描述 + /// + public string MaterialDesc { get; set; } + + /// + /// 生产号 + /// + public string PN { get; set; } + /// + /// 结算数量 + /// + public decimal Qty { get; set; } + /// + /// 结算分组号 + /// + public string GroupNum { get; set; } + /// + /// 金额 + /// + public decimal Amt { get; set; } + + /// + /// 合同号 + /// + public string ContractDocID { set; get; } + /// + /// 开始日期 + /// + public DateTime BeginDate { get; set; } + /// + /// 结束日期 + /// + public DateTime EndDate { get; set; } + + /// + /// 客户零件号 + /// + public string PartCode { get; set; } + + /// + /// 订单号 + /// + public string PoNum { get; set; } + + /// + /// 行號 + /// + public int LineCode { get; set; } + + } + public class TEMP_NOT_SA_DETAIL : SA_NOT_BASE + { + ///// + ///// 对应字段(Material+ExternalCalNumber) + ///// + //[Display(Name = "LU+生产码")] + //public string KeyCode { get; set; } = null!; + + ///// + ///// 期间 + ///// + //[Display(Name = "期间")] + //public int Version { get; set; } + + ///// + ///// 结算单号 + ///// + //[Display(Name = "结算单号")] + //public string SettleBillNum { get; set; } = null!; + + ///// + ///// 对应字段Material + ///// + //[Display(Name = "零件号")] + //public string LU { get; set; } = null!; + + ///// + ///// 对应字段ExternalCalNumber + ///// + //[Display(Name = "生产码")] + //public string PN { get; set; } = null!; + + /// + /// 选择工厂导入 + /// + [Display(Name = "工厂地点")] + public string Site { get; set; } = null!; + + /// + /// 对应字段Quantity + /// + //[Display(Name = "结算数量")] + //public decimal Qty { get; set; } + + ///// + ///// 匹配价格表对应区间对应地点带出 + ///// + //[Display(Name = "单价")] + //public decimal Price { get; set; } + /// + /// 对应字段MovementType,996正常,997为退货 + /// + [Display(Name = "是否退货")] + public string IsReturn { get; set; } = null!; + + //[Display(Name = "发票分组号")] + //public string InvGroupNum { get; set; } = null!; + + ///// + ///// 对应字段PostingDate + ///// + //[Display(Name = "结算日期(收货日期)")] + //public DateTime SettleDate { get; set; } + + /// + /// 对应字段Reference + /// + //[Display(Name = "结算分组")] + //public string GroupNum { get; set; } = null!; + + [Display(Name = "合同号")] + public string ContractDocID { get; set; } + + } + + public class TEMP_PD_SW + { + public string LU { set; get; } + public string PN { set; get; } + public string RepLU { set; get; } + public string BusinessType { set; get; } + public string KeyCode { set; get; } + + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs index f5276ac0..07fba63d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/IJobService.cs @@ -1,9 +1,10 @@ using System; using System.Threading.Tasks; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public interface IJobService +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - Task Invoke(IServiceProvider serviceProvider); + public interface IJobService + { + Task Invoke(IServiceProvider serviceProvider); + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs index 273fa8d0..4f27a937 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobItem.cs @@ -2,32 +2,33 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public class JobItem : Entity +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public JobItem() - { - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } - public JobItem(Guid id):base(id) + public class JobItem : Entity { - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } + public JobItem() + { + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } + public JobItem(Guid id) : base(id) + { + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } - public bool IsDisabled { get; set; } + public bool IsDisabled { get; set; } - [Required] - public string Name { get; set; } + [Required] + public string Name { get; set; } - [Required] - public string Cron { get; set; } + [Required] + public string Cron { get; set; } - [Required] - public string Service { get; set; } + [Required] + public string Service { get; set; } - public bool IsRunning { get; set; } - public DateTime? HeartBeat { get; set; } + public bool IsRunning { get; set; } + public DateTime? HeartBeat { get; set; } - public string ConcurrencyStamp { get; set; } + public string ConcurrencyStamp { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs index 454e6eb6..b61c7001 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/JobLog.cs @@ -1,15 +1,16 @@ using System; using Volo.Abp.Domain.Entities; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public class JobLog : Entity +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public JobItem Job { get; set; } - public Guid JobId { get; set; } - public DateTime Start { get; set; } - public DateTime? End { get; set; } - public bool Success { get; set; } - public string Host { get; set; } - public string Exception { get; set; } + public class JobLog : Entity + { + public JobItem Job { get; set; } + public Guid JobId { get; set; } + public DateTime Start { get; set; } + public DateTime? End { get; set; } + public bool Success { get; set; } + public string Host { get; set; } + public string Exception { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs index 1402c790..5a1e9c00 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalance.cs @@ -1,23 +1,24 @@ using System; using SequentialGuid; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public class VmiBalance : VmiBalanceBase +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public VmiBalance() + public class VmiBalance : VmiBalanceBase { - Id = SequentialGuidGenerator.Instance.NewGuid(); - CreatedTime = Id.ToDateTime().Value.ToLocalTime(); - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } + public VmiBalance() + { + Id = SequentialGuidGenerator.Instance.NewGuid(); + CreatedTime = Id.ToDateTime().Value.ToLocalTime(); + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } - public VmiBalance(Guid id) : base(id) - { - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } + public VmiBalance(Guid id) : base(id) + { + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } - public string ConcurrencyStamp { get; set; } - public DateTime CreatedTime { get; set; } - public DateTime UpdatedTime { get; set; } = DateTime.Now; + public string ConcurrencyStamp { get; set; } + public DateTime CreatedTime { get; set; } + public DateTime UpdatedTime { get; set; } = DateTime.Now; + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs index 1697a2e9..2258f63b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs @@ -3,79 +3,80 @@ using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public abstract class VmiBalanceBase : Entity +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public VmiBalanceBase() - { - } - public VmiBalanceBase(Guid id) : base(id) + public abstract class VmiBalanceBase : Entity { - } - [Display(Name = "厂内零件号", Order = 6)] - public string RealPartCode { get; set; }//原始 + public VmiBalanceBase() + { + } + public VmiBalanceBase(Guid id) : base(id) + { + } + [Display(Name = "厂内零件号", Order = 6)] + public string RealPartCode { get; set; }//原始 - [Display(Name = "客户零件号", Order = 7)] - public string CustPartCode { get; set; } + [Display(Name = "客户零件号", Order = 7)] + public string CustPartCode { get; set; } - [Display(Name = "生产码类型", Order = 8)] - public string CodeType { get; set; } + [Display(Name = "生产码类型", Order = 8)] + public string CodeType { get; set; } - [Display(Name = "发货类型", Order = 9)] - public EnumDeliverBjBmpBillType? DeliverBillType { get; set; } + [Display(Name = "发货类型", Order = 9)] + public EnumDeliverBjBmpBillType? DeliverBillType { get; set; } - [Display(Name = "数量", Order = 10)] - public decimal Qty { get; set; } + [Display(Name = "数量", Order = 10)] + public decimal Qty { get; set; } - [Display(Name = "发运日期", Order = 11)] - public DateTime? BillTime { get; set; } + [Display(Name = "发运日期", Order = 11)] + public DateTime? BillTime { get; set; } - [Display(Name = "订单日期", Order = 12)] - public DateTime? AssembleData { get; set; } + [Display(Name = "订单日期", Order = 12)] + public DateTime? AssembleData { get; set; } - [Display(Name = "ERP库位", Order = 13)] - public string ErpToLoc { get; set; } + [Display(Name = "ERP库位", Order = 13)] + public string ErpToLoc { get; set; } - [Display(Name = "EDI顺序号", Order = 14)] - public string Seq { get; set; } + [Display(Name = "EDI顺序号", Order = 14)] + public string Seq { get; set; } - [Display(Name = "客户订单号", Order = 15)] - public string OrderNum { get; set; } + [Display(Name = "客户订单号", Order = 15)] + public string OrderNum { get; set; } - [Display(Name = "塑件唯一码", Order = 16)] - public string UniqueCode { get; set; } + [Display(Name = "塑件唯一码", Order = 16)] + public string UniqueCode { get; set; } - [Display(Name = "EDI总成号", Order = 17)] - public string MatchNumber { get; set; } + [Display(Name = "EDI总成号", Order = 17)] + public string MatchNumber { get; set; } - [Display(Name = "PJIS生产顺序号", Order = 18)] - public string PjsNum { get; set; } + [Display(Name = "PJIS生产顺序号", Order = 18)] + public string PjsNum { get; set; } - [Display(Name = "实际生产码", Order = 19)] - public string RealCode { get; set; } + [Display(Name = "实际生产码", Order = 19)] + public string RealCode { get; set; } - [Display(Name = "配置码", Order = 20)] - public string Configcode { get; set; } + [Display(Name = "配置码", Order = 20)] + public string Configcode { get; set; } - [Display(Name = "工厂", Order = 21)] - public string factory { get; set; } + [Display(Name = "工厂", Order = 21)] + public string factory { get; set; } - [Display(Name = "发货子类型", Order = 22)] - public EnumDeliverSubBillType? DeliverSubBillType { get; set; } + [Display(Name = "发货子类型", Order = 22)] + public EnumDeliverSubBillType? DeliverSubBillType { get; set; } - [Display(Name = "EDI订单生产码", Order = 23)] - public string VinCode { get; set; } + [Display(Name = "EDI订单生产码", Order = 23)] + public string VinCode { get; set; } - [Display(Name = "结算生产码", Order = 24)] - public string SettlementVinCode { get; set; } + [Display(Name = "结算生产码", Order = 24)] + public string SettlementVinCode { get; set; } - [Display(Name = "结算厂内生产码", Order = 25)] - public string SettlementPartCode { get; set; } + [Display(Name = "结算厂内生产码", Order = 25)] + public string SettlementPartCode { get; set; } - [Display(Name = "是否补货", Order = 26)] - public bool? IsReplenished { get; set; } + [Display(Name = "是否补货", Order = 26)] + public bool? IsReplenished { get; set; } - [Display(Name = "备注", Order = 27)] - public string ReMark { get; set; } + [Display(Name = "备注", Order = 27)] + public string ReMark { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs index 174bc5d9..26ba6a79 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs @@ -3,60 +3,61 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using SequentialGuid; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -/// -/// 库存事务 -/// -public class VmiLog : VmiBalanceBase, IValidatableObject +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public VmiLog() - { - Id = SequentialGuidGenerator.Instance.NewGuid(); - ChangedTime = Id.ToDateTime().Value.ToLocalTime(); - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } - - public void SetId(Guid id) + /// + /// 库存事务 + /// + public class VmiLog : VmiBalanceBase, IValidatableObject { - this.Id = id; - } - - public IEnumerable Validate(ValidationContext validationContext) - { - if (string.IsNullOrEmpty(this.RealPartCode)) + public VmiLog() { - yield return new ValidationResult("LU零件号不能为空", new string[] { nameof(this.RealPartCode) }); + Id = SequentialGuidGenerator.Instance.NewGuid(); + ChangedTime = Id.ToDateTime().Value.ToLocalTime(); + ConcurrencyStamp = Guid.NewGuid().ToString("N"); } - if (string.IsNullOrEmpty(this.ErpToLoc)) + + public void SetId(Guid id) { - yield return new ValidationResult("ERP库位不能为空", new string[] { nameof(this.ErpToLoc) }); + this.Id = id; } - if (string.IsNullOrEmpty(this.OrderNum)) + + public IEnumerable Validate(ValidationContext validationContext) { - yield return new ValidationResult("客户客户订单号不能为空", new string[] { nameof(this.OrderNum) }); + if (string.IsNullOrEmpty(this.RealPartCode)) + { + yield return new ValidationResult("LU零件号不能为空", new string[] { nameof(this.RealPartCode) }); + } + if (string.IsNullOrEmpty(this.ErpToLoc)) + { + yield return new ValidationResult("ERP库位不能为空", new string[] { nameof(this.ErpToLoc) }); + } + if (string.IsNullOrEmpty(this.OrderNum)) + { + yield return new ValidationResult("客户客户订单号不能为空", new string[] { nameof(this.OrderNum) }); + } } - } - [Display(Name = "库存事务分类", Order = 0)] - public VmiLogType LogType { get; set; } + [Display(Name = "库存事务分类", Order = 0)] + public VmiLogType LogType { get; set; } - [Display(Name = "变动单号", Order = 1)] - public string ChangedNumber { get; set; } + [Display(Name = "变动单号", Order = 1)] + public string ChangedNumber { get; set; } - [Display(Name = "变动时间", Order = 2)] - public DateTime ChangedTime { get; set; } + [Display(Name = "变动时间", Order = 2)] + public DateTime ChangedTime { get; set; } - [Display(Name = "变动类型", Order = 3)] - public VmiType ChangedType { get; set; } + [Display(Name = "变动类型", Order = 3)] + public VmiType ChangedType { get; set; } - [Display(Name = "便动人", Order = 4)] - public string ChangedBy { get; set; } + [Display(Name = "便动人", Order = 4)] + public string ChangedBy { get; set; } - [Display(Name = "库存变动", Order = 5)] - public decimal ChangedQty { get; set; } + [Display(Name = "库存变动", Order = 5)] + public decimal ChangedQty { get; set; } - public string ConcurrencyStamp { get; set; } - public DateTime CreatedTime { get; set; } - public DateTime UpdatedTime { get; set; } = DateTime.Now; + public string ConcurrencyStamp { get; set; } + public DateTime CreatedTime { get; set; } + public DateTime UpdatedTime { get; set; } = DateTime.Now; + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs index 7543ca33..c7b03af3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiMessage.cs @@ -2,20 +2,21 @@ using System; using SequentialGuid; using Volo.Abp.Domain.Entities; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public class VmiMessage : Entity +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public VmiMessage() + public class VmiMessage : Entity { - Id = SequentialGuidGenerator.Instance.NewGuid(); - CreatedTime = Id.ToDateTime().Value.ToLocalTime(); - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } + public VmiMessage() + { + Id = SequentialGuidGenerator.Instance.NewGuid(); + CreatedTime = Id.ToDateTime().Value.ToLocalTime(); + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } - public long Number { get; set; } - public string Message { get; set; } - public bool isConsumed { get; set; } - public DateTime CreatedTime { get; set; } - public string ConcurrencyStamp { get; set; } + public long Number { get; set; } + public string Message { get; set; } + public bool isConsumed { get; set; } + public DateTime CreatedTime { get; set; } + public string ConcurrencyStamp { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiReplenished.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiReplenished.cs index e08857eb..38b27d34 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiReplenished.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiReplenished.cs @@ -1,39 +1,40 @@ using System; using System.ComponentModel.DataAnnotations; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -public class VmiReplenished : VmiBalanceBase +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { - public VmiReplenished() + public class VmiReplenished : VmiBalanceBase { - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } + public VmiReplenished() + { + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } - public VmiReplenished(Guid id) : base(id) - { - ConcurrencyStamp = Guid.NewGuid().ToString("N"); - } + public VmiReplenished(Guid id) : base(id) + { + ConcurrencyStamp = Guid.NewGuid().ToString("N"); + } - [Display(Name = "库存事务分类", Order = 0)] - public VmiLogType LogType { get; set; } + [Display(Name = "库存事务分类", Order = 0)] + public VmiLogType LogType { get; set; } - [Display(Name = "变动单号", Order = 1)] - public string ChangedNumber { get; set; } + [Display(Name = "变动单号", Order = 1)] + public string ChangedNumber { get; set; } - [Display(Name = "变动时间", Order = 2)] - public DateTime ChangedTime { get; set; } + [Display(Name = "变动时间", Order = 2)] + public DateTime ChangedTime { get; set; } - [Display(Name = "变动类型", Order = 3)] - public VmiType ChangedType { get; set; } + [Display(Name = "变动类型", Order = 3)] + public VmiType ChangedType { get; set; } - [Display(Name = "便动人", Order = 4)] - public string ChangedBy { get; set; } + [Display(Name = "便动人", Order = 4)] + public string ChangedBy { get; set; } - [Display(Name = "库存变动", Order = 5)] - public decimal ChangedQty { get; set; } + [Display(Name = "库存变动", Order = 5)] + public decimal ChangedQty { get; set; } - public string ConcurrencyStamp { get; set; } - public DateTime CreatedTime { get; set; } - public DateTime UpdatedTime { get; set; } + public string ConcurrencyStamp { get; set; } + public DateTime CreatedTime { get; set; } + public DateTime UpdatedTime { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs index 5b6a8913..7b3bb57e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiSnapshot.cs @@ -1,21 +1,22 @@ using System; using Volo.Abp.Domain.Entities; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -/// -/// 库存快照,每月26日8.00,取库存按照时间存储到sqlite文件中 -/// -public class VmiSnapshot : Entity +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { /// - /// 备份名称 + /// 库存快照,每月26日8.00,取库存按照时间存储到sqlite文件中 /// - public string Name { get; set; } + public class VmiSnapshot : Entity + { + /// + /// 备份名称 + /// + public string Name { get; set; } - public DateTime Start { get; set; } + public DateTime Start { get; set; } - public DateTime End { get; set; } + public DateTime End { get; set; } - public string Description { get; set; } + public string Description { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs index f6376eb2..271562c8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiType.cs @@ -1,54 +1,55 @@ using System.ComponentModel.DataAnnotations; -namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi; - -/// -/// 寄售库存操作类型 -/// -public enum VmiType -{ - [Display(Name = "入库")] - In, - - [Display(Name = "出库")] - Out -} - -public enum VmiLogType +namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { /// - /// 发运入库 - /// - [Display(Name = "发运入库")] - Type100 = 100, - - /// - /// 结算出库 - /// - [Display(Name = "结算出库")] - Type200 = 200, - - /// - /// 反结入库 - /// - [Display(Name = "反结入库")] - Type300 = 300, - - /// - /// 退货出库 - /// - [Display(Name = "退货出库")] - Type400 = 400, - - /// - /// 调整入库 - /// - [Display(Name = "调整入库")] - Type500 = 500, - - /// - /// 调整出库 + /// 寄售库存操作类型 /// - [Display(Name = "调整出库")] - Type600 = 600, + public enum VmiType + { + [Display(Name = "入库")] + In, + + [Display(Name = "出库")] + Out + } + + public enum VmiLogType + { + /// + /// 发运入库 + /// + [Display(Name = "发运入库")] + Type100 = 100, + + /// + /// 结算出库 + /// + [Display(Name = "结算出库")] + Type200 = 200, + + /// + /// 反结入库 + /// + [Display(Name = "反结入库")] + Type300 = 300, + + /// + /// 退货出库 + /// + [Display(Name = "退货出库")] + Type400 = 400, + + /// + /// 调整入库 + /// + [Display(Name = "调整入库")] + Type500 = 500, + + /// + /// 调整出库 + /// + [Display(Name = "调整出库")] + Type600 = 600, + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs index 558afe84..7169505a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/Bom.cs @@ -1,8 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - using Win.Sfs.Shared.Constant; +using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Boms { @@ -26,20 +25,18 @@ namespace Win.Sfs.SettleAccount.Boms /// public string Factory { set; get; } - /// - /// - /// + /// + /// + /// public string Version { set; get; } [Display(Name = "父物料编码")] [Required(ErrorMessage = "{0}是必填项")] public string ParentItemCode { get; set; } - [Display(Name = "父物料描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ParentItemDesc { get; set; } - [Display(Name = "组件编码")] [Required(ErrorMessage = "{0}是必填项")] public string ChildItemCode { get; set; } @@ -48,11 +45,9 @@ namespace Win.Sfs.SettleAccount.Boms [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string ChildItemDesc { get; set; } - [Display(Name = "组件计量单位")] public string ChildItemUom { get; set; } - [Display(Name = "组件数量")] [Required(ErrorMessage = "{0}是必填项")] public decimal Qty { get; set; } @@ -81,8 +76,6 @@ namespace Win.Sfs.SettleAccount.Boms public Guid ParentId { get; set; } - - public Bom() { } @@ -107,7 +100,7 @@ namespace Win.Sfs.SettleAccount.Boms string factory ) : base(id) { - + BranchId = branchId; ParentItemCode = parentItemCode; ParentItemDesc = parentItemDesc; @@ -125,11 +118,11 @@ namespace Win.Sfs.SettleAccount.Boms ParentId = parentId; Factory = factory; } - public void SetValue(Guid guid,Guid branchId, string year,string peroid,string version,Guid parentId,string factory) + public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId, string factory) { Period = peroid; Year = year; - Id = guid; + Id = guid; Version = version; BranchId = branchId; ParentId = parentId; @@ -138,18 +131,18 @@ namespace Win.Sfs.SettleAccount.Boms public void Set( string parentItemDesc, string childItemDesc, - string childItemUom, + string childItemUom, decimal qty, int operateProcess, decimal scrapPercent, string bomType, string issuePosition, - int bomLevel, + int bomLevel, bool enabled) { ParentItemDesc = parentItemDesc; ChildItemDesc = childItemDesc; - ChildItemUom = childItemUom; + ChildItemUom = childItemUom; Qty = qty; OperateProcess = operateProcess; ScrapPercent = scrapPercent; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/BomVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/BomVersion.cs index 95c73ce7..43453c54 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/BomVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Boms/BomVersion.cs @@ -1,32 +1,23 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Guids; -using Win.Sfs.SettleAccount.Boms; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Boms { public class BomVersion : FullAuditedAggregateRootBase { - + public BomVersion() { } - public string Year { get;private set; } + public string Year { get; private set; } /// /// 期间 /// - public string Period { get;private set; } + public string Period { get; private set; } /// /// 版本号 /// - public string Version { get; private set; } - + public string Version { get; private set; } /// /// 工厂 @@ -38,11 +29,10 @@ namespace Win.Sfs.SettleAccount.Entities.Boms /// public string CustomerCode { private set; get; } - public BomVersion( Guid id, Guid branchId, - string year, string period, string version, string customerCode,string factory):base(id) + string year, string period, string version, string customerCode, string factory) : base(id) { BranchId = branchId; Year = year; @@ -50,9 +40,8 @@ namespace Win.Sfs.SettleAccount.Entities.Boms Version = version; CustomerCode = customerCode; Factory = factory; - - } + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/CodeSettingTables/CodeSetting.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/CodeSettingTables/CodeSetting.cs index 560f9756..0a8eadaa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/CodeSettingTables/CodeSetting.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/CodeSettingTables/CodeSetting.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.CodeSettings @@ -19,7 +15,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings /// public string Value { set; get; } - /// /// 描述 /// @@ -31,8 +26,6 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings Id = id; BranchId = branchId; - - } public void Update(string project, string value, string descript) { @@ -41,12 +34,11 @@ namespace Win.Sfs.SettleAccount.Entities.CodeSettings Description = descript; } - public CodeSetting() { } public CodeSetting( Guid id, Guid branchId, - string project, string value, string description):base(id) + string project, string value, string description) : base(id) { BranchId = branchId; Project = project; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs index cec06bd0..4a74b1e5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Controls/CentralizedControl.cs @@ -1,4 +1,4 @@ -using System; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Controls @@ -6,7 +6,7 @@ namespace Win.Sfs.SettleAccount.Entities.Controls /// /// 期间设置 /// - public class CentralizedControl: FullAuditedAggregateRootBase + public class CentralizedControl : FullAuditedAggregateRootBase { /// ///年度 @@ -18,27 +18,22 @@ namespace Win.Sfs.SettleAccount.Entities.Controls /// public string Period { set; get; } - - /// /// 版本 /// public string Version { set; get; } - /// /// 是否开放状态 /// public bool State { set; get; } - - public void SetValue(Guid id,Guid branchId) + public void SetValue(Guid id, Guid branchId) { Id = id; BranchId = branchId; } - public void OpenVersion() { State = true; @@ -48,19 +43,17 @@ namespace Win.Sfs.SettleAccount.Entities.Controls State = false; } - public void Update(string remark) { Remark = remark; } - public CentralizedControl() { } public CentralizedControl( Guid id, Guid branchId, - string year, string period, string version, bool state):base(id) + string year, string period, string version, bool state) : base(id) { BranchId = branchId; Year = year; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/Customer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/Customer.cs index e25534af..ffa01396 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/Customer.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/Customer.cs @@ -1,19 +1,20 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - using Win.Sfs.Shared.Constant; +using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Customers { /// /// 客户 /// - public class Customer : BranchAggregateRootBase { + public class Customer : BranchAggregateRootBase + { protected Customer() { } - + public Customer(Guid id, Guid branchId, string code, string name, string description, string address, string contact, string contactPhone, string contactEmail, string contactFax, decimal? taxRate, Guid currencyId, int? customerType) - :base(id){ + : base(id) + { BranchId = branchId; Code = code ?? throw new ArgumentNullException(nameof(code)); Name = name ?? throw new ArgumentNullException(nameof(name)); @@ -28,9 +29,6 @@ namespace Win.Sfs.SettleAccount.Customers CustomerType = customerType; } - - - /// /// 客户代码 /// @@ -50,20 +48,20 @@ namespace Win.Sfs.SettleAccount.Customers /// 客户描述 /// [Display(Name = "客户描述")] - + [StringLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Description { get; set; } /// /// 联系地址 /// [Display(Name = "联系地址")] - + [StringLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Address { get; set; } /// /// 联系人 /// - + [Display(Name = "联系人")] [StringLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Contact { get; set; } @@ -98,13 +96,10 @@ namespace Win.Sfs.SettleAccount.Customers [Display(Name = "客户类型")] public Nullable CustomerType { get; set; } + public void Set(string name, string description, string address, string contact, string contactPhone, string contactEmail, string contactFax, decimal? taxRate, Guid currencyId, int? customerType, bool enabled) - - - public void Set( string name, string description, string address, string contact, string contactPhone, string contactEmail, string contactFax, decimal? taxRate, Guid currencyId, int? customerType,bool enabled) - { - + Name = name ?? throw new ArgumentNullException(nameof(name)); Description = description ?? throw new ArgumentNullException(nameof(description)); Address = address ?? throw new ArgumentNullException(nameof(address)); @@ -118,7 +113,5 @@ namespace Win.Sfs.SettleAccount.Customers Enabled = enabled; } - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/CustomerBom.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/CustomerBom.cs index 316f0243..96f86bf0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/CustomerBom.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Customers/CustomerBom.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared.DomainBase; @@ -56,7 +56,7 @@ namespace Win.Sfs.SettleAccount.Customers FailureTime = failureTime; } - public void SetCustomerBom( + public void SetCustomerBom( decimal qty, DateTime effectiveTime, DateTime failureTime, bool enabled) @@ -67,4 +67,4 @@ namespace Win.Sfs.SettleAccount.Customers Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/ErpAssemblyDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/ErpAssemblyDto.cs index fa1a4f61..1768913c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/ErpAssemblyDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/ErpAssemblyDto.cs @@ -1,9 +1,4 @@ -using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto { @@ -21,7 +16,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto [ExporterHeader(DisplayName = "ERP总成号")] public string ErpMaterialCode { set; get; } - /// /// 数量 /// @@ -29,14 +23,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto public decimal Qty { set; get; } - /// /// 描述 /// [ExporterHeader(DisplayName = "描述")] public string MaterialDesc { set; get; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/PriceQtyDiffDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/PriceQtyDiffDto.cs index 53eb29b9..fcfb9d90 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/PriceQtyDiffDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPDto/PriceQtyDiffDto.cs @@ -1,61 +1,35 @@ -using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Entities.ERPDto { public class PriceQtyDiffDto { -//[ExporterHeader(DisplayName="物流发货单号")] -//[ExporterHeader(DisplayName="实际发货日期")] -//[ExporterHeader(DisplayName="M100交货状态")] -//[ExporterHeader(DisplayName="KENN号")] -//[ExporterHeader(DisplayName="底盘号")] -//[ExporterHeader(DisplayName="物料号")] -//[ExporterHeader(DisplayName="物料描述")] -//[ExporterHeader(DisplayName="客户物料")] -//[ExporterHeader(DisplayName="组件组物料")] -//[ExporterHeader(DisplayName="组件组物料描述")] -//[ExporterHeader(DisplayName="物料组(车型)")] -//[ExporterHeader(DisplayName="M100交货数量")] -//[ExporterHeader(DisplayName="定价")] -//[ExporterHeader(DisplayName="金额")] -//[ExporterHeader(DisplayName="结算数量")] -//[ExporterHeader(DisplayName="结算日期")] -//[ExporterHeader(DisplayName="结算与发货差异")] -//[ExporterHeader(DisplayName="结算与开票差异")] -//[ExporterHeader(DisplayName="开票数量")] -//[ExporterHeader(DisplayName="开票单价")] -//[ExporterHeader(DisplayName="开票金额")] -//[ExporterHeader(DisplayName="结算金额")] -//[ExporterHeader(DisplayName="单价差异")] -//[ExporterHeader(DisplayName="总金额差异")] -//[ExporterHeader(DisplayName="财务结算出库单号")] -//[ExporterHeader(DisplayName="SAP开票单号")] -//[ExporterHeader(DisplayName="漏结标识")] - - - - - - - - - - - - - - - - - - - + //[ExporterHeader(DisplayName="物流发货单号")] + //[ExporterHeader(DisplayName="实际发货日期")] + //[ExporterHeader(DisplayName="M100交货状态")] + //[ExporterHeader(DisplayName="KENN号")] + //[ExporterHeader(DisplayName="底盘号")] + //[ExporterHeader(DisplayName="物料号")] + //[ExporterHeader(DisplayName="物料描述")] + //[ExporterHeader(DisplayName="客户物料")] + //[ExporterHeader(DisplayName="组件组物料")] + //[ExporterHeader(DisplayName="组件组物料描述")] + //[ExporterHeader(DisplayName="物料组(车型)")] + //[ExporterHeader(DisplayName="M100交货数量")] + //[ExporterHeader(DisplayName="定价")] + //[ExporterHeader(DisplayName="金额")] + //[ExporterHeader(DisplayName="结算数量")] + //[ExporterHeader(DisplayName="结算日期")] + //[ExporterHeader(DisplayName="结算与发货差异")] + //[ExporterHeader(DisplayName="结算与开票差异")] + //[ExporterHeader(DisplayName="开票数量")] + //[ExporterHeader(DisplayName="开票单价")] + //[ExporterHeader(DisplayName="开票金额")] + //[ExporterHeader(DisplayName="结算金额")] + //[ExporterHeader(DisplayName="单价差异")] + //[ExporterHeader(DisplayName="总金额差异")] + //[ExporterHeader(DisplayName="财务结算出库单号")] + //[ExporterHeader(DisplayName="SAP开票单号")] + //[ExporterHeader(DisplayName="漏结标识")] ///// ///// 结算包 @@ -68,7 +42,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPDto //[ExporterHeader(DisplayName = "物料描述")] //public string MaterialDesc { set; get; } - ///// ///// 数量 ///// @@ -105,8 +78,5 @@ namespace Win.Sfs.SettleAccount.Entities.ERPDto //public decimal diffPrice { set; get; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingDetail.cs index 8695180f..27401b83 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingDetail.cs @@ -1,16 +1,12 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.ERPShipping { public class ERPShippingDetail : FullAuditedAggregateRootBase, 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) + 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; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingVersion.cs index 1c146b10..89a3ab8f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ERPShipping/ERPShippingVersion.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.ERPShipping { - + public class ERPShippingVersion : FullAuditedAggregateRootBase { @@ -24,7 +20,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShipping /// public string Version { get; private set; } - /// /// 工厂 /// @@ -35,7 +30,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShipping /// public string CustomerCode { private set; get; } - public ERPShippingVersion( Guid id, Guid branchId, @@ -50,10 +44,6 @@ namespace Win.Sfs.SettleAccount.Entities.ERPShipping } - } - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ErrorBillNum/ErrorBillNum.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ErrorBillNum/ErrorBillNum.cs index f1c4c296..956d14f1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ErrorBillNum/ErrorBillNum.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ErrorBillNum/ErrorBillNum.cs @@ -1,8 +1,5 @@ -using System; -using System.ComponentModel.DataAnnotations; +using System; using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Errors { @@ -16,7 +13,7 @@ namespace Win.Sfs.SettleAccount.Errors public ErrorBill( Guid id, Guid branchId, - string billNum, string materialCode, string wmsBillNum,string materialDesc,string customerMaterialCode):base(id) + string billNum, string materialCode, string wmsBillNum, string materialDesc, string customerMaterialCode) : base(id) { BranchId = branchId; BillNum = billNum; @@ -41,11 +38,9 @@ namespace Win.Sfs.SettleAccount.Errors /// public string WmsBillNum { set; get; } - public string MaterialDesc { set; get; } - public string CustomerMaterialCode { set; get; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncEto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncEto.cs index f490db28..18ed6078 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncEto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncEto.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using System.Text; using Volo.Abp.EventBus; using WY.NewJit.MsgBaseData; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncOperationType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncOperationType.cs index fd767d8c..96a11217 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncOperationType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/AssemblySyncOperationType.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Text; - namespace WY.NewJit.MsgTransmission.TianHe { public enum AssemblySyncOperationTypeEnum diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgErpDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgErpDto.cs index b0d27481..7bd25d4f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgErpDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgErpDto.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Text; -using Volo.Abp.Application.Dtos; namespace WY.NewJit.MsgBaseData { @@ -22,7 +20,6 @@ namespace WY.NewJit.MsgBaseData [StringLength(20)] public virtual string VehicleModel { get; protected set; } - /// /// ERP总成编码 /// @@ -42,6 +39,5 @@ namespace WY.NewJit.MsgBaseData public List Details { get; set; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgPartDto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgPartDto.cs index 44770256..b92734ad 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgPartDto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/CreateUpdateAssemblyCfgPartDto.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Text; namespace WY.NewJit.MsgBaseData { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FISVersionEto.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FISVersionEto.cs index 9b7ea73d..5d3033c1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FISVersionEto.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FISVersionEto.cs @@ -1,25 +1,14 @@ -using System; +using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.EventBus; -using Volo.Abp.Guids; - namespace WY.NewJit.SettleAccountFis { [EventName("WY.NewJit.SettleAccountFis.FISVersion")] - public class FISVersionEto + public class FISVersionEto { - - - public string Year { get; set; } /// /// 期间 @@ -35,7 +24,6 @@ namespace WY.NewJit.SettleAccountFis /// public string CustomerCode { get; set; } - public string Factory { get; set; } /// @@ -53,7 +41,6 @@ namespace WY.NewJit.SettleAccountFis /// public string EndDate { get; set; } - public List Details { get; set; } public FISVersionEto() @@ -74,6 +61,5 @@ namespace WY.NewJit.SettleAccountFis Details = new List(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FIS_TH.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FIS_TH.cs index 56548127..e2534b36 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FIS_TH.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Eto/FIS_TH.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Entities.Auditing; +using System; namespace WY.NewJit.SettleAccountFis { - public class FIS_TH + public class FIS_TH { public Guid ParentId { get; set; } @@ -27,7 +22,6 @@ namespace WY.NewJit.SettleAccountFis /// public string Year { get; set; } - /// /// 期间 /// @@ -74,13 +68,11 @@ namespace WY.NewJit.SettleAccountFis /// public decimal Qty { set; get; } - /// /// CP5时间 /// public string CP5Time { set; get; } - /// /// 顺序号 /// @@ -91,14 +83,11 @@ namespace WY.NewJit.SettleAccountFis /// public string ChassisNumber2 { set; get; } - - /// /// CP7时间 /// public string CP7Time { set; get; } - /// /// 结算数量 /// @@ -113,14 +102,13 @@ namespace WY.NewJit.SettleAccountFis /// public string ErpMaterialCode { set; get; } - - public void SetValue(Guid guid, string year, string peroid, string version, Guid parentId,string erpMatialCode) + public void SetValue(Guid guid, string year, string peroid, string version, Guid parentId, string erpMatialCode) { Period = peroid; Year = year; - + Version = version; - + ParentId = parentId; ErpMaterialCode = erpMatialCode; } @@ -130,12 +118,11 @@ namespace WY.NewJit.SettleAccountFis State = p_state; } - public void SetModel(string model) { Model = model; } public FIS_TH() { } public FIS_TH( - Guid id, string year, string period, string extend1, string chassisNumber, decimal qty, string cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, int state, string cp7Time, decimal settledQty, string version, string creationTime, Guid creatorId, string beginTime, string endTime,string erpMatialCode, string model) - + Guid id, string year, string period, string extend1, string chassisNumber, decimal qty, string cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, int state, string cp7Time, decimal settledQty, string version, string creationTime, Guid creatorId, string beginTime, string endTime, string erpMatialCode, string model) + { Year = year; Period = period; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS.cs index 0a6f1396..f3f17b65 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.FISes @@ -31,7 +26,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string Year { get; set; } - /// /// 期间 /// @@ -47,7 +41,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string FISYear { get; set; } - /// /// 订单编号 /// @@ -69,7 +62,6 @@ namespace Win.Sfs.SettleAccount.FISes public string Model { get; set; } - public string Extend1 { set; get; } /// @@ -82,13 +74,11 @@ namespace Win.Sfs.SettleAccount.FISes /// public decimal Qty { set; get; } - /// /// CP5时间 /// public DateTime CP5Time { set; get; } - /// /// 顺序号 /// @@ -99,14 +89,11 @@ namespace Win.Sfs.SettleAccount.FISes /// public string ChassisNumber2 { set; get; } - - /// /// CP7时间 /// public DateTime CP7Time { set; get; } - /// /// 结算数量 /// @@ -136,8 +123,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string WMSBillNum { set; get; } - - public string UnSettleVersion { set; get; } //public string WMSBillNumber { set; get; } @@ -157,12 +142,11 @@ namespace Win.Sfs.SettleAccount.FISes ParentId = parentId; } - public void SetState(EnumSettleStatus p_state) + public void SetState(EnumSettleStatus p_state) { State = p_state; } - public void SetModel(string model) { Model = model; } public FIS() { } public FIS( @@ -170,7 +154,7 @@ namespace Win.Sfs.SettleAccount.FISes Guid id, Guid branchId, - string year, string period, string extend1, string chassisNumber, decimal qty, DateTime cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, EnumSettleStatus state, DateTime cp7Time, decimal settledQty,string version,DateTime creationTime,Guid guid, DateTime beginTime, DateTime endTime,string erpMaterialCode) : base(id) + string year, string period, string extend1, string chassisNumber, decimal qty, DateTime cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, EnumSettleStatus state, DateTime cp7Time, decimal settledQty, string version, DateTime creationTime, Guid guid, DateTime beginTime, DateTime endTime, string erpMaterialCode) : base(id) { BranchId = branchId; FISYear = fisyear; @@ -198,6 +182,5 @@ namespace Win.Sfs.SettleAccount.FISes } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISExtend.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISExtend.cs index c93f9449..66d08a7f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISExtend.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISExtend.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.FISes @@ -31,7 +26,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string Year { get; set; } - /// /// 期间 /// @@ -47,7 +41,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string FISYear { get; set; } - /// /// 订单编号 /// @@ -69,7 +62,6 @@ namespace Win.Sfs.SettleAccount.FISes public string Model { get; set; } - public string Extend1 { set; get; } /// @@ -82,13 +74,11 @@ namespace Win.Sfs.SettleAccount.FISes /// public decimal Qty { set; get; } - /// /// CP5时间 /// public DateTime CP5Time { set; get; } - /// /// 顺序号 /// @@ -99,14 +89,11 @@ namespace Win.Sfs.SettleAccount.FISes /// public string ChassisNumber2 { set; get; } - - /// /// CP7时间 /// public DateTime CP7Time { set; get; } - /// /// 结算数量 /// @@ -127,7 +114,6 @@ namespace Win.Sfs.SettleAccount.FISes /// public string ErpMaterialCode { set; get; } - public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId) { Period = peroid; @@ -138,7 +124,6 @@ namespace Win.Sfs.SettleAccount.FISes ParentId = parentId; } - public void SetModel(string model) { Model = model; } public FISExtend() { } public FISExtend( @@ -146,7 +131,7 @@ namespace Win.Sfs.SettleAccount.FISes Guid id, Guid branchId, - string year, string period, string extend1, string chassisNumber, decimal qty, DateTime cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, EnumSettleStatus state, DateTime cp7Time, decimal settledQty, string version, DateTime creationTime, Guid guid, DateTime beginTime, DateTime endTime,string erpMaterialCode) : base(id) + string year, string period, string extend1, string chassisNumber, decimal qty, DateTime cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, EnumSettleStatus state, DateTime cp7Time, decimal settledQty, string version, DateTime creationTime, Guid guid, DateTime beginTime, DateTime endTime, string erpMaterialCode) : base(id) { BranchId = branchId; FISYear = fisyear; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISVersion.cs index 31c8ac46..712ad995 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FISVersion.cs @@ -1,16 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Guids; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.FISes { - + public class FISVersion : FullAuditedAggregateRootBase { @@ -32,10 +25,8 @@ namespace Win.Sfs.SettleAccount.FISes /// public string CustomerCode { private set; get; } - public string Factory { private set; get; } - /// /// 车型 /// @@ -51,14 +42,10 @@ namespace Win.Sfs.SettleAccount.FISes /// public DateTime EndDate { set; get; } - - - - public FISVersion( Guid id, Guid branchId, - string year, string period, string version, string customerCode,string factory,string model,DateTime beginDate,DateTime endDate) : base(id) + string year, string period, string version, string customerCode, string factory, string model, DateTime beginDate, DateTime endDate) : base(id) { BranchId = branchId; Year = year; @@ -72,10 +59,8 @@ namespace Win.Sfs.SettleAccount.FISes Model = model; BeginDate = beginDate; EndDate = endDate; - - + } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS_TH.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS_TH.cs index 0173196f..4066d649 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS_TH.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FIS_TH.cs @@ -1,19 +1,12 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.Entities.FISes { - public class FIS_TH:FullAuditedAggregateRootBase + public class FIS_TH : FullAuditedAggregateRootBase { - - /// /// 顺序号 /// @@ -25,9 +18,6 @@ namespace Win.Sfs.SettleAccount.Entities.FISes [ExporterHeader(DisplayName = "期间")] public string Version { set; get; } - - - /// /// 订单编号 /// @@ -40,21 +30,18 @@ namespace Win.Sfs.SettleAccount.Entities.FISes [ExporterHeader(DisplayName = "零件号")] public string MaterialCode { set; get; } - /// /// Erp总成号 /// [ExporterHeader(DisplayName = "Erp总成号")] public string ErpMaterialCode { set; get; } - /// /// 车型 /// [ExporterHeader(DisplayName = "产线")] public string Model { set; get; } - /// /// 车型 /// @@ -75,8 +62,6 @@ namespace Win.Sfs.SettleAccount.Entities.FISes public string ChassisNumber2 { set; get; } - - /// /// 用量 /// @@ -84,7 +69,6 @@ namespace Win.Sfs.SettleAccount.Entities.FISes public decimal Qty { set; get; } - /// /// CP5时间 /// @@ -97,22 +81,18 @@ namespace Win.Sfs.SettleAccount.Entities.FISes [ExporterHeader(DisplayName = "CP7时间")] public DateTime CP7Time { set; get; } - /// /// 结算数量 /// [ExporterHeader(DisplayName = "结算数量")] public decimal SettledQty { get; set; } - /// /// 顺序号 /// [ExporterHeader(DisplayName = "顺序号")] public string SequenceNumber { set; get; } - - /// ///// 开始时间 ///// @@ -125,19 +105,12 @@ namespace Win.Sfs.SettleAccount.Entities.FISes //[ExporterHeader(DisplayName = "结束时间")] //public DateTime EndTime { set; get; } - - /// /// 状态 /// [ExporterHeader(DisplayName = "状态")] public int State { set; get; } - - - - - public Guid ParentId { get; set; } /// @@ -155,7 +128,6 @@ namespace Win.Sfs.SettleAccount.Entities.FISes /// public string Year { get; set; } - /// /// 期间 /// @@ -202,13 +174,11 @@ namespace Win.Sfs.SettleAccount.Entities.FISes ///// //public decimal Qty { set; get; } - ///// ///// CP5时间 ///// //public DateTime CP5Time { set; get; } - ///// ///// 顺序号 ///// @@ -219,14 +189,11 @@ namespace Win.Sfs.SettleAccount.Entities.FISes ///// //public string ChassisNumber2 { set; get; } - - ///// ///// CP7时间 ///// //public DateTime CP7Time { set; get; } - ///// ///// 结算数量 ///// @@ -241,8 +208,7 @@ namespace Win.Sfs.SettleAccount.Entities.FISes ///// //public string ErpMaterialCode { set; get; } - - public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId,string erpMatialCode) + public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId, string erpMatialCode) { Period = peroid; Year = year; @@ -258,13 +224,12 @@ namespace Win.Sfs.SettleAccount.Entities.FISes State = p_state; } - public void SetModel(string model) { Model = model; } public FIS_TH() { } public FIS_TH( Guid id, Guid branchId, - string year, string period, string extend1, string chassisNumber, decimal qty, DateTime cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, int state, DateTime cp7Time, decimal settledQty, string version, DateTime creationTime, Guid guid, DateTime beginTime, DateTime endTime,string erpMatialCode) : base(id) + string year, string period, string extend1, string chassisNumber, decimal qty, DateTime cp5Time, string sequenceNumber, string orderBillNum, string materialCode, string fisyear, Guid parentId, string kENNCode, string chassisNumber2, int state, DateTime cp7Time, decimal settledQty, string version, DateTime creationTime, Guid guid, DateTime beginTime, DateTime endTime, string erpMatialCode) : base(id) { BranchId = branchId; Year = year; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FisManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FisManager.cs index 8418fdde..4a814e87 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FisManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/FisManager.cs @@ -1,14 +1,10 @@ -using Microsoft.EntityFrameworkCore; -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; using Win.Sfs.SettleAccount.Prebatches; -using Win.Sfs.Shared.Enums; using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.FISes @@ -32,7 +28,6 @@ namespace Win.Sfs.SettleAccount.FISes _prebatchRepository = prebatchRepository; } - /// /// 获取时间范围内的所有未结算数据 /// @@ -43,7 +38,7 @@ namespace Win.Sfs.SettleAccount.FISes public async Task> GetUnsetteldInfoList(Guid branchId, DateTime beginTime, DateTime endTime) { //获取预批量数据 - var probatches = await _prebatchRepository.GetAllAsync(branchId); + var probatches = await _prebatchRepository.GetAllAsync(branchId).ConfigureAwait(false); //获取需要过滤的有效Kenn码 var kennCodes = probatches.Where(p => p.State == (int)EnumSettleStatus.预批量).Select(p => p.KENNCode).ToList(); @@ -64,7 +59,7 @@ namespace Win.Sfs.SettleAccount.FISes public async Task> GetUnsetteldInfoList(Guid branchId, string beginVersion, string endVersion) { //获取预批量数据 - var probatches = await _prebatchRepository.GetAllAsync(branchId); + var probatches = await _prebatchRepository.GetAllAsync(branchId).ConfigureAwait(false); //获取需要过滤的有效Kenn码 var kennCodes = probatches.Where(p => p.State == (int)EnumSettleStatus.预批量).Select(p => p.KENNCode).ToList(); @@ -75,17 +70,16 @@ namespace Win.Sfs.SettleAccount.FISes return fisList; } - /// /// 获取当期版本的所有看板数据 /// /// /// /// - public async Task> GetUnsetteldInfoList(Guid branchId,string version) + public async Task> GetUnsetteldInfoList(Guid branchId, string version) { //获取预批量数据 - var probatches = await _prebatchRepository.GetAllAsync(branchId); + var probatches = await _prebatchRepository.GetAllAsync(branchId).ConfigureAwait(false); //获取需要过滤的有效Kenn码 var kennCodes = probatches.Where(p => p.State == (int)EnumSettleStatus.预批量).Select(p => p.KENNCode).ToList(); @@ -96,10 +90,9 @@ namespace Win.Sfs.SettleAccount.FISes return fisList; } - - public Task LoadFile() + public Task LoadFile() { return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/IFisManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/IFisManager.cs index 86e278fa..04f86542 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/IFisManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/FISes/IFisManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -15,10 +15,8 @@ namespace Win.Sfs.SettleAccount.FISes /// Task> GetUnsetteldInfoList(Guid branchId, DateTime beginTime, DateTime endTime); - - Task> GetUnsetteldInfoList(Guid branchId, string version); Task> GetUnsetteldInfoList(Guid branchId, string beginVersion, string endVersion); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Factories/Factory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Factories/Factory.cs index 27dfccd6..9d909bf6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Factories/Factory.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Factories/Factory.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Factories @@ -26,7 +22,7 @@ namespace Win.Sfs.SettleAccount.Entities.Factories public Factory( Guid id, Guid branchId, - string code, string desc,string customercode):base(id) + string code, string desc, string customercode) : base(id) { BranchId = branchId; @@ -35,19 +31,16 @@ namespace Win.Sfs.SettleAccount.Entities.Factories CustomerCode = customercode; } - public void SetValue(Guid id, Guid branchId) { Id = id; BranchId = branchId; - - } - public void Update( string descript) + public void Update(string descript) { - + Desc = descript; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ImportMap/ImportColumnMap.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ImportMap/ImportColumnMap.cs index 5bc01bd8..9dc2b395 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ImportMap/ImportColumnMap.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ImportMap/ImportColumnMap.cs @@ -1,17 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Entities.Auditing; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.ImportMap { - public class ImportColumnMap: FullAuditedAggregateRootBase + public class ImportColumnMap : FullAuditedAggregateRootBase { public ImportColumnMap() { } - public ImportColumnMap(Guid id,string projectName, string oldColumnName, string newColumnName,bool ischeck):base(id) + public ImportColumnMap(Guid id, string projectName, string oldColumnName, string newColumnName, bool ischeck) : base(id) { ProjectName = projectName; OldColumnName = oldColumnName; @@ -22,12 +17,12 @@ namespace Win.Sfs.SettleAccount.Entities.ImportMap public string ProjectName { set; get; } public string OldColumnName { set; get; } public string NewColumnName { set; get; } - public bool IsCheck { set; get; } - + public bool IsCheck { set; get; } + public void Update(string newcolumn) { NewColumnName = newcolumn; - + } - } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetail.cs index 27d89fb4..926ba928 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetail.cs @@ -1,19 +1,14 @@ -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; +using Magicodes.ExporterAndImporter.Core; using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.Inventories { public class InventoryDetail : FullAuditedAggregateRootBase { - /// ///年度 /// @@ -24,14 +19,11 @@ namespace Win.Sfs.SettleAccount.Inventories /// public string Period { set; get; } - - ///// ///// 物料编号 ///// //public string MaterialCode { get; set; } - /// /// 物料描述 /// @@ -91,10 +83,8 @@ namespace Win.Sfs.SettleAccount.Inventories /// public string Version { set; get; } - public string Factory { set; get; } - /// /// 物料号 /// @@ -103,7 +93,6 @@ namespace Win.Sfs.SettleAccount.Inventories [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public virtual string MaterialCode { get; set; } - ///// ///// 物料描述 ///// @@ -175,11 +164,7 @@ namespace Win.Sfs.SettleAccount.Inventories [MaxLength(CommonConsts.MaxNameLength, ErrorMessage = "{0}最多输入{1}个字符")] public virtual string Unit { get; set; } - - - - - public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId,string factory) + public void SetValue(Guid guid, Guid branchId, string year, string peroid, string version, Guid parentId, string factory) { Period = peroid; Year = year; @@ -192,11 +177,10 @@ namespace Win.Sfs.SettleAccount.Inventories public InventoryDetail() { } - public InventoryDetail( Guid id, Guid branchId, - string materialCode, string materialDesc, decimal inputQty, decimal outputQty, decimal openingInventoryQty, decimal endingInventoryQty, string appraisalCategory, string appraisalDesc, string storageLocation, string storageLocationDesc, string unit, decimal price, string year, string period,Guid parentId,string factory) + string materialCode, string materialDesc, decimal inputQty, decimal outputQty, decimal openingInventoryQty, decimal endingInventoryQty, string appraisalCategory, string appraisalDesc, string storageLocation, string storageLocationDesc, string unit, decimal price, string year, string period, Guid parentId, string factory) { BranchId = branchId; MaterialCode = materialCode; @@ -217,4 +201,4 @@ namespace Win.Sfs.SettleAccount.Inventories Factory = factory; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetailVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetailVersion.cs index 681b200b..d6ab25fb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetailVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Inventories/InventoryDetailVersion.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Guids; -using Win.Sfs.SettleAccount.Inventories; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Inventories @@ -35,15 +27,12 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories /// public string CustomerCode { private set; get; } - public string Factory { private set; get; } - - public InventoryDetailVersion( Guid id, Guid branchId, - string year, string period, string version, string customerCode,string factory) : base(id) + string year, string period, string version, string customerCode, string factory) : base(id) { BranchId = branchId; Year = year; @@ -51,10 +40,9 @@ namespace Win.Sfs.SettleAccount.Entities.Inventories Version = version; CustomerCode = customerCode; Factory = factory; - + } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/Invoice.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/Invoice.cs index c5d2ef53..466e2815 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/Invoice.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/Invoice.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Invoices @@ -24,9 +20,9 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices Version = version; BranchId = branchId; } - public Invoice(Guid Id,string year, string period, string version, string factory, - string materialCode, string materialDesc, decimal qty, - decimal amt):base(Id) + public Invoice(Guid Id, string year, string period, string version, string factory, + string materialCode, string materialDesc, decimal qty, + decimal amt) : base(Id) { Year = year; Period = period; @@ -96,7 +92,6 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices [Display(Name = "金额")] public decimal Amt { set; get; } - /// /// 备注 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/InvoiceVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/InvoiceVersion.cs index caec1eaf..02cd79b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/InvoiceVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Invoices/InvoiceVersion.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Invoices { - public class InvoiceVersion: FullAuditedAggregateRootBase, ISettleAccountEntityBase + public class InvoiceVersion : FullAuditedAggregateRootBase, ISettleAccountEntityBase { public InvoiceVersion() { } @@ -27,7 +23,6 @@ namespace Win.Sfs.SettleAccount.Entities.Invoices /// public string CustomerCode { private set; get; } - public InvoiceVersion( Guid id, Guid branchId, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePrice.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePrice.cs index edd07dc9..f58e662c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePrice.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePrice.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices @@ -12,13 +8,13 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { public ItemInvoicePrice() { } - public ItemInvoicePrice(Guid Id,string year, string period, string version, string factory, string materialCode, string materialDesc, string um, string sales, string subAcct, string cc, string backorder, decimal price, decimal extendedPrice, decimal extendedMargin) :base(Id) + public ItemInvoicePrice(Guid Id, string year, string period, string version, string factory, string materialCode, string materialDesc, string um, string sales, string subAcct, string cc, string backorder, decimal price, decimal extendedPrice, decimal extendedMargin) : base(Id) { Year = year; Period = period; Version = version; Factory = factory; - + MaterialCode = materialCode; MaterialDesc = materialDesc; UM = um; @@ -30,7 +26,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices ExtendedPrice = extendedPrice; ExtendedMargin = extendedMargin; } - /// ///年 @@ -52,7 +47,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices /// [Display(Name = "工厂")] public string Factory { set; get; } - /// /// 零件号 @@ -118,7 +112,7 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices Id = guid; Version = version; BranchId = branchId; - + Factory = factory; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePriceVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePriceVersion.cs index 9f921f21..ceb2b259 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePriceVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/ItemInvoicePrices/ItemInvoicePriceVersion.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices { - public class ItemInvoicePriceVersion: FullAuditedAggregateRootBase, ISettleAccountEntityBase + public class ItemInvoicePriceVersion : FullAuditedAggregateRootBase, ISettleAccountEntityBase { public ItemInvoicePriceVersion() { } @@ -27,7 +23,6 @@ namespace Win.Sfs.SettleAccount.Entities.ItemInvoicePrices /// public string CustomerCode { private set; get; } - public string Factory { private set; get; } public ItemInvoicePriceVersion( Guid id, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs index e25d14dd..03d30453 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationship.cs @@ -2,55 +2,40 @@ using System; using System.ComponentModel.DataAnnotations; using Volo.Abp.Domain.Entities.Auditing; -namespace Win.Sfs.SettleAccount.MaterialRelationships; - -/// -/// 客户零件关系 -/// -public class MaterialRelationship : AuditedAggregateRoot +namespace Win.Sfs.SettleAccount.MaterialRelationships { - /// - /// 厂内物料号 - /// - public string ErpMaterialCode { get; set; } - /// - /// 厂内物料描述 - /// - public string MaterialDesc { get; set; } - /// - /// 客户物料号 - /// - public string SettleMaterialCode { get; set; } - /// - /// 业务分类 - /// - [Display(Name = "业务分类")] - public EnumBusinessType BusinessType { get; set; } - - public void SetId(Guid id, Guid branchId) - { - Id = id; - } - - protected MaterialRelationship() - { - } - public void Update(string materialDesc, string settlMaterialCode) - { - MaterialDesc = materialDesc; - SettleMaterialCode = settlMaterialCode; - } - - public MaterialRelationship(Guid id) : base(id) - { - - } - - public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, EnumBusinessType businessType) : base(id) + public class MaterialRelationship : AuditedAggregateRoot { - ErpMaterialCode = erpMaterialCode; - MaterialDesc = materialDesc; - SettleMaterialCode = settlMaterialCode; - BusinessType = businessType; + public string ErpMaterialCode + { + get; set; + } + public string MaterialDesc + { + get; set; + } + public string SettleMaterialCode + { + get; set; + } + [Display(Name = "业务分类")] + public EnumBusinessType BusinessType + { + get; set; + } + public void SetId(Guid id, Guid branchId) + { + Id = id; + } + protected MaterialRelationship() + { + } + public void Update(string materialDesc, string settlMaterialCode) + { + MaterialDesc = materialDesc; + SettleMaterialCode = settlMaterialCode; + } + public MaterialRelationship(Guid id) : base(id) { } + public MaterialRelationship(Guid id, string erpMaterialCode, string materialDesc, string settlMaterialCode, EnumBusinessType businessType) : base(id) { ErpMaterialCode = erpMaterialCode; MaterialDesc = materialDesc; SettleMaterialCode = settlMaterialCode; BusinessType = businessType; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipDetail.cs index 86fc071d..186fc27c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipDetail.cs @@ -1,19 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships { - public class MaterialRelationshipDetail:FullAuditedAggregateRootBase - { + public class MaterialRelationshipDetail : FullAuditedAggregateRootBase + { public string Version { get; set; } - - - public string CustomerCode { set; get; } /// /// ERP物料号 @@ -33,7 +26,6 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships /// public string SettleMaterialCode { get; set; } - /// /// 发货看板物料号 /// @@ -69,7 +61,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships Guid id, Guid branchId, string version, string customerCode, - string erpMaterialCode, string materialDesc, string materialProperty, string settlMaterialCode, string shipMaterailCode, string appraisalCategory,decimal qty) : base(id) + string erpMaterialCode, string materialDesc, string materialProperty, string settlMaterialCode, string shipMaterailCode, string appraisalCategory, decimal qty) : base(id) { BranchId = branchId; Version = version; @@ -83,6 +75,5 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships Qty = qty; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipManager.cs index 85573f46..dae84aaa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipManager.cs @@ -1,17 +1,15 @@ -using EFCore.BulkExtensions; -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; +using EFCore.BulkExtensions; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships { - + public class MaterialRelationshipManagerTH : DomainService { private readonly ISettleAccountBranchEfCoreRepository _repository; @@ -27,10 +25,9 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships } public virtual async Task GetAsync(Guid id) { - return await _repository.GetAsync(id); + return await _repository.GetAsync(id).ConfigureAwait(false); } - public virtual async Task> GetListAsync( List filters, @@ -40,8 +37,7 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships bool includeDetails = false, CancellationToken cancellationToken = default) { - var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount, - skipCount); + var entities = await _repository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount, skipCount, cancellationToken: cancellationToken).ConfigureAwait(false); return entities; } public virtual async Task> GetVersionListAsync( @@ -53,85 +49,69 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships bool includeDetails = false, CancellationToken cancellationToken = default) { - var entities = await _versionRepository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount, - skipCount); + var entities = await _versionRepository.GetListByFilterAsync(GuidGenerator.Create(), filters, sorting, maxResultCount, skipCount, cancellationToken: cancellationToken).ConfigureAwait(false); return entities; } - - public async Task GetCountAsync(List p_filter , Guid branchId) { - return await _repository.GetCountByFilterAsync(branchId, p_filter); + return await _repository.GetCountByFilterAsync(branchId, p_filter).ConfigureAwait(false); } - - public virtual async Task> ImportAsync(List entities, string version,string customerCode) + public virtual async Task> ImportAsync(List entities, string version, string customerCode) { List _errorList = new List(); //写校验在这里 + await _repository.GetDbContext().BulkInsertAsync(entities).ConfigureAwait(false); - await _repository.GetDbContext().BulkInsertAsync(entities); - - List _versionList = new List() { new MaterialRelationshipVersion(GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(),version,customerCode ,customerCode) }; - await _versionRepository.GetDbContext().BulkInsertAsync(_versionList); - - - + List _versionList = new List() { new MaterialRelationshipVersion(GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), version, customerCode, customerCode) }; + await _versionRepository.GetDbContext().BulkInsertAsync(_versionList).ConfigureAwait(false); return _errorList; } - public virtual async Task CreateAsync(MaterialRelationshipDetail input) { var entity = new MaterialRelationshipDetail( - GuidGenerator.Create(), GuidGenerator.Create(), input.Version, input.CustomerCode, input.ErpMaterialCode, input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode, input.AppraisalCategory,input.Qty); - + GuidGenerator.Create(), GuidGenerator.Create(), input.Version, input.CustomerCode, input.ErpMaterialCode, input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode, input.AppraisalCategory, input.Qty); - return await _repository.InsertAsync(entity); + return await _repository.InsertAsync(entity).ConfigureAwait(false); } - public virtual async Task UpdateAsync(Guid id, MaterialRelationshipDetail input) { - var entity = await _repository.GetAsync(id); + var entity = await _repository.GetAsync(id).ConfigureAwait(false); entity.Update(input.MaterialDesc, input.MaterialProperty, input.SettleMaterialCode, input.ShipMaterailCode ); - return await _repository.UpdateAsync(entity); + return await _repository.UpdateAsync(entity).ConfigureAwait(false); } - public virtual async Task DeleteAsync(Guid id) { - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } - public virtual async Task DeleteListAsync(List ids) { - return await _repository.DeleteListAsync(ids); + return await _repository.DeleteListAsync(ids).ConfigureAwait(false); } - public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId); + var entities = await _repository.GetAllAsync(branchId).ConfigureAwait(false); return entities; } } - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipVersion.cs index 3aef7317..c14b55b4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/MaterialRelationships/MaterialRelationshipVersion.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships { - public class MaterialRelationshipVersion:FullAuditedAggregateRootBase, ISettleAccountEntityBase + public class MaterialRelationshipVersion : FullAuditedAggregateRootBase, ISettleAccountEntityBase { public MaterialRelationshipVersion() { } @@ -33,16 +29,15 @@ namespace Win.Sfs.SettleAccount.Entities.MaterialRelationships public string Factory { private set; get; } public MaterialRelationshipVersion( Guid id, - - string year, string period, string version, string customerCode,string factory) : base(id) + + string year, string period, string version, string customerCode, string factory) : base(id) { - + Year = year; Period = period; Version = version; CustomerCode = customerCode; Factory = factory; - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs index 003fbf30..85ee1525 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Materials/Material.cs @@ -1,13 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Materials { - public class Material :FullAuditedAggregateRootBase + public class Material : FullAuditedAggregateRootBase { /// ///工厂 @@ -21,7 +17,9 @@ namespace Win.Sfs.SettleAccount.Entities.Materials ///物料描述 /// - public string MaterialDesc { set; get; + public string MaterialDesc + { + set; get; } /// /// 基础单位 @@ -38,8 +36,6 @@ namespace Win.Sfs.SettleAccount.Entities.Materials /// public string EstimateTypeDesc { set; get; } - - public string CustomerPartCode { set; get; } public void SetId(Guid id, Guid branchId) { @@ -47,12 +43,9 @@ namespace Win.Sfs.SettleAccount.Entities.Materials Id = id; BranchId = branchId; - - } - - public void Update(string materialDesc, string unit, string estimatType, string estimateTypeDesc,string factory) + public void Update(string materialDesc, string unit, string estimatType, string estimateTypeDesc, string factory) { MaterialDesc = materialDesc; Unit = unit; @@ -61,13 +54,12 @@ namespace Win.Sfs.SettleAccount.Entities.Materials Factory = factory; } - public Material() { } public Material( 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; @@ -76,7 +68,7 @@ namespace Win.Sfs.SettleAccount.Entities.Materials Unit = unit; EstimateType = estimateType; EstimateTypeDesc = estimateTypeDesc; - + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prebatches/Prebatch.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prebatches/Prebatch.cs index 78617372..24bb9215 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prebatches/Prebatch.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prebatches/Prebatch.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.Prebatches { @@ -16,13 +10,11 @@ namespace Win.Sfs.SettleAccount.Prebatches /// public string KENNCode { private set; get; } - /// /// 状态 /// public int State { private set; get; } - /// /// 车型 /// @@ -44,10 +36,8 @@ namespace Win.Sfs.SettleAccount.Prebatches Id = id; BranchId = branchId; - - } - public void Update(string remark, int state, string carcode, string yearkenncode,string year) + public void Update(string remark, int state, string carcode, string yearkenncode, string year) { State = state; Remark = remark; @@ -61,7 +51,7 @@ namespace Win.Sfs.SettleAccount.Prebatches public Prebatch( Guid id, Guid branchId, - string kENNCode, + string kENNCode, int state, string carcode, string yearkenncode, diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs index 829f717d..04cddaf7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceList.cs @@ -1,12 +1,6 @@ using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Diagnostics.Contracts; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Entities.Auditing; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Prices { @@ -14,8 +8,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices { public string SapErpPartCode { set; get; } - - public decimal SapPrice { set; get; } } @@ -111,10 +103,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices [Display(Name = "是否作废")] public bool IsCancel { get; set; } - - - - /// /// 业务类别 /// @@ -127,8 +115,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices [Display(Name = "版本")] public string Version { set; get; } - - [Display(Name = "客户")] public string CustomerCode { get; set; } @@ -246,10 +232,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices [Display(Name = "是否作废")] public bool IsCancel { get; set; } - - - - [Display(Name = "客户")] public string CustomerCode { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs index 155c7d60..1e9f3365 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Prices/PriceListVersion.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.Prices @@ -23,13 +18,12 @@ namespace Win.Sfs.SettleAccount.Entities.Prices public string Version { get; set; } public string Factory { private set; get; } - public PriceListVersion( Guid id, string year, string period, string version) : base(id) + public PriceListVersion(Guid id, string year, string period, string version) : base(id) { Year = year; Period = period; Version = version; - } } @@ -55,7 +49,6 @@ namespace Win.Sfs.SettleAccount.Entities.Prices Period = period; Version = version; - } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchBase.cs index ef90435c..06b91be9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchBase.cs @@ -1,19 +1,15 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SecMatch { - - public class SecMatchBase: FullAuditedAggregateRootBase + + public class SecMatchBase : FullAuditedAggregateRootBase { public SecMatchBase() { } - public SecMatchBase(Guid id,string version, string index, string factory, string model, string partType, string settleMentPartCode, string materialPartCode, string materialDesc, string supplierCode, string supplierName, decimal usedNumber, decimal supplyProportion, string buyer, decimal price, decimal settlementPrice, decimal diffPrice, decimal settlementNumber, decimal theoreticalSettlementNumber, decimal realSettlementNumber, decimal realSettlementPrice, bool isDiffNumber, decimal diffAmount, string remark,string isSettle):base(id) + public SecMatchBase(Guid id, string version, string index, string factory, string model, string partType, string settleMentPartCode, string materialPartCode, string materialDesc, string supplierCode, string supplierName, decimal usedNumber, decimal supplyProportion, string buyer, decimal price, decimal settlementPrice, decimal diffPrice, decimal settlementNumber, decimal theoreticalSettlementNumber, decimal realSettlementNumber, decimal realSettlementPrice, bool isDiffNumber, decimal diffAmount, string remark, string isSettle) : base(id) { //RowId = rowid; Version = version; @@ -68,10 +64,8 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch DiffAmount = diffAmount; Remark = remark; - } - /// /// 版本 /// @@ -79,7 +73,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch //public int RowId { set; get; } - /// /// 版本 /// @@ -139,7 +132,6 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch public string SupplierName { get; set; } //供应商代码 - /// /// BOM用量 /// @@ -198,7 +190,7 @@ namespace Win.Sfs.SettleAccount.Entities.SecMatch /// 是否量差 /// [Display(Name = "是否量差")] - public bool IsDiffNumber { set; get; } + public bool IsDiffNumber { set; get; } /// /// 差异金额 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchSummary.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchSummary.cs index c9eb738d..c75397d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchSummary.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SecMatch/SecMatchSummary.cs @@ -1,16 +1,10 @@ -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.SettleAccount.Entities.SecMatch { public class SecMatchSummary { - [Display(Name = "序号")] public string RowId { set; get; } [Display(Name = "工厂代码")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountDomain/ShippingData1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountDomain/ShippingData1.cs index f05d0906..ac811f6f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountDomain/ShippingData1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountDomain/ShippingData1.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.Shared.Enums.SettleAccount; +using System; namespace Win.Sfs.SettleAccount.Entities.SettleAccountDomain { @@ -44,13 +39,10 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccountDomain public string Extend3 { set; get; } public string Extend4 { set; get; } - - - /// /// 用量 /// - public decimal Qty { set; get; } + public decimal Qty { set; get; } /// /// 状态 @@ -140,8 +132,4 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccountDomain } - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs index 95e7a3da..2b421aac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccountEntityBase.cs @@ -1,8 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccount.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccount.cs index 61062ce2..2e87c9b5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccount.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccount.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts @@ -10,10 +6,9 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// /// 大众准时化结算明细导入 /// - public class SettleAccount: FullAuditedAggregateRootBase, ISettleAccountEntityBase + public class SettleAccount : FullAuditedAggregateRootBase, ISettleAccountEntityBase { - /// ///年度 /// @@ -24,8 +19,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// public string Period { set; get; } - - /// /// 年份 /// @@ -70,11 +63,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// public string SettlementSupplier { get; protected set; } - - public Guid ParentId { get; protected set; } - public int state { get; set; } /// @@ -95,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts public SettleAccount( Guid id, Guid branchId, - string year, string kENNCode, string chassisNumber, string model, DateTime cP5A, DateTime cP7, string materialCode, decimal qty, string settlementID, string settlementSupplier, string period,string settleYear, Guid parentId,string version , DateTime creationTime, Guid guid) :base(id) + string year, string kENNCode, string chassisNumber, string model, DateTime cP5A, DateTime cP7, string materialCode, decimal qty, string settlementID, string settlementSupplier, string period, string settleYear, Guid parentId, string version, DateTime creationTime, Guid guid) : base(id) { BranchId = branchId; Year = year; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountManager.cs index 9d0780c4..08673bb8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountManager.cs @@ -1,34 +1,22 @@ -using EFCore.BulkExtensions; using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - public class SettleAccountManager:DomainService + public class SettleAccountManager : DomainService { private readonly ISettleAccountBranchEfCoreRepository _repository; private readonly ISettleAccountBranchEfCoreRepository _versionRepository; public SettleAccountManager( ISettleAccountBranchEfCoreRepository repository, ISettleAccountBranchEfCoreRepository versionRepository - - + ) { _versionRepository = versionRepository; _repository = repository; - } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountVersion.cs index 896f2df0..87645088 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettleAccounts/SettleAccountVersion.cs @@ -1,17 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Guids; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SettleAccounts { - - public class SettleAccountVersion : FullAuditedAggregateRootBase,ISettleAccountEntityBase + + public class SettleAccountVersion : FullAuditedAggregateRootBase, ISettleAccountEntityBase { public SettleAccountVersion() @@ -25,19 +18,18 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts /// /// 版本号 /// - public string Version { get; set; } + public string Version { get; set; } /// /// 客户号 /// public string CustomerCode { private set; get; } - public string Factory { private set; get; } public SettleAccountVersion( Guid id, Guid branchId, - string year, string period, string version, string customerCode,string factory) : base(id) + string year, string period, string version, string customerCode, string factory) : base(id) { BranchId = branchId; Year = year; @@ -45,9 +37,8 @@ namespace Win.Sfs.SettleAccount.Entities.SettleAccounts Version = version; CustomerCode = customerCode; Factory = factory; - - } + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPart.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPart.cs index b885cb26..a37cdd3e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPart.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPart.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - using Win.Sfs.Shared.Constant; +using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts { @@ -23,15 +22,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "期间")] public string Period { set; get; } - - /// /// 用户代码 /// [Display(Name = "用户代码")] public string CustomerCode { get; set; } - /// /// 工厂 /// @@ -44,7 +40,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "车型")] public string Model { set; get; } - /// /// 版本 /// @@ -55,7 +50,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Required(ErrorMessage = "{0}是必填项")] public string SettlementPartCode { get; set; } - [Display(Name = "结算件描述")] [MaxLength(CommonConsts.MaxDescriptionLength, ErrorMessage = "{0}最多输入{1}个字符")] public string SettlementPartDesc { get; set; } @@ -66,16 +60,12 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts [Display(Name = "计量单位")] public string Uom { get; set; } - - - - public SettlementPart() { } public SettlementPart(Guid id, - Guid branchId, string year, string period, string customerCode, string factory, string model, string version, string settlementPartCode, string settlementPartDesc, decimal price, string uom):base(id) + Guid branchId, string year, string period, string customerCode, string factory, string model, string version, string settlementPartCode, string settlementPartDesc, decimal price, string uom) : base(id) { Year = year; Period = period; @@ -138,7 +128,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts Enabled = enabled; } - public void SetFactory( string factory) { @@ -152,4 +141,4 @@ string model) Model = model; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPartVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPartVersion.cs index 5be7df07..34a893a6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPartVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SettlementParts/SettlementPartVersion.cs @@ -1,12 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Guids; -using Win.Sfs.SettleAccount.Boms; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.SettlementParts @@ -27,7 +19,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts /// public string Version { get; private set; } - /// /// 工厂 /// @@ -38,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts /// public string CustomerCode { private set; get; } - public SettlementPartVersion( Guid id, Guid branchId, @@ -53,6 +43,5 @@ namespace Win.Sfs.SettleAccount.Entities.SettlementParts } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Settlements/Settlement.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Settlements/Settlement.cs index 411141f9..17a42c59 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Settlements/Settlement.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Settlements/Settlement.cs @@ -1,7 +1,7 @@ -//using System; +//using System; //using System.ComponentModel.DataAnnotations; //using Win.Sfs.Shared.DomainBase; - + //using Win.Sfs.Shared.Constant; //namespace Win.Sfs.SettleAccount.FisDelivers @@ -29,24 +29,17 @@ // [Required(ErrorMessage = "{0}是必填项")] // public decimal Qty { get; set; } - - - // [Display(Name = "结算时间")] // public DateTime AccountTime { get; set; } - - // [Display(Name = "导入时间")] // public DateTime ImportTime { get; set; } // [Display(Name = "操作人")] // public string ImportPerson { get; set; } - // [Display(Name = "客户")] // public string CustomCode { get; set; } - // protected Settlement() // { @@ -73,19 +66,19 @@ // Qty = qty; // AccountTime = accountTime; - + // CustomCode = customCode; // ImportTime = importTime; // ImportPerson = importPerson; - + // } // public void Set( - + // bool enabled // ) // { // Enabled = enabled; // } // } -//} \ No newline at end of file +//} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/StorageLocations/CustomerStorageLocation.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/StorageLocations/CustomerStorageLocation.cs index 8f1cc5a3..ed7dd27c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/StorageLocations/CustomerStorageLocation.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/StorageLocations/CustomerStorageLocation.cs @@ -1,38 +1,27 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.StorageLocations { public class CustomerStorageLocation : FullAuditedAggregateRootBase - + { /// /// 客户代码 /// - public string CustomerCode { set; get; } + public string CustomerCode { set; get; } /// /// 客户描述 /// public string CustomerDesc { set; get; } - - - public string Storagelocation + public string Storagelocation { - get ; set; + get; set; } - - - public int State { set; get; } - - + public int State { set; get; } public void SetValue(Guid id, Guid branchId) { @@ -40,10 +29,8 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations Id = id; BranchId = branchId; - - } - public void Update(string customerDesc, string storagelocation,int state) + public void Update(string customerDesc, string storagelocation, int state) { CustomerDesc = customerDesc; @@ -51,23 +38,21 @@ namespace Win.Sfs.SettleAccount.Entities.StorageLocations State = state; - - } public CustomerStorageLocation( Guid id, Guid branchId, - string customerCode, string customerDesc, string storagelocation,int state):base(id) + string customerCode, string customerDesc, string storagelocation, int state) : base(id) { BranchId = branchId; CustomerCode = customerCode; CustomerDesc = customerDesc; - + Storagelocation = storagelocation; State = state; - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SupplierItemSetUps/SupplierItemSetUp.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SupplierItemSetUps/SupplierItemSetUp.cs index 72fef2ab..de6ddbfb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SupplierItemSetUps/SupplierItemSetUp.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/SupplierItemSetUps/SupplierItemSetUp.cs @@ -1,24 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.SupplierItemSetUps { public class SupplierItemSetUp : FullAuditedAggregateRootBase - { + { /// /// ERP物料号 /// - public string ErpItemCode { set; get; } + public string ErpItemCode { set; get; } /// /// 供应商代码 /// public string CustomerSupplierCode { get; set; } - /// /// 供应商代码 /// @@ -29,18 +24,13 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps /// public string CustomerCode { get; set; } - public void SetValue(Guid id, Guid branchId) { Id = id; BranchId = branchId; } - - - - - public void Update( string customerSupplierCode,string erpSupplierCode,string erpItemCode,string customerCode) + public void Update(string customerSupplierCode, string erpSupplierCode, string erpItemCode, string customerCode) { ErpSupplierCode = erpSupplierCode; CustomerSupplierCode = customerSupplierCode; @@ -48,8 +38,6 @@ namespace Win.Sfs.SettleAccount.SupplierItemSetUps CustomerCode = customerCode; } - - public void SetValue(string supplierCode) { CustomerSupplierCode = supplierCode; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/Supplier.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/Supplier.cs index a5e0ca15..c6c7ec24 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/Supplier.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/Supplier.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - using Win.Sfs.Shared.Constant; +using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Suppliers { @@ -16,7 +15,8 @@ namespace Win.Sfs.SettleAccount.Suppliers } public Supplier(Guid id, Guid branchId, string code, string name, string description, string address, string contact, string contactPhone, string contactEmail, string contactFax, decimal? taxRate, Guid? currencyId, int? supplierType, decimal? invoiceLimit) - :base(id){ + : base(id) + { BranchId = branchId; Code = code ?? throw new ArgumentNullException(nameof(code)); Name = name ?? throw new ArgumentNullException(nameof(name)); @@ -32,9 +32,9 @@ namespace Win.Sfs.SettleAccount.Suppliers InvoiceLimit = invoiceLimit; } - public void Set( string name, string description, string address, string contact, string contactPhone, string contactEmail, string contactFax, decimal? taxRate, Guid? currencyId, int? supplierType, decimal? invoiceLimit,bool enable) + public void Set(string name, string description, string address, string contact, string contactPhone, string contactEmail, string contactFax, decimal? taxRate, Guid? currencyId, int? supplierType, decimal? invoiceLimit, bool enable) { - + Name = name ?? throw new ArgumentNullException(nameof(name)); Description = description ?? throw new ArgumentNullException(nameof(description)); Address = address ?? throw new ArgumentNullException(nameof(address)); @@ -54,7 +54,7 @@ namespace Win.Sfs.SettleAccount.Suppliers /// [Display(Name = "供应商代码")] [Required(ErrorMessage = "{0}是必填项")] - + [StringLength(CommonConsts.MaxCodeLength, ErrorMessage = "{0}最多输入{1}个字符")] public string Code { get; internal set; } /// @@ -120,13 +120,6 @@ namespace Win.Sfs.SettleAccount.Suppliers /// [Display(Name = "开票限额")] public decimal? InvoiceLimit { get; internal set; } - - - - - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/SupplierApply.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/SupplierApply.cs index 4a428f5a..5d1580c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/SupplierApply.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/Suppliers/SupplierApply.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; namespace Win.Sfs.SettleAccount.Items { @@ -11,7 +9,6 @@ namespace Win.Sfs.SettleAccount.Items /// public class SupplierApply : BranchAggregateRootBase { - [Display(Name = "主物品Id")] [Required(ErrorMessage = "{0}是必填项")] @@ -20,59 +17,54 @@ namespace Win.Sfs.SettleAccount.Items [Display(Name = "子物品Id")] [Required(ErrorMessage = "{0}是必填项")] public string ChildItemCode { get; set; } - [Display(Name = "供应商")] [Required(ErrorMessage = "{0}是必填项")] public string SupplierCode { get; set; } - [Display(Name = "供货比例")] + [Display(Name = "供货比例")] public decimal ApplyPercent { get; set; } - - [Display(Name = "生效时间")] public DateTime EffectiveTime { get; set; } [Display(Name = "失效时间")] public DateTime ExpireTime { get; set; } - - protected SupplierApply() { } public SupplierApply( Guid id, - Guid branchId, + Guid branchId, string parentItemCode, string childItemCode, string supplierCode, - decimal applyPercent, - + decimal applyPercent, + DateTime effectiveTime, - DateTime expireTime - + DateTime expireTime + ) : base(id) { Id = id; - BranchId = branchId; + BranchId = branchId; ParentItemCode = parentItemCode; ChildItemCode = childItemCode; SupplierCode = supplierCode; - ApplyPercent = applyPercent; + ApplyPercent = applyPercent; EffectiveTime = effectiveTime; - ExpireTime = expireTime; + ExpireTime = expireTime; } - public void Set( - string supplierCode, + public void Set( + string supplierCode, decimal applyPercent, DateTime effectiveTime, DateTime expireTime, bool enabled) { - + SupplierCode = supplierCode; ApplyPercent = applyPercent; EffectiveTime = effectiveTime; @@ -80,4 +72,4 @@ namespace Win.Sfs.SettleAccount.Items Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/Job.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/Job.cs index 3bb8a824..705aedc9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/Job.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/Job.cs @@ -1,15 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Entities; +using System; namespace Win.Sfs.SettleAccount.Entities { public class Job { - public Job(Guid id, long stateId, string stateName, string invocationData, string arguments, DateTime createdAt, DateTime? expireAt, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string downFileName, string realDownFileName, string serviceName,string type,string remark) + public Job(Guid id, long stateId, string stateName, string invocationData, string arguments, DateTime createdAt, DateTime? expireAt, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string downFileName, string realDownFileName, string serviceName, string type, string remark) { Id = id; StateId = stateId; @@ -35,10 +30,6 @@ namespace Win.Sfs.SettleAccount.Entities public Job() { } - - - - //public Job(Guid id, long stateId, string stateName, string invocationData, string arguments, DateTime createdAt, DateTime? expireAt, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string downFileName, string realDownFileName, string serviceName) //{ // Id = id; @@ -62,9 +53,6 @@ namespace Win.Sfs.SettleAccount.Entities // ServiceName = serviceName; //} - - - /// /// ID /// @@ -121,19 +109,16 @@ namespace Win.Sfs.SettleAccount.Entities /// public string FileName { set; get; } - /// /// 上传文件名称(链接) /// public string RealFileName { set; get; } - /// /// 下载文件名称(链接) /// public string DownFileName { set; get; } - /// /// 真实下载文件名称(链接) /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TEA_TASK_SUB.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TEA_TASK_SUB.cs index 4463e931..a5960492 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TEA_TASK_SUB.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TEA_TASK_SUB.cs @@ -3,51 +3,47 @@ using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Collections.Generic; - namespace Win.Sfs.SettleAccount.Entities { /// - /// ı + /// 任务订阅表 /// - [Description("ı")] + [Description("任务订阅表")] public class TEA_TASK_SUB { - [Description("״̬")] + [Description("任务状态")] public int TaskState { get; set; } - - [Description("")] + [Description("任务编号")] public Guid TaskID { get; set; } - [Description("")] + [Description("表格名称")] [StringLength(50)] public string TableName { get; set; } - [Description("")] + [Description("创建者")] [StringLength(50)] public string Creator { get; set; } - [Description("")] + [Description("数据行数")] public int DataCount { get; set; } - - [Description("")] + [Description("订阅者")] [StringLength(50)] public string Subscriber { get; set; } - [Description("ʧ")] + [Description("失败行数")] public int FailedCount { get; set; } - [Description("ʧϢ")] + [Description("失败信息")] [StringLength(50)] public string FailedInfo { get; set; } - [Description("")] + [Description("域")] [StringLength(50)] public string Domain { get; set; } - [Description("ص")] + [Description("地点")] [StringLength(50)] public string Site { get; set; } @@ -57,22 +53,22 @@ namespace Win.Sfs.SettleAccount.Entities [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int UID { get; set; } - [Description("")] + [Description("创建人")] [StringLength(50)] public string CreateUser { get; set; } - [Description("ʱ")] + [Description("创建时间")] public DateTime CreateTime { get; set; } - [Description("ע")] + [Description("备注")] public string Remark { get; set; } - [Description("޸")] + [Description("修改人")] [StringLength(50)] public string UpdateUser { get; set; } - [Description("޸ʱ")] + [Description("修改时间")] public DateTime? UpdateTime { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJob.cs index 9c070862..60fc1326 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJob.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.Domain.Entities.Auditing; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities @@ -13,8 +8,7 @@ namespace Win.Sfs.SettleAccount.Entities { public TaskJob() { } - - public TaskJob(Guid id, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string realDownFileName, string downFileName, string serviceName,string type,string remark) : base(id) + public TaskJob(Guid id, string taskId, string name, string actionName, string error, string creator, string email, string fileName, string realFileName, string realDownFileName, string downFileName, string serviceName, string type, string remark) : base(id) { TaskId = taskId; Name = name; @@ -31,7 +25,6 @@ namespace Win.Sfs.SettleAccount.Entities Remark = remark; } - public void SetError(string errorfileName) { Error = errorfileName; @@ -42,10 +35,9 @@ namespace Win.Sfs.SettleAccount.Entities } public void SetRemark(string remark) { - Remark = remark; + Remark = remark; } - public string Type { set; get; } public string State { set; get; } @@ -55,35 +47,32 @@ namespace Win.Sfs.SettleAccount.Entities } [Display(Name = "任务名称")] [StringLength(50)] - - public string TaskId { set; get; } + public string TaskId { set; get; } [Display(Name = "任务名称")] [StringLength(50)] - + public string Name { set; get; } [Display(Name = "操作名称")] [StringLength(50)] - - public string ActionName { set; get; } + + public string ActionName { set; get; } public string Error { set; get; } - [Display(Name="创建人")] + [Display(Name = "创建人")] [StringLength(50)] - - public string Creator{set;get;} - [Display(Name="电子邮件")] + + public string Creator { set; get; } + [Display(Name = "电子邮件")] [StringLength(50)] - - public string Email { set; get; } + public string Email { set; get; } [Display(Name = "上传文件")] [StringLength(200)] - - public string FileName { set; get; } + public string FileName { set; get; } /// /// 真实上传文件名称(链接) @@ -93,8 +82,6 @@ namespace Win.Sfs.SettleAccount.Entities public string RealFileName { set; get; } - - /// /// 真实下载文件名称(链接) /// @@ -103,17 +90,14 @@ namespace Win.Sfs.SettleAccount.Entities public string RealDownFileName { set; get; } - - [Display(Name = "下载文件")] [StringLength(200)] public string DownFileName { set; get; } - [Display(Name = "执行服务")] [StringLength(300)] - + public string ServiceName { set; get; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs index 235dd152..944132ab 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/TaskJobs/TaskJobManager.cs @@ -1,56 +1,45 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Guids; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Prebatches; -using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.Enums.SettleAccount; using Win.Sfs.Shared.Filter; namespace Win.Sfs.SettleAccount.Entities { public class TaskJobManager : DomainService { - private readonly ISettleAccountBranchEfCoreRepository _repository; protected TaskJobManager() { } public TaskJobManager( - + ISettleAccountBranchEfCoreRepository repository - + ) { - + _repository = repository; } public virtual async Task GetAsync(Guid id) { - - var job =await _repository.GetAsync(id); + var job = await _repository.GetAsync(id).ConfigureAwait(false); return job; } - public virtual Task GetAsync(string taskid) + public virtual Task GetAsync(string taskid) { - - var job = _repository.Where(p=>p.TaskId==taskid).FirstOrDefaultAsync(); + var job = _repository.Where(p => p.TaskId == taskid).FirstOrDefaultAsync(); return job; } - public virtual async Task> GetListAsync( Guid branchId, List filters, @@ -60,95 +49,73 @@ namespace Win.Sfs.SettleAccount.Entities bool includeDetails = false, CancellationToken cancellationToken = default) { - var entities = await _repository.GetListByFilterAsync(branchId, filters, sorting, maxResultCount, - skipCount); + var entities = await _repository.GetListByFilterAsync(branchId, filters, sorting, maxResultCount, skipCount, cancellationToken: cancellationToken).ConfigureAwait(false); return entities; } public virtual async Task> GetVersionListAsync() { - var entities = await _repository.Where(p=> !string.IsNullOrEmpty(p.Type)).Select(p => p.Type ).Distinct().ToListAsync(); + var entities = await _repository.Where(p => !string.IsNullOrEmpty(p.Type)).Select(p => p.Type).Distinct().ToListAsync().ConfigureAwait(false); return entities; } - - private async Task GetCountAsync(List p_filter - , Guid branchId) - { - return await _repository.GetCountByFilterAsync(branchId, p_filter); - } - - - - - public virtual async Task CreateAsync(TaskJob input) { var entity = - new TaskJob(input.Id, input.TaskId, input.Name, input.ActionName, input.Error, input.Creator, input.Email, input.FileName, input.RealFileName, input.RealDownFileName, input.DownFileName, input.ServiceName,input.Type,input.Remark ); - await _repository.InsertAsync( entity ,true); + new TaskJob(input.Id, input.TaskId, input.Name, input.ActionName, input.Error, input.Creator, input.Email, input.FileName, input.RealFileName, input.RealDownFileName, input.DownFileName, input.ServiceName, input.Type, input.Remark); + await _repository.InsertAsync(entity, true).ConfigureAwait(false); - return _repository.FirstOrDefault(p => p.Id == input.Id); - + return _repository.FirstOrDefault(p => p.Id == input.Id); } - public virtual async Task ChangeTaskIdAsync(Guid id, string taskid) { - var entity = await GetAsync(id); + var entity = await GetAsync(id).ConfigureAwait(false); entity.ChangeTaskId(taskid); - await _repository.GetDbContext().BulkUpdateAsync(new List() { entity }); + await _repository.GetDbContext().BulkUpdateAsync(new List() { entity }).ConfigureAwait(false); return _repository.FirstOrDefault(p => p.Id == id); ; } - public virtual async Task DeleteAsync(Guid id) { - await _repository.DeleteAsync(id); + await _repository.DeleteAsync(id).ConfigureAwait(false); } - public virtual async Task DeleteListAsync(List ids) { - - var _ls= _repository.Where(p => ids.Contains(p.Id)); - int _count=await _ls.BatchDeleteAsync(); - return true; + var _ls = _repository.Where(p => ids.Contains(p.Id)); + int _count = await _ls.BatchDeleteAsync().ConfigureAwait(false); + return true; } - public virtual async Task GetTotalCountAsync(Guid branchId) { - return await _repository.GetCountAsync(branchId); + return await _repository.GetCountAsync(branchId).ConfigureAwait(false); } public virtual async Task> GetAllAsync(Guid branchId) { - var entities = await _repository.GetAllAsync(branchId); + var entities = await _repository.GetAllAsync(branchId).ConfigureAwait(false); return entities; } - - public virtual async Task UpdateAsync(Guid p_id,string Remark) + public virtual async Task UpdateAsync(Guid p_id, string Remark) { - var entities=_repository.Where(p => p.Id == p_id); - if(entities!=null && entities.Count()>0) + var entities = _repository.Where(p => p.Id == p_id); + if (entities != null && entities.Any()) { - var entity =await entities.FirstOrDefaultAsync(); + var entity = await entities.FirstOrDefaultAsync().ConfigureAwait(false); entity.Remark = Remark; - await _repository.UpdateAsync(entity); + await _repository.UpdateAsync(entity).ConfigureAwait(false); } return true; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs index b87d1a01..b6187030 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccount.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts @@ -58,13 +54,10 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts Amt = amt; } - //验收单号 外部单号 物料凭证号 物料凭证日期 物料凭证记账日期 看板编号 外部看板编号 物料号 物料描述 数量 单价 金额 //工厂 备注 创建者 创建时间 修改人 修改时间 公司 验收单号 外部单号 发票号 会计年度 金额 计划员 存储地点 //存储地点描述 状态 验收单日期 供应商 录入人 录入人描述 看板号 - - /// ///工厂 /// @@ -107,7 +100,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts [Display(Name = "看板号")] public string HQHKanBan { set; get; } - /// /// 物料号 /// @@ -162,14 +154,11 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts [Display(Name = "金额")] public decimal Amt { set; get; } - /// /// 备注 /// [Display(Name = "备注")] public string Extend { set; get; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs index ec17ed97..9dfa88fa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnHQSettleAccounts/UnHQSettleAccountVersion.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts @@ -29,7 +25,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts /// public string CustomerCode { private set; get; } - public UnHQSettleAccountVersion( Guid id, Guid branchId, @@ -43,6 +38,5 @@ namespace Win.Sfs.SettleAccount.Entities.UnHQSettleAccounts } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs index c527c297..d8f7a726 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/UnSettle/UnSettleDetailReport.cs @@ -1,18 +1,13 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Entities.UnSettle { - - [ExcelExporter( MaxRowNumberOnASheet = 900000)] - public class UnSettleDetailReport:ReportDetailBase + [ExcelExporter(MaxRowNumberOnASheet = 900000)] + public class UnSettleDetailReport : ReportDetailBase { [ExporterHeader(DisplayName = "交货单号 ")] public override string WmsBillNum { set; get; } @@ -22,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle public override string KENNCode { set; get; } [ExporterHeader(DisplayName = "底盘号")] public override string ChassisNumber { set; get; } - [ExporterHeader(DisplayName = "交货状态",IsIgnore =true)] + [ExporterHeader(DisplayName = "交货状态", IsIgnore = true)] public override string WmsState { set; get; } [ExporterHeader(DisplayName = "物料号")] public override string SapMaterialCode { set; get; } @@ -40,9 +35,9 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle public override decimal Price { set; get; } [ExporterHeader(DisplayName = "金额 ")] public override decimal Amt { set; get; } - [ExporterHeader(DisplayName = "结算日期",IsIgnore =true)] + [ExporterHeader(DisplayName = "结算日期", IsIgnore = true)] public override DateTime CP7Time { set; get; } - [ExporterHeader(DisplayName = "开票单价",IsIgnore =true)] + [ExporterHeader(DisplayName = "开票单价", IsIgnore = true)] public override decimal InvoicePrice { set; get; } [ExporterHeader(DisplayName = "结算平台未结数量 ")] public decimal Qty { set; get; } @@ -64,14 +59,12 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle [ExporterHeader(DisplayName = "说明 ")] public string Remark { set; get; } - } [ExcelExporter(MaxRowNumberOnASheet = 900000)] public class UnSettleDetailReport1 : ReportDetailBase { - [ExporterHeader(DisplayName = "交货单号 ")] public override string WmsBillNum { set; get; } [ExporterHeader(DisplayName = "实际发货日期 ")] @@ -122,13 +115,6 @@ namespace Win.Sfs.SettleAccount.Entities.UnSettle [ExporterHeader(DisplayName = "说明 ")] public string Remark { set; get; } - } - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs index 8ae2ba75..f0f7ef4d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/WmsDetailReport.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Entities @@ -14,7 +10,7 @@ namespace Win.Sfs.SettleAccount.Entities { } - public WmsDetailReport(Guid id, int lineNumber, string client, string type, string settleCode, string saleCode, string clientCode, string billNum, string materialCode, string saleType, decimal qty, decimal outputQty, decimal diffQty, decimal price, decimal amt, decimal outPutAmt, decimal diffAmt, string materialGroupCode, string materialGroup, string materialDesc, string remark1, int state, string version,DateTime accountdate) : base(id) + public WmsDetailReport(Guid id, int lineNumber, string client, string type, string settleCode, string saleCode, string clientCode, string billNum, string materialCode, string saleType, decimal qty, decimal outputQty, decimal diffQty, decimal price, decimal amt, decimal outPutAmt, decimal diffAmt, string materialGroupCode, string materialGroup, string materialDesc, string remark1, int state, string version, DateTime accountdate) : base(id) { LineNumber = lineNumber; Client = client; @@ -47,7 +43,6 @@ namespace Win.Sfs.SettleAccount.Entities [Display(Name = "版本号")] public string Version { set; get; } - [Display(Name = "客户")] public string Client { set; get; } [Display(Name = "出库类型")] @@ -89,16 +84,9 @@ namespace Win.Sfs.SettleAccount.Entities [Display(Name = "状态")] public int State { set; get; } - [Display(Name ="过账日期")] + [Display(Name = "过账日期")] public DateTime AccountDate { set; get; } - - - - - - - } public class WmsDetailDiffReport : FullAuditedAggregateRootBase { @@ -106,7 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities { } - public WmsDetailDiffReport(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 WmsDetailDiffReport(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; @@ -253,11 +241,11 @@ namespace Win.Sfs.SettleAccount.Entities { } - 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) + 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; @@ -282,7 +270,6 @@ namespace Win.Sfs.SettleAccount.Entities [Display(Name = "结算金额")] public decimal Amt { set; get; } - [Display(Name = "行号")] public string LineNumber { set; get; } @@ -341,13 +328,10 @@ namespace Win.Sfs.SettleAccount.Entities public class WmsDetailWithCodeDto { - + public string cnumber { set; get; } - public string materialCode { set; get; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs index dadd788a..8601e6da 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBillState.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.SettleAccount { @@ -36,7 +31,7 @@ namespace Win.Sfs.SettleAccount public enum PDBillState { - + [Description("新建")] 新建 = 4, [Description("已扣减")] @@ -47,17 +42,6 @@ namespace Win.Sfs.SettleAccount 已提交反结 = 7 } - - - - - - - - - - - public enum InvoiceBillState { [Description("在用")] @@ -72,26 +56,15 @@ namespace Win.Sfs.SettleAccount public enum BusinessType { [Description("HBPO-JIS")] - HBPOJIS =1, + HBPOJIS = 1, [Description("BBAC-JIS")] - BBACJIS =2, + BBACJIS = 2, [Description("JIT")] - JIT =3, + JIT = 3, [Description("备件")] - 备件 =4, + 备件 = 4, [Description("印度件")] - 印度件 =5 + 印度件 = 5 } - - - - - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs index c22b0088..ff5c9828 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/EnumBusinessType.cs @@ -1,55 +1,56 @@ using System.ComponentModel.DataAnnotations; -namespace Win.Sfs.SettleAccount; - -/// -/// 业务类别 -/// -public enum EnumBusinessType +namespace Win.Sfs.SettleAccount { /// - /// 未定义 - /// - [Display(Name = "未定义")] - None = 0, - /// - /// JisBBAC - /// - [Display(Name = "JisBBAC")] - JisBBAC = 1, - /// - /// JisHBPO - /// - [Display(Name = "JisHBPO")] - JisHBPO = 2, - /// - /// 直供件BBAC - /// - [Display(Name = "直供件BBAC")] - ZhiGongJianBBAC = 3, - /// - /// 直供件HBPO - /// - [Display(Name = "直供件HBPO")] - ZhiGongJianHBPO = 4, - /// - /// 买单件BBAC - /// - [Display(Name = "买单件BBAC")] - MaiDanJianBBAC = 5, - /// - /// 买单件HBPO - /// - [Display(Name = "买单件HBPO")] - MaiDanJianHBPO = 6, - /// - /// 备件 - /// - [Display(Name = "备件")] - BeiJian = 7, - /// - /// 印度件 - /// - [Display(Name = "印度件")] - YinDuJian = 8 + /// 业务类别 + /// + public enum EnumBusinessType + { + /// + /// 未定义 + /// + [Display(Name = "未定义")] + None = 0, + /// + /// JisBBAC + /// + [Display(Name = "JisBBAC")] + JisBBAC = 1, + /// + /// JisHBPO + /// + [Display(Name = "JisHBPO")] + JisHBPO = 2, + /// + /// 直供件BBAC + /// + [Display(Name = "直供件BBAC")] + ZhiGongJianBBAC = 3, + /// + /// 直供件HBPO + /// + [Display(Name = "直供件HBPO")] + ZhiGongJianHBPO = 4, + /// + /// 买单件BBAC + /// + [Display(Name = "买单件BBAC")] + MaiDanJianBBAC = 5, + /// + /// 买单件HBPO + /// + [Display(Name = "买单件HBPO")] + MaiDanJianHBPO = 6, + /// + /// 备件 + /// + [Display(Name = "备件")] + BeiJian = 7, + /// + /// 印度件 + /// + [Display(Name = "印度件")] + YinDuJian = 8 + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ISettleAccountBranchEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ISettleAccountBranchEfCoreRepository.cs index d1a8a9e5..089ecf6d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ISettleAccountBranchEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ISettleAccountBranchEfCoreRepository.cs @@ -1,18 +1,11 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; +using System.Threading; using System.Threading.Tasks; - -using Win.Sfs.Shared.RepositoryBase; -using Volo.Abp.Domain.Entities; using Volo.Abp.DependencyInjection; -using System.Data.Common; -using System.Data; - -using System.Data.SqlClient; -using System.Threading; +using Volo.Abp.Domain.Entities; using Win.Sfs.Shared.Filter; +using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount { @@ -20,42 +13,38 @@ namespace Win.Sfs.SettleAccount public interface ISettleAccountBranchEfCoreRepository : IBranchEfCoreRepository where TEntity : class, Shared.IBranch, IEntity - { + { Task GetPropertyValueAsync(Func> factory, string propertyName); Task GetPropertyValueAsync(Func> factory, IEnumerable propertyNames, char separator); - - - } public interface ISettleAccountBQEfCoreRepository : IWinEfCoreRepository , ITransientDependency where TEntity : class, IEntity - + { Task GetPropertyValueAsync(Func> factory, string propertyName); Task GetPropertyValueAsync(Func> factory, IEnumerable propertyNames, char separator); Task> GetAllAsync( - + bool includeDetails = false, CancellationToken cancellationToken = default); Task GetCountAsync( - + CancellationToken cancellationToken = default); Task GetCountByFilterAsync( - + List filters, CancellationToken cancellationToken = default); - Task> GetListByFilterAsync( - + List filters, string sorting = null, int maxResultCount = int.MaxValue, @@ -63,16 +52,6 @@ namespace Win.Sfs.SettleAccount bool includeDetails = false, CancellationToken cancellationToken = default); - - } - - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/MyFileContainer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/MyFileContainer.cs index ccc5ff29..ff82a069 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/MyFileContainer.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/MyFileContainer.cs @@ -1,11 +1,6 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.BlobStoring; namespace Win.Sfs.BaseData.ImportExcelCommon diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecBTSummaryFileConrainer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecBTSummaryFileConrainer.cs index 3447a704..d45bbf54 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecBTSummaryFileConrainer.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecBTSummaryFileConrainer.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.BlobStoring; namespace Win.Sfs.SettleAccount.ImportExcelCommon diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecSummaryFileConrainer.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecSummaryFileConrainer.cs index 9dce6068..091e79d8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecSummaryFileConrainer.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/ImportExcelCommon/SecSummaryFileConrainer.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.BlobStoring; namespace Win.Sfs.SettleAccount.ImportExcelCommon diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReport.cs index 92e3b718..40cc25d1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReport.cs @@ -1,14 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -18,13 +14,9 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports /// public class BTNotConsignReport : SettleAccountDocumentTimeRootBase { - - public virtual List BTNotConsignReportDetails { get; protected set; } - - protected BTNotConsignReport() { } public BTNotConsignReport(Guid id, Guid branchId, string documentNumber, DateTime beginTime, DateTime endTime, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, beginTime, endTime, customCode, customName, remark, creatorName) @@ -35,9 +27,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports BTNotConsignReportDetails = new List(); } - - - public void SetStatus(EnumDocumentStatus status) { DocumentStatus = status; @@ -48,7 +37,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, BTNotConsignReportDetail detail) { @@ -60,8 +48,8 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports // throw new Exception(detail.CustomItemCode + ":" + detail.CustomSubItemCode + "已经在明细中存在!"); //} - BTNotConsignReportDetails.Add(new BTNotConsignReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, - detail.OrderKBCode, detail.MaterialCode, detail.MaterialDesc, detail.NeedQty, detail.ConsignQty, detail.DeliveryDateTime, detail.State)); + BTNotConsignReportDetails.Add(new BTNotConsignReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, + detail.OrderKBCode, detail.MaterialCode, detail.MaterialDesc, detail.NeedQty, detail.ConsignQty, detail.DeliveryDateTime, detail.State)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -124,7 +112,7 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReportDetail.cs index 4cb74906..88395002 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignReportDetail.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -37,12 +35,10 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "状态")] public int State { get; set; } - protected BTNotConsignReportDetail() { } - public BTNotConsignReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string remark, bool enabled, - string customCode, string orderKBCode, string materialCode,string materialDesc, decimal needQty, decimal consignQty, DateTime deliveryDateTime, int state) : base(id) + string customCode, string orderKBCode, string materialCode, string materialDesc, decimal needQty, decimal consignQty, DateTime deliveryDateTime, int state) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -68,4 +64,4 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignSumReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignSumReport.cs index a00b8707..399823c1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignSumReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTNotConsignReports/BTNotConsignSumReport.cs @@ -1,8 +1,4 @@ -using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -15,7 +11,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports //public string CustomCode { get; set; } - [Display(Name = "物料号")] //[Required(ErrorMessage = "{0}是必填项")] public string MaterialCode { get; set; } @@ -26,7 +21,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "需求数量")] public decimal NeedQty { get; set; } - [Display(Name = "结算数量")] public decimal ConsignQty { get; set; } @@ -35,7 +29,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public BTNotConsignSumReport() { } - public BTNotConsignSumReport( string materialCode, string materialDesc, decimal needQty, decimal consignQty, decimal diffQty) { @@ -48,4 +41,4 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReport.cs index 0648aacd..eab6aa53 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReport.cs @@ -1,14 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { @@ -18,16 +14,12 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports /// public class BTSeqKBDiffReport : SettleAccountDocumentRootBase { - - public virtual List BTSeqKBDiffReportDetails { get; protected set; } - - protected BTSeqKBDiffReport() { } - public BTSeqKBDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public BTSeqKBDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -45,7 +37,6 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, BTSeqKBDiffReportDetail detail) { @@ -57,7 +48,7 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports // throw new Exception(detail.CustomItemCode + ":" + detail.CustomSubItemCode + "已经在明细中存在!"); //} - BTSeqKBDiffReportDetails.Add(new BTSeqKBDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, detail.DT, detail.MaterialCode, detail.SeqQty, detail.KBQty, detail.DiffQty)); + BTSeqKBDiffReportDetails.Add(new BTSeqKBDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, detail.DT, detail.MaterialCode, detail.SeqQty, detail.KBQty, detail.DiffQty)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -120,7 +111,7 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetail.cs index 9f6784c2..e076739a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTSeqKBDiffReports/BTSeqKBDiffReportDetail.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports { @@ -13,8 +12,7 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports /// [Display(Name = "客户代码")] - public string CustomCode { get; set; } - + public string CustomCode { get; set; } /// /// 日期 @@ -30,30 +28,25 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports [MaxLength(CommonConsts.MaxCodeLength)] public string MaterialCode { get; set; } - /// /// 车序数量 /// public decimal SeqQty { get; protected set; } - /// /// 看板数量 /// [Display(Name = "看板数量")] public decimal KBQty { get; protected set; } - /// /// 数量差异 /// [Display(Name = "数量差异")] public decimal DiffQty { get; protected set; } - protected BTSeqKBDiffReportDetail() { } - public BTSeqKBDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string remark, bool enabled, string customCode, DateTime dT, string materialCode, decimal seqQty, decimal kBQty, decimal diffQty) : base(id) { @@ -79,4 +72,4 @@ namespace Win.Sfs.SettleAccount.BTSeqKBDiffReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReport.cs index ea3b9e97..b28874b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports { @@ -19,16 +14,12 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// public class BTStockUnsettledDiffReport : SettleAccountDocumentRootBase { - - public virtual List BTStockUnsettledDiffReportDetails { get; protected set; } - - protected BTStockUnsettledDiffReport() { } - public BTStockUnsettledDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public BTStockUnsettledDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -46,13 +37,12 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, BTStockUnsettledDiffReportDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); Check.NotNull(detail, nameof(BTStockUnsettledDiffReportDetail)); - if (IsInDetails( detail.ItemCode)) + if (IsInDetails(detail.ItemCode)) { //to do 需要规范异常的处理逻辑 throw new Exception(detail.ItemCode + "已经在明细中存在!"); @@ -70,11 +60,9 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports } } - - public virtual bool IsInDetails(string itemCode) { - return BTStockUnsettledDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); + return BTStockUnsettledDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); } public virtual bool IsInDetails(Guid itemId) @@ -108,7 +96,7 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetail.cs index 15d2b132..2a0859e9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/BTStockUnsettledDiffReports/BTStockUnsettledDiffReportDetail.cs @@ -1,6 +1,5 @@ -using System; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports { @@ -22,16 +21,12 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports public string CustomCode { get; protected set; } - - /// /// 暂估类 /// public string EstimationType { get; protected set; } - - /// /// Fis未结数量 /// @@ -42,20 +37,14 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports /// public decimal StockQty { private set; get; } - - - /// /// 差异数量 /// public decimal DiffQty { private set; get; } - - protected BTStockUnsettledDiffReportDetail() { } - - public BTStockUnsettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string customCode, string estimationType, decimal fisUnSettledQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) + public BTStockUnsettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string customCode, string estimationType, decimal fisUnSettledQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -72,15 +61,13 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports EstimationType = estimationType; FisUnSettledQty = fisUnSettledQty; StockQty = stockQty; - + DiffQty = diffQty; Remark = remark; Enabled = enabled; } - - public void Set(string remark, bool enabled) { @@ -88,4 +75,4 @@ namespace Win.Sfs.SettleAccount.BTStockUnsettledDiffReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs index 22aabd1c..5f3da251 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/CommonManager.cs @@ -1,12 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Text.Json; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; using Win.Sfs.SettleAccount.Entities.Controls; using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.StorageLocations; @@ -22,7 +20,6 @@ namespace Win.Sfs.SettleAccount.CommonManagers public class CommonManager : DomainService, ICommonManager { - private readonly ISettleAccountBranchEfCoreRepository _customerStorageLocationRepository; private readonly ISettleAccountBranchEfCoreRepository _inventoryDetailRepository; private readonly ISettleAccountBranchEfCoreRepository _settleAccountRepository; @@ -65,7 +62,6 @@ namespace Win.Sfs.SettleAccount.CommonManagers return _centralizedControlRepository.GetDbSet().Where(p => p.Version == version && p.Enabled == true).FirstOrDefault(); } - /// /// 根据零件Code获取主单据信息 /// @@ -98,7 +94,6 @@ namespace Win.Sfs.SettleAccount.CommonManagers //清理下数据 input.Filters.Clear(); - //客户查询条件 FilterCondition customerFilter = new FilterCondition { Column = "CustomerCode", Value = input.CustomerCode }; @@ -108,7 +103,6 @@ namespace Win.Sfs.SettleAccount.CommonManagers //添加版本信息 input.Filters.Add(versionFilter); - var newCustomerStorageLocationFilter = new List() { customerFilter }; //客户库位的类型 if (customerLocationType != EnumCustomerLocationType.All) @@ -120,11 +114,10 @@ namespace Win.Sfs.SettleAccount.CommonManagers //2.获取现有库存信息 //2.1 获得客户的存储地点 - var customerStorageLocationEntitys = await _customerStorageLocationRepository.GetListByFilterAsync(input.BranchId, newCustomerStorageLocationFilter); + var customerStorageLocationEntitys = await _customerStorageLocationRepository.GetListByFilterAsync(input.BranchId, newCustomerStorageLocationFilter).ConfigureAwait(false); var customerStorageLocations = customerStorageLocationEntitys.Select(p => p.Storagelocation).ToList(); - string customerStorageLocationsJson = JsonSerializer.Serialize(customerStorageLocations); FilterCondition customerStorageLocationsFilter = new FilterCondition { Column = "StorageLocation", Value = customerStorageLocationsJson, Logic = EnumFilterLogic.And, Action = EnumFilterAction.In }; @@ -132,18 +125,16 @@ namespace Win.Sfs.SettleAccount.CommonManagers input.Filters.Add(customerStorageLocationsFilter); //客户库存数据 - var inventoryDetails = await _inventoryDetailRepository.GetListByFilterAsync(input.BranchId, input.Filters); + var inventoryDetails = await _inventoryDetailRepository.GetListByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); return inventoryDetails; } - public async Task> GetAllInventory(StatisticRequestDtoBase input, EnumCustomerLocationType customerLocationType = EnumCustomerLocationType.All) { //清理下数据 input.Filters.Clear(); - //客户查询条件 // FilterCondition customerFilter = new FilterCondition { Column = "CustomerCode", Value = input.CustomerCode }; @@ -153,8 +144,7 @@ namespace Win.Sfs.SettleAccount.CommonManagers //添加版本信息 input.Filters.Add(versionFilter); - - var newCustomerStorageLocationFilter = new List() { }; + var newCustomerStorageLocationFilter = new List() { }; //客户库位的类型 if (customerLocationType != EnumCustomerLocationType.All) { @@ -165,11 +155,10 @@ namespace Win.Sfs.SettleAccount.CommonManagers //2.获取现有库存信息 //2.1 获得客户的存储地点 - var customerStorageLocationEntitys = await _customerStorageLocationRepository.GetListByFilterAsync(input.BranchId, newCustomerStorageLocationFilter); + var customerStorageLocationEntitys = await _customerStorageLocationRepository.GetListByFilterAsync(input.BranchId, newCustomerStorageLocationFilter).ConfigureAwait(false); var customerStorageLocations = customerStorageLocationEntitys.Select(p => p.Storagelocation).ToList(); - string customerStorageLocationsJson = JsonSerializer.Serialize(customerStorageLocations); FilterCondition customerStorageLocationsFilter = new FilterCondition { Column = "StorageLocation", Value = customerStorageLocationsJson, Logic = EnumFilterLogic.And, Action = EnumFilterAction.In }; @@ -177,14 +166,11 @@ namespace Win.Sfs.SettleAccount.CommonManagers input.Filters.Add(customerStorageLocationsFilter); //客户库存数据 - var inventoryDetails = await _inventoryDetailRepository.GetListByFilterAsync(input.BranchId, input.Filters); + var inventoryDetails = await _inventoryDetailRepository.GetListByFilterAsync(input.BranchId, input.Filters).ConfigureAwait(false); - var details= inventoryDetails.Where(p => p.StorageLocation.ToUpper() == "JZPJCPA").ToList(); + var details = inventoryDetails.Where(p => p.StorageLocation.ToUpper() == "JZPJCPA").ToList(); return details; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/ICommonManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/ICommonManager.cs index 0d5ed913..77321c4c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/ICommonManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/CommonManagers/ICommonManager.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using System.Threading.Tasks; using Win.Sfs.SettleAccount.Entities.Controls; @@ -16,11 +15,9 @@ namespace Win.Sfs.SettleAccount.CommonManagers Task> GetAllInventory(StatisticRequestDtoBase input, EnumCustomerLocationType customerLocationType = EnumCustomerLocationType.All); - CentralizedControl GetVersionInfo(string version); - Material GetMaterialByCode(string materialCode); List GetMaterialListByCodes(List itemCodeList); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReport.cs index 336c907f..c64eaf22 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { @@ -18,16 +13,12 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports /// public class EstimatedStockDiffReport : SettleAccountDocumentRootBase { - - public virtual List EstimatedStockDiffReportDetails { get; protected set; } - - protected EstimatedStockDiffReport() { } - public EstimatedStockDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public EstimatedStockDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -45,19 +36,18 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, EstimatedStockDiffReportDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); Check.NotNull(detail, nameof(EstimatedStockDiffReportDetail)); - if (IsInDetails( detail.ItemCode)) + if (IsInDetails(detail.ItemCode)) { //to do 需要规范异常的处理逻辑 throw new Exception(detail.ItemCode + "已经在明细中存在!"); } - EstimatedStockDiffReportDetails.Add(new EstimatedStockDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.ItemCode, detail.ItemDesc, detail.EstimationType, detail.EstimationTypeDesc, detail.EstimationQty, detail.StockQty, detail.FgQty, detail.UnSettledQty, detail.DiffQty, detail.Remark, detail.Enabled)); + EstimatedStockDiffReportDetails.Add(new EstimatedStockDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.ItemCode, detail.ItemDesc, detail.EstimationType, detail.EstimationTypeDesc, detail.EstimationQty, detail.StockQty, detail.FgQty, detail.UnSettledQty, detail.DiffQty, detail.Remark, detail.Enabled)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -86,7 +76,7 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports public virtual bool IsInDetails(string itemCode) { - return EstimatedStockDiffReportDetails.Any(di =>di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); + return EstimatedStockDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); } public virtual bool IsInDetails(Guid itemId) @@ -120,7 +110,7 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetail.cs index 20a5c9ac..adf4f07e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportDetail.cs @@ -1,21 +1,16 @@ -using System; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { public class EstimatedStockDiffReportDetail : SettleAccountDocumentRootDetailBase { - - /// /// 物品编码 /// public string ItemCode { get; set; } - - /// /// 物品描述 /// @@ -27,15 +22,12 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports public string EstimationType { get; protected set; } - /// /// 暂估类描述 /// public string EstimationTypeDesc { get; protected set; } - - /// /// 暂估数量 /// @@ -46,56 +38,48 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports /// public decimal StockQty { private set; get; } - /// /// 自制件拆分数量 /// public decimal FgQty { private set; get; } - /// /// 发出未结拆分数量 /// public decimal UnSettledQty { private set; get; } - /// /// 差异数量 /// public decimal DiffQty { private set; get; } - - protected EstimatedStockDiffReportDetail() { } - - public EstimatedStockDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string estimationType, string estimationTypeDesc, decimal estimationQty, decimal stockQty, decimal fgQty, decimal unSettledQty, decimal diffQty,string remark, bool enabled) : base(id) + public EstimatedStockDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string estimationType, string estimationTypeDesc, decimal estimationQty, decimal stockQty, decimal fgQty, decimal unSettledQty, decimal diffQty, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; DocumentNumber = documentNumber; Year = year; Period = period; - Version = version; + Version = version; ItemCode = itemCode; - ItemDesc = itemDesc; + ItemDesc = itemDesc; EstimationType = estimationType; EstimationTypeDesc = estimationTypeDesc; EstimationQty = estimationQty; StockQty = stockQty; FgQty = fgQty; UnSettledQty = unSettledQty; - DiffQty = diffQty; + DiffQty = diffQty; Remark = remark; Enabled = enabled; } - - - public void Set( string remark, bool enabled) + public void Set(string remark, bool enabled) { Remark = remark; Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportManager.cs index 0d70b29a..731cc9a5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/EstimatedStockDiffReportManager.cs @@ -1,12 +1,5 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; - - + namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { public class EstimatedStockDiffReportManager : DomainService, IEstimatedStockDiffReportManager @@ -26,7 +19,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports // _arrivalNoticeRepository = arrivalNoticeRepository; //} - ///// ///// 根据单号获取主单据信息 ///// @@ -174,7 +166,6 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports // return true; //} - ///// ///// 报废到货通知单 ///// @@ -197,8 +188,5 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports // return arrivalNotice; //} - - - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportManager.cs index 1ea2bf0b..7e25dfe4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/EstimatedStockDiffReports/IEstimatedStockDiffReportManager.cs @@ -1,13 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports { public interface IEstimatedStockDiffReportManager { - ///// ///// 根据单号获取主单据信息 ///// @@ -45,4 +40,4 @@ namespace Win.Sfs.SettleAccount.EstimatedStockDiffReports //Task CancelAsync(Guid id); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReport.cs index fc52ab5f..80a3dd5d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReport.cs @@ -1,14 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { @@ -18,13 +14,9 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports /// public class HQSPNotConsignReport : SettleAccountDocumentTimeRootBase { - - public virtual List HQSPNotConsignReportDetails { get; protected set; } - - protected HQSPNotConsignReport() { } public HQSPNotConsignReport(Guid id, Guid branchId, string documentNumber, DateTime beginTime, DateTime endTime, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, beginTime, endTime, customCode, customName, remark, creatorName) @@ -35,9 +27,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports HQSPNotConsignReportDetails = new List(); } - - - public void SetStatus(EnumDocumentStatus status) { DocumentStatus = status; @@ -48,7 +37,6 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, HQSPNotConsignReportDetail detail) { @@ -60,8 +48,8 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports // throw new Exception(detail.CustomItemCode + ":" + detail.CustomSubItemCode + "已经在明细中存在!"); //} - HQSPNotConsignReportDetails.Add(new HQSPNotConsignReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, - detail.OrderKBCode, detail.MaterialCode, detail.MaterialDesc, detail.NeedQty, detail.ConsignQty, detail.DeliveryDateTime, detail.State)); + HQSPNotConsignReportDetails.Add(new HQSPNotConsignReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, + detail.OrderKBCode, detail.MaterialCode, detail.MaterialDesc, detail.NeedQty, detail.ConsignQty, detail.DeliveryDateTime, detail.State)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -124,7 +112,7 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetail.cs index 18d81f47..f84e84b0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignReportDetail.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQSPNotConsignReports { @@ -37,12 +35,10 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports [Display(Name = "状态")] public int State { get; set; } - protected HQSPNotConsignReportDetail() { } - public HQSPNotConsignReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string remark, bool enabled, - string customCode, string orderKBCode, string materialCode,string materialDesc, decimal needQty, decimal consignQty, DateTime deliveryDateTime, int state) : base(id) + string customCode, string orderKBCode, string materialCode, string materialDesc, decimal needQty, decimal consignQty, DateTime deliveryDateTime, int state) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -68,4 +64,4 @@ namespace Win.Sfs.SettleAccount.HQSPNotConsignReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignSumReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignSumReport.cs index bfba6f71..e266fa15 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignSumReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HQSPNotConsignReports/HQSPNotConsignSumReport.cs @@ -1,8 +1,4 @@ -using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -18,7 +14,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports //[Required(ErrorMessage = "{0}是必填项")] public string KBCode { get; set; } - [Display(Name = "物料号")] //[Required(ErrorMessage = "{0}是必填项")] public string MaterialCode { get; set; } @@ -29,7 +24,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "需求数量")] public decimal NeedQty { get; set; } - [Display(Name = "结算数量")] public decimal ConsignQty { get; set; } @@ -38,7 +32,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public HQSPNotConsignSumReport() { } - public HQSPNotConsignSumReport( string materialCode, string materialDesc, decimal needQty, decimal consignQty, decimal diffQty) { @@ -51,4 +44,4 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReport.cs index 0eea439a..0f698d85 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReport.cs @@ -1,14 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQNotConsignReports { @@ -18,13 +14,9 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports /// public class HQNotConsignReport : SettleAccountDocumentTimeRootBase { - - public virtual List HQNotConsignReportDetails { get; protected set; } - - protected HQNotConsignReport() { } public HQNotConsignReport(Guid id, Guid branchId, string documentNumber, DateTime beginTime, DateTime endTime, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, beginTime, endTime, customCode, customName, remark, creatorName) @@ -35,9 +27,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports HQNotConsignReportDetails = new List(); } - - - public void SetStatus(EnumDocumentStatus status) { DocumentStatus = status; @@ -48,7 +37,6 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, HQNotConsignReportDetail detail) { @@ -60,8 +48,8 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports // throw new Exception(detail.CustomItemCode + ":" + detail.CustomSubItemCode + "已经在明细中存在!"); //} - HQNotConsignReportDetails.Add(new HQNotConsignReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, - detail.OrderKBCode, detail.MaterialCode, detail.MaterialDesc, detail.NeedQty, detail.ConsignQty, detail.DeliveryDateTime, detail.State)); + HQNotConsignReportDetails.Add(new HQNotConsignReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Remark, detail.Enabled, detail.CustomCode, + detail.OrderKBCode, detail.MaterialCode, detail.MaterialDesc, detail.NeedQty, detail.ConsignQty, detail.DeliveryDateTime, detail.State)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -124,7 +112,7 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReportDetail.cs index 0318f5c4..709416ec 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignReportDetail.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.HQNotConsignReports { @@ -37,12 +35,10 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports [Display(Name = "状态")] public int State { get; set; } - protected HQNotConsignReportDetail() { } - public HQNotConsignReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string remark, bool enabled, - string customCode, string orderKBCode, string materialCode,string materialDesc, decimal needQty, decimal consignQty, DateTime deliveryDateTime, int state) : base(id) + string customCode, string orderKBCode, string materialCode, string materialDesc, decimal needQty, decimal consignQty, DateTime deliveryDateTime, int state) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -68,4 +64,4 @@ namespace Win.Sfs.SettleAccount.HQNotConsignReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignSumReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignSumReport.cs index 11fbdd42..022bad4f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignSumReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/HqNotConsignReports/HQNotConsignSumReport.cs @@ -1,8 +1,4 @@ -using System; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.Constant; -using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.BTNotConsignReports { @@ -28,7 +24,6 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports [Display(Name = "需求数量")] public decimal NeedQty { get; set; } - [Display(Name = "结算数量")] public decimal ConsignQty { get; set; } @@ -37,9 +32,8 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports public HQNotConsignSumReport() { } - public HQNotConsignSumReport( - string materialCode, string materialDesc, decimal needQty, decimal consignQty, decimal diffQty,string vin) + string materialCode, string materialDesc, decimal needQty, decimal consignQty, decimal diffQty, string vin) { VIN = vin; MaterialCode = materialCode; @@ -50,4 +44,4 @@ namespace Win.Sfs.SettleAccount.BTNotConsignReports } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiff.cs index ece83a0f..016d93f1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiff.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Reports.InvoicePriceListDiff { - public class InvoicePriceListDiff: FullAuditedAggregateRootBase + public class InvoicePriceListDiff : FullAuditedAggregateRootBase { - public InvoicePriceListDiff(Guid Id,string year, string period, string version, string factory, string textCode, string materialCode, string materialDesc, DateTime inputDate, decimal qty, decimal amt, string number, string accounting, DateTime? accountDate, DateTime? beginDate, DateTime? endDate, decimal price, int type):base(Id) + public InvoicePriceListDiff(Guid Id, string year, string period, string version, string factory, string textCode, string materialCode, string materialDesc, DateTime inputDate, decimal qty, decimal amt, string number, string accounting, DateTime? accountDate, DateTime? beginDate, DateTime? endDate, decimal price, int type) : base(Id) { Year = year; Period = period; @@ -32,45 +28,45 @@ namespace Win.Sfs.SettleAccount.Reports.InvoicePriceListDiff /// /// 年 /// - public string Year { set; get; } + public string Year { set; get; } /// /// 期间 /// - public string Period { set; get; } + public string Period { set; get; } /// /// 版本 /// - public string Version { set; get; } + public string Version { set; get; } /// /// 状态 /// - public int State { set; get; } + public int State { set; get; } - /// - /// 工厂 - /// - public string Factory { set; get; } + /// + /// 工厂 + /// + public string Factory { set; get; } /// /// /// - public string TextCode { set; get; } + public string TextCode { set; get; } /// /// 物料号 /// - public string MaterialCode { set; get; } + public string MaterialCode { set; get; } /// /// 物料描述 /// - public string MaterialDesc { set; get; } - public DateTime InputDate { set; get; } - public decimal Qty { set; get; } - public decimal Amt { set; get; } - public string Number { set; get; } - public string Accounting { set; get; } - public DateTime? AccountDate { set; get; } - public DateTime? BeginDate { set; get; } - public DateTime? EndDate { set; get; } - public decimal Price { set; get; } - public int Type { set; get; } + public string MaterialDesc { set; get; } + public DateTime InputDate { set; get; } + public decimal Qty { set; get; } + public decimal Amt { set; get; } + public string Number { set; get; } + public string Accounting { set; get; } + public DateTime? AccountDate { set; get; } + public DateTime? BeginDate { set; get; } + public DateTime? EndDate { set; get; } + public decimal Price { set; get; } + public int Type { set; get; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiffVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiffVersion.cs index b71c0317..7c2504a4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiffVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoicePriceListDiff/InvoicePriceListDiffVersion.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Reports.InvoicePriceListDiff { class InvoicePriceListDiffVersion diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs index 0ce3452e..53abd24f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiff.cs @@ -1,10 +1,6 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs @@ -104,21 +100,15 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs [ExporterHeader(DisplayName = "版本", IsIgnore = true)] public string Version { set; get; } - [ExporterHeader(DisplayName = "漏结期间")] public string UnSettleVersion { set; get; } //总金额差异 //[ExporterHeader(DisplayName = "总金额差异")] //public decimal AmtDiffPrice { set; get; } - - - - } - - public class InvoiceSettledDiff: FullAuditedAggregateRootBase + public class InvoiceSettledDiff : FullAuditedAggregateRootBase { public InvoiceSettledDiff() { } @@ -173,18 +163,5 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs [ExporterHeader(DisplayName = "价格差异")] public decimal DiffPrice { get; set; } - - - - - - - - - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs index 0ec448d5..18f8f7f2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/InvoiceSettledDiffs/InvoiceSettledDiffVersion.cs @@ -1,16 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.SettleAccount.Bases; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs { - public class InvoiceSettledDiffVersion: FullAuditedAggregateRootBase + public class InvoiceSettledDiffVersion : FullAuditedAggregateRootBase { - public InvoiceSettledDiffVersion(Guid Id,string year, string period, string version, string customCode, string customName, string creatorName, string projectName):base(Id) + public InvoiceSettledDiffVersion(Guid Id, string year, string period, string version, string customCode, string customName, string creatorName, string projectName) : base(Id) { Year = year; Period = period; @@ -31,13 +26,11 @@ namespace Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs /// public string Period { set; get; } - /// /// 版本 /// public string Version { set; get; } - /// /// 客户编码 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs index af8b64d9..cfcf33ac 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/ReportDetailBase.cs @@ -1,20 +1,9 @@ -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.DomainBase; +using Magicodes.ExporterAndImporter.Core; namespace Win.Sfs.SettleAccount.Reports { - - - - - public class ReportDetailBase { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs index 78f5b1ab..cd273e09 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReport.cs @@ -4,113 +4,114 @@ using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 结算、发运明细对比报告 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 类别 - /// - [Display(Name = "类别")] - [ExporterHeader(DisplayName = "类别")] - [ValueMapping("有结算有发运", 1)] - [ValueMapping("有结算无发运", 2)] - [ValueMapping("无结算有发运", 3)] - public EnumPubSaSeCompareCategory Category { get; set; } - /// - /// Wms发货单号 - /// - [Display(Name = "Wms发货单号")] - [ExporterHeader(DisplayName = "交货单号")] - public string WmsBillNum { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime? ShippingDate { get; set; } - /// - /// 生产码 - /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "生产码")] - public virtual string PN { get; set; } - /// - /// 客户零件号 - /// - [Display(Name = "客户零件号")] - [ExporterHeader(DisplayName = "客户零件号")] - public string CustomerPartCode { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - [ExporterHeader(DisplayName = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内零件号 - /// - [Display(Name = "厂内零件号")] - [ExporterHeader(DisplayName = "厂内零件号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - [ExporterHeader(DisplayName = "替换厂内零件号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] - public DateTime? CustomerOfflineTime { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ExporterHeader(DisplayName = "结算数量")] - public decimal SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } - /// - /// 差异数量 - /// - [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty => SAQty - SEQty; - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0; - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - [ExporterHeader(DisplayName = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - [ExporterHeader(DisplayName = "ERP目标库位")] - public string ToErpLocCode { get; set; } - /// - /// 是否是当期 - /// - [Display(Name = "当期")] - [ValueMapping("当期数据", true)] - [ValueMapping("", false)] - public bool IsCurrent { get; set; } + /// 结算、发运明细对比报告 + /// + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReport + { + /// + /// 类别 + /// + [Display(Name = "类别")] + [ExporterHeader(DisplayName = "类别")] + [ValueMapping("有结算有发运", 1)] + [ValueMapping("有结算无发运", 2)] + [ValueMapping("无结算有发运", 3)] + public EnumPubSaSeCompareCategory Category { get; set; } + /// + /// Wms发货单号 + /// + [Display(Name = "Wms发货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] + public DateTime? ShippingDate { get; set; } + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "生产码")] + public virtual string PN { get; set; } + /// + /// 客户零件号 + /// + [Display(Name = "客户零件号")] + [ExporterHeader(DisplayName = "客户零件号")] + public string CustomerPartCode { get; set; } + /// + /// 零件描述 + /// + [Display(Name = "零件描述")] + [ExporterHeader(DisplayName = "零件描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内零件号 + /// + [Display(Name = "厂内零件号")] + [ExporterHeader(DisplayName = "厂内零件号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内零件号 + /// + [Display(Name = "替换厂内零件号")] + [ExporterHeader(DisplayName = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] + public DateTime? CustomerOfflineTime { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } + /// + /// 差异数量 + /// + [ExporterHeader(DisplayName = "差异数量")] + public decimal DiffQty => SAQty - SEQty; + /// + /// 匹配类型 + /// + [Display(Name = "匹配类型")] + [ExporterHeader(DisplayName = "是否完全匹配")] + [ValueMapping("是", true)] + [ValueMapping("否", false)] + public bool MateType => DiffQty == 0; + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + [ExporterHeader(DisplayName = "WMS目标库位")] + public string ToLocCode { get; set; } + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + [ExporterHeader(DisplayName = "ERP目标库位")] + public string ToErpLocCode { get; set; } + /// + /// 是否是当期 + /// + [Display(Name = "当期")] + [ValueMapping("当期数据", true)] + [ValueMapping("", false)] + public bool IsCurrent { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs index f0d5d465..71997031 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportBeiJian.cs @@ -2,18 +2,19 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 备件结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReportBeiJian : SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 生产码 + /// 备件结算与发运对比明细 /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "索引号")] - public override string PN { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReportBeiJian : SaSeCompareDetailReport + { + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "索引号")] + public override string PN { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs index 324ebf0b..ab47a201 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianBBAC.cs @@ -2,18 +2,19 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 买单件BBAC结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReportMaiDanJianBBAC : SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 生产码 + /// 买单件BBAC结算与发运对比明细 /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "索引号")] - public override string PN { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReportMaiDanJianBBAC : SaSeCompareDetailReport + { + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "索引号")] + public override string PN { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs index 48eef19f..58e852c0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportMaiDanJianHBPO.cs @@ -2,18 +2,19 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 买单件HBPO结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReportMaiDanJianHBPO : SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 生产码 + /// 买单件HBPO结算与发运对比明细 /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "索引号")] - public override string PN { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReportMaiDanJianHBPO : SaSeCompareDetailReport + { + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "索引号")] + public override string PN { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs index 4e322a30..4d37e729 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportYinDuJian.cs @@ -2,18 +2,19 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 印度件结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReportYinDuJian : SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 生产码 + /// 印度件结算与发运对比明细 /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "ASN发货单号")] - public override string PN { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReportYinDuJian : SaSeCompareDetailReport + { + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public override string PN { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs index 6b24cb59..79aa1660 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianBBAC.cs @@ -2,18 +2,19 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 直供件BBAC结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReportZhiGongJianBBAC : SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 生产码 + /// 直供件BBAC结算与发运对比明细 /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "ASN发货单号")] - public override string PN { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReportZhiGongJianBBAC : SaSeCompareDetailReport + { + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public override string PN { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs index 3601344b..75068733 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDetailReportZhiGongJianHBPO.cs @@ -2,18 +2,19 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 直供件HBPO结算与发运对比明细 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareDetailReportZhiGongJianHBPO : SaSeCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 生产码 + /// 直供件HBPO结算与发运对比明细 /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "ASN发货单号")] - public override string PN { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareDetailReportZhiGongJianHBPO : SaSeCompareDetailReport + { + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "ASN发货单号")] + public override string PN { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs index bb658c1b..3c365cc8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareDiff.cs @@ -2,152 +2,153 @@ using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 结算、发运对比 -/// -public class SaSeCompareDiff +namespace Win.Sfs.SettleAccount.Reports { /// - /// 期间 - /// - [Display(Name = "期间")] - public int Version { get; set; } - /// - /// Wms发货单号 - /// - [Display(Name = "Wms发货单号")] - public string WmsBillNum { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - public DateTime? ShippingDate { get; set; } - /// - /// 日顺序号 - /// - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - public DateTime? CustomerOfflineTime { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - public decimal? SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - public decimal? SEQty { get; set; } - /// - /// 生产号 - /// - [Display(Name = "生产号")] - public string PN { set; get; } - /// - /// 客户物料号 - /// - [Display(Name = "客户物料号")] - public string LU { set; get; } - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - public string ToErpLocCode { get; set; } - /// - /// 类型 - /// - [Display(Name = "类型")] - public EnumPubSaSeCompareCategory Category { get; set; } - /// - /// 发运客户物料号 - /// - public string SeCustomerPartCode { get; set; } - /// - /// 发运厂内物料号 - /// - public string SeFactoryPartCode { get; set; } - /// - /// 结算客户物料号 - /// - public string SaCustomerPartCode { get; set; } - /// - /// 结算厂内物料号 - /// - public string SaFactoryPartCode { get; set; } - /// - /// 客户物料号 - /// - [Display(Name = "客户物料号")] - public string CustomerPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内物料号 - /// - [Display(Name = "替换厂内物料号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 是否已经移除 - /// - public bool IsRemove { get; set; } - /// - /// 是否是当期 - /// - public bool IsCurrent { get; set; } -} + /// 结算、发运对比 + /// + public class SaSeCompareDiff + { + /// + /// 期间 + /// + [Display(Name = "期间")] + public int Version { get; set; } + /// + /// Wms发货单号 + /// + [Display(Name = "Wms发货单号")] + public string WmsBillNum { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + public DateTime? ShippingDate { get; set; } + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + public DateTime? CustomerOfflineTime { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + public decimal? SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + public decimal? SEQty { get; set; } + /// + /// 生产号 + /// + [Display(Name = "生产号")] + public string PN { set; get; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + public string LU { set; get; } + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + public string ToLocCode { get; set; } + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + public string ToErpLocCode { get; set; } + /// + /// 类型 + /// + [Display(Name = "类型")] + public EnumPubSaSeCompareCategory Category { get; set; } + /// + /// 发运客户物料号 + /// + public string SeCustomerPartCode { get; set; } + /// + /// 发运厂内物料号 + /// + public string SeFactoryPartCode { get; set; } + /// + /// 结算客户物料号 + /// + public string SaCustomerPartCode { get; set; } + /// + /// 结算厂内物料号 + /// + public string SaFactoryPartCode { get; set; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + public string CustomerPartCode { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内物料号 + /// + [Display(Name = "替换厂内物料号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 是否已经移除 + /// + public bool IsRemove { get; set; } + /// + /// 是否是当期 + /// + public bool IsCurrent { get; set; } + } -/// -/// PUB结算与发运对比明细 -/// -public interface IPubSaSeCompareDetailExport -{ - /// - /// 类别 - /// - [Display(Name = "类别")] - public EnumPubSaSeCompareCategory Category { get; set; } /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - public string PartCodeDesc { get; set; } - /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - public decimal SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - public decimal SEQty { get; set; } + /// PUB结算与发运对比明细 + /// + public interface IPubSaSeCompareDetailExport + { + /// + /// 类别 + /// + [Display(Name = "类别")] + public EnumPubSaSeCompareCategory Category { get; set; } + /// + /// 零件描述 + /// + [Display(Name = "零件描述")] + public string PartCodeDesc { get; set; } + /// + /// 替换厂内零件号 + /// + [Display(Name = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + public decimal SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + public decimal SEQty { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs index fa2a4752..5bcfc6ae 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeCompareSumReport.cs @@ -2,45 +2,46 @@ using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 结算、发运汇总对比报告 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeCompareSumReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 厂内物料号 + /// 结算、发运汇总对比报告 /// - [Display(Name = "厂内物料号")] - [ExporterHeader(DisplayName = "LU")] - public string FactoryPartCode { get; set; } + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeCompareSumReport + { + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + [ExporterHeader(DisplayName = "LU")] + public string FactoryPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string PartCodeDesc { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string PartCodeDesc { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ExporterHeader(DisplayName = "结算数量")] - public decimal SAQty { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } - /// - /// 差异数量 - /// - [ExporterHeader(DisplayName = "差异数量")] - public decimal DiffQty => SAQty - SEQty; + /// + /// 差异数量 + /// + [ExporterHeader(DisplayName = "差异数量")] + public decimal DiffQty => SAQty - SEQty; + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs index 45fbcccc..8d9bbf59 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReport.cs @@ -4,173 +4,174 @@ using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 结算、发运、Eid对比明细报告 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeEdiCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 类别 + /// 结算、发运、Eid对比明细报告 /// - [Display(Name = "类别")] - [ExporterHeader(DisplayName = "类别")] - [ValueMapping("有结算有发运(有EDI数据)", 1)] - [ValueMapping("有结算有发运(无EDI数据)", 2)] - [ValueMapping("有结算无发运(有EDI数据)", 3)] - [ValueMapping("有结算无发运(无EDI数据)", 4)] - [ValueMapping("无结算有发运(有EDI数据)", 5)] - [ValueMapping("无结算有发运(无EDI数据)", 6)] - public EnumSaSeEdiCompareCategory Category { get; set; } - [Display(Name = "WMS多发")] - [ExporterHeader(DisplayName = "WMS多发")] - [ValueMapping("", 0)] - [ValueMapping("WMS多发", 1)] - public EnumWMSSend WMSSend + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeEdiCompareDetailReport { - get + /// + /// 类别 + /// + [Display(Name = "类别")] + [ExporterHeader(DisplayName = "类别")] + [ValueMapping("有结算有发运(有EDI数据)", 1)] + [ValueMapping("有结算有发运(无EDI数据)", 2)] + [ValueMapping("有结算无发运(有EDI数据)", 3)] + [ValueMapping("有结算无发运(无EDI数据)", 4)] + [ValueMapping("无结算有发运(有EDI数据)", 5)] + [ValueMapping("无结算有发运(无EDI数据)", 6)] + public EnumSaSeEdiCompareCategory Category { get; set; } + [Display(Name = "WMS多发")] + [ExporterHeader(DisplayName = "WMS多发")] + [ValueMapping("", 0)] + [ValueMapping("WMS多发", 1)] + public EnumWMSSend WMSSend { - return (Category, SaSeQty < 0) switch + get { - (EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, true) => EnumWMSSend.WMSRepeat, - (EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi, true) => EnumWMSSend.WMSRepeat, - _ => EnumWMSSend.None - }; + return (Category, SaSeQty < 0) switch + { + (EnumSaSeEdiCompareCategory.HaveSaHaveSeHaveEdi, true) => EnumWMSSend.WMSRepeat, + (EnumSaSeEdiCompareCategory.HaveSaHaveSeNotHaveEdi, true) => EnumWMSSend.WMSRepeat, + _ => EnumWMSSend.None + }; + } } + [Display(Name = "价格信息")] + [ExporterHeader(DisplayName = "价格信息", IsIgnore = true)] + [ValueMapping("有价格信息", true)] + [ValueMapping("无价格信息", false)] + public bool IsHavePrice => FixPrice != null && FixPrice != 0; + /// + /// 交货单号 + /// + [Display(Name = "交货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] + public DateTime? ShippingDate { get; set; } + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "订单生产码")] + public string PN { get; set; } + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + [ExporterHeader(DisplayName = "日顺序号")] + public string SeqNumber { get; set; } + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + [ExporterHeader(DisplayName = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + [ExporterHeader(DisplayName = "客户物料号")] + public string CustomerPartCode { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + [ExporterHeader(DisplayName = "厂内物料号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内物料号 + /// + [Display(Name = "替换厂内物料号")] + [ExporterHeader(DisplayName = "替换厂内物料号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 客户下线时间 + /// + [Display(Name = "客户下线时间")] + [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] + public DateTime? CustomerOfflineTime { get; set; } + /// + /// 小总成号 + /// + [Display(Name = "小总成号")] + [ExporterHeader(DisplayName = "小总成号")] + public string AssemblyCode { get; set; } + /// + /// 注塑码 + /// + [Display(Name = "注塑码")] + [ExporterHeader(DisplayName = "注塑码")] + public string InjectionCode { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } + /// + /// Edi数量 + /// + [Display(Name = "Edi数量")] + [ExporterHeader(DisplayName = "Edi数量")] + public decimal EdiQty { get; set; } + /// + /// 结算与WMS发货量差 + /// + [ExporterHeader(DisplayName = "结算与WMS发货量差")] + public decimal SaSeQty => SAQty - SEQty; + /// + /// 结算与EDI量差 + /// + [ExporterHeader(DisplayName = "结算与EDI量差")] + public decimal SaEdiQty => SAQty - EdiQty; + /// + /// WMS发货与EDI数量差 + /// + [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] + public decimal SeEdiQty => SEQty - EdiQty; + [Display(Name = "是否完全匹配")] + [ExporterHeader(DisplayName = "是否完全匹配")] + [ValueMapping("是", true)] + [ValueMapping("否", false)] + public bool MateType => SaSeQty == 0 && SaEdiQty == 0 && SeEdiQty == 0; + /// + /// 定价 + /// + [Display(Name = "定价")] + [ExporterHeader(DisplayName = "定价", IsIgnore = true)] + public decimal? FixPrice { get; set; } + /// + /// ERP销售库位 + /// + [Display(Name = "ERP销售库位")] + [ExporterHeader(DisplayName = "ERP销售库位")] + public string ToErpLocCode { get; set; } + /// + /// WMS发货库位 + /// + [Display(Name = "WMS发货库位")] + [ExporterHeader(DisplayName = "WMS发货库位")] + public string ToLocCode { get; set; } } - [Display(Name = "价格信息")] - [ExporterHeader(DisplayName = "价格信息", IsIgnore = true)] - [ValueMapping("有价格信息", true)] - [ValueMapping("无价格信息", false)] - public bool IsHavePrice => FixPrice != null && FixPrice != 0; - /// - /// 交货单号 - /// - [Display(Name = "交货单号")] - [ExporterHeader(DisplayName = "交货单号")] - public string WmsBillNum { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime? ShippingDate { get; set; } - /// - /// 生产码 - /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "订单生产码")] - public string PN { get; set; } - /// - /// 日顺序号 - /// - [Display(Name = "日顺序号")] - [ExporterHeader(DisplayName = "日顺序号")] - public string SeqNumber { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - [ExporterHeader(DisplayName = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } - /// - /// 客户物料号 - /// - [Display(Name = "客户物料号")] - [ExporterHeader(DisplayName = "客户物料号")] - public string CustomerPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - [ExporterHeader(DisplayName = "厂内物料号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内物料号 - /// - [Display(Name = "替换厂内物料号")] - [ExporterHeader(DisplayName = "替换厂内物料号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 客户下线时间 - /// - [Display(Name = "客户下线时间")] - [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] - public DateTime? CustomerOfflineTime { get; set; } - /// - /// 小总成号 - /// - [Display(Name = "小总成号")] - [ExporterHeader(DisplayName = "小总成号")] - public string AssemblyCode { get; set; } - /// - /// 注塑码 - /// - [Display(Name = "注塑码")] - [ExporterHeader(DisplayName = "注塑码")] - public string InjectionCode { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ExporterHeader(DisplayName = "结算数量")] - public decimal SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } - /// - /// Edi数量 - /// - [Display(Name = "Edi数量")] - [ExporterHeader(DisplayName = "Edi数量")] - public decimal EdiQty { get; set; } - /// - /// 结算与WMS发货量差 - /// - [ExporterHeader(DisplayName = "结算与WMS发货量差")] - public decimal SaSeQty => SAQty - SEQty; - /// - /// 结算与EDI量差 - /// - [ExporterHeader(DisplayName = "结算与EDI量差")] - public decimal SaEdiQty => SAQty - EdiQty; - /// - /// WMS发货与EDI数量差 - /// - [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] - public decimal SeEdiQty => SEQty - EdiQty; - [Display(Name = "是否完全匹配")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => SaSeQty == 0 && SaEdiQty == 0 && SeEdiQty == 0; - /// - /// 定价 - /// - [Display(Name = "定价")] - [ExporterHeader(DisplayName = "定价", IsIgnore = true)] - public decimal? FixPrice { get; set; } - /// - /// ERP销售库位 - /// - [Display(Name = "ERP销售库位")] - [ExporterHeader(DisplayName = "ERP销售库位")] - public string ToErpLocCode { get; set; } - /// - /// WMS发货库位 - /// - [Display(Name = "WMS发货库位")] - [ExporterHeader(DisplayName = "WMS发货库位")] - public string ToLocCode { get; set; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs index e592b95c..ab7ffccb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisBBAC.cs @@ -1,8 +1,9 @@ -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// JisBBAC结算、发运、Eid明细对比报告 -/// -public class SaSeEdiCompareDetailReportJisBBAC : SaSeEdiCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { + /// + /// JisBBAC结算、发运、Eid明细对比报告 + /// + public class SaSeEdiCompareDetailReportJisBBAC : SaSeEdiCompareDetailReport + { + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs index 6f5e5ca4..6a579ac5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDetailReportJisHBPO.cs @@ -1,8 +1,9 @@ -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// JisHBPO结算、发运、Eid明细对比报告 -/// -public class SaSeEdiCompareDetailReportJisHBPO : SaSeEdiCompareDetailReport +namespace Win.Sfs.SettleAccount.Reports { + /// + /// JisHBPO结算、发运、Eid明细对比报告 + /// + public class SaSeEdiCompareDetailReportJisHBPO : SaSeEdiCompareDetailReport + { + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs index 4343ed77..cd78ff88 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareDiff.cs @@ -2,158 +2,159 @@ using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.SettleAccount.Enums; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 结算、EDI、发运对比 -/// -public class SaSeEdiCompareDiff +namespace Win.Sfs.SettleAccount.Reports { /// - /// 类型 - /// - [Display(Name = "类型")] - public EnumSaSeEdiCompareCategory Category { get; set; } - /// - /// Wms发货单号 - /// - [Display(Name = "Wms发货单号")] - public string WmsBillNum { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - public DateTime? ShippingDate { get; set; } - /// - /// 日顺序号 - /// - [Display(Name = "日顺序号")] - public string SeqNumber { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - public string PJISSeqNumber { get; set; } - /// - /// 结算数据中的过账日期 - /// - [Display(Name = "客户下线时间")] - public DateTime? CustomerOfflineTime { get; set; } - /// - /// 小总成号 - /// - [Display(Name = "小总成号")] - public string AssemblyCode { get; set; } - /// - /// 注塑码 - /// - [Display(Name = "注塑码")] - public string InjectionCode { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - public decimal? SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - public decimal? SEQty { get; set; } - /// - /// Eid数量 - /// - [Display(Name = "Eid数量")] - public decimal? EdiQty { get; set; } - /// - /// 生产号 - /// - [Display(Name = "生产号")] - public string PN { set; get; } - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - public string ToLocCode { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - public string ToErpLocCode { get; set; } - /// - /// Edi客户物料号 - /// - public string EdiCustomerPartCode { get; set; } - /// - /// 发运客户物料号 - /// - public string SeCustomerPartCode { get; set; } - /// - /// 发运厂内物料号 - /// - public string SeFactoryPartCode { get; set; } - /// - /// 结算客户物料号 - /// - public string SaCustomerPartCode { get; set; } - /// - /// 结算厂内物料号 - /// - public string SaFactoryPartCode { get; set; } - /// - /// 客户物料号 - /// - [Display(Name = "客户物料号")] - public string CustomerPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - public string FactoryPartCode { get; set; } - /// - /// 替换厂内物料号 - /// - [Display(Name = "替换厂内物料号")] - public string ReplaceFactoryPartCode { get; set; } -} + /// 结算、EDI、发运对比 + /// + public class SaSeEdiCompareDiff + { + /// + /// 类型 + /// + [Display(Name = "类型")] + public EnumSaSeEdiCompareCategory Category { get; set; } + /// + /// Wms发货单号 + /// + [Display(Name = "Wms发货单号")] + public string WmsBillNum { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + public DateTime? ShippingDate { get; set; } + /// + /// 日顺序号 + /// + [Display(Name = "日顺序号")] + public string SeqNumber { get; set; } + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + public string PJISSeqNumber { get; set; } + /// + /// 结算数据中的过账日期 + /// + [Display(Name = "客户下线时间")] + public DateTime? CustomerOfflineTime { get; set; } + /// + /// 小总成号 + /// + [Display(Name = "小总成号")] + public string AssemblyCode { get; set; } + /// + /// 注塑码 + /// + [Display(Name = "注塑码")] + public string InjectionCode { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + public decimal? SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + public decimal? SEQty { get; set; } + /// + /// Eid数量 + /// + [Display(Name = "Eid数量")] + public decimal? EdiQty { get; set; } + /// + /// 生产号 + /// + [Display(Name = "生产号")] + public string PN { set; get; } + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + public string ToLocCode { get; set; } + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + public string ToErpLocCode { get; set; } + /// + /// Edi客户物料号 + /// + public string EdiCustomerPartCode { get; set; } + /// + /// 发运客户物料号 + /// + public string SeCustomerPartCode { get; set; } + /// + /// 发运厂内物料号 + /// + public string SeFactoryPartCode { get; set; } + /// + /// 结算客户物料号 + /// + public string SaCustomerPartCode { get; set; } + /// + /// 结算厂内物料号 + /// + public string SaFactoryPartCode { get; set; } + /// + /// 客户物料号 + /// + [Display(Name = "客户物料号")] + public string CustomerPartCode { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + public string PartCodeDesc { get; set; } + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + public string FactoryPartCode { get; set; } + /// + /// 替换厂内物料号 + /// + [Display(Name = "替换厂内物料号")] + public string ReplaceFactoryPartCode { get; set; } + } -/// -/// 结算、发运、Eid对比明细 -/// -public interface ISaSeEdiCompareDetailExport -{ - /// - /// 类别 - /// - [Display(Name = "类别")] - public EnumSaSeEdiCompareCategory Category { get; set; } - /// - /// 零件描述 - /// - [Display(Name = "零件描述")] - public string PartCodeDesc { get; set; } /// - /// 替换厂内零件号 - /// - [Display(Name = "替换厂内零件号")] - public string ReplaceFactoryPartCode { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - public decimal SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - public decimal SEQty { get; set; } - /// - /// Edi数量 - /// - [Display(Name = "Edi数量")] - public decimal EdiQty { get; set; } + /// 结算、发运、Eid对比明细 + /// + public interface ISaSeEdiCompareDetailExport + { + /// + /// 类别 + /// + [Display(Name = "类别")] + public EnumSaSeEdiCompareCategory Category { get; set; } + /// + /// 零件描述 + /// + [Display(Name = "零件描述")] + public string PartCodeDesc { get; set; } + /// + /// 替换厂内零件号 + /// + [Display(Name = "替换厂内零件号")] + public string ReplaceFactoryPartCode { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + public decimal SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + public decimal SEQty { get; set; } + /// + /// Edi数量 + /// + [Display(Name = "Edi数量")] + public decimal EdiQty { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs index 93100f01..f506e7ee 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SaSeEdiCompareSumReport.cs @@ -1,53 +1,54 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 结算、发运、Edi汇总对比报告 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SaSeEdiCompareSumReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 厂内物料号 - /// - [Display(Name = "厂内物料号")] - [ExporterHeader(DisplayName = "LU")] - public string FactoryPartCode { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string PartCodeDesc { get; set; } - /// - /// 结算数量 - /// - [Display(Name = "结算数量")] - [ExporterHeader(DisplayName = "结算数量")] - public decimal SAQty { get; set; } - /// - /// 发货数量 - /// - [Display(Name = "发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } - /// - /// Edi数量 - /// - [Display(Name = "Edi数量")] - [ExporterHeader(DisplayName = "Edi数量")] - public decimal EdiQty { get; set; } - /// - /// 结算与EDI量差 - /// - [ExporterHeader(DisplayName = "结算与EDI量差")] - public decimal SaEdiQty => SAQty - EdiQty; - /// - /// WMS发货与EDI数量差 + /// 结算、发运、Edi汇总对比报告 /// - [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] - public decimal SeEdiQty => SEQty - EdiQty; + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SaSeEdiCompareSumReport + { + /// + /// 厂内物料号 + /// + [Display(Name = "厂内物料号")] + [ExporterHeader(DisplayName = "LU")] + public string FactoryPartCode { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string PartCodeDesc { get; set; } + /// + /// 结算数量 + /// + [Display(Name = "结算数量")] + [ExporterHeader(DisplayName = "结算数量")] + public decimal SAQty { get; set; } + /// + /// 发货数量 + /// + [Display(Name = "发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } + /// + /// Edi数量 + /// + [Display(Name = "Edi数量")] + [ExporterHeader(DisplayName = "Edi数量")] + public decimal EdiQty { get; set; } + /// + /// 结算与EDI量差 + /// + [ExporterHeader(DisplayName = "结算与EDI量差")] + public decimal SaEdiQty => SAQty - EdiQty; + /// + /// WMS发货与EDI数量差 + /// + [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] + public decimal SeEdiQty => SEQty - EdiQty; + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs index ca8bf756..500cd839 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReport.cs @@ -2,157 +2,158 @@ using System; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// 发运、Edi与对比报告 -/// -public class SeEidCompareReport +namespace Win.Sfs.SettleAccount.Reports { /// - /// 类别 - /// - [Display(Name = "类别")] - [ExporterHeader(DisplayName = "类别")] - public string Category { get; set; } - /// - /// 车型 - /// - [Display(Name = "车型")] - [ExporterHeader(DisplayName = "车型")] - public string CarModeCode { get; set; } - /// - /// 生产线 - /// - [Display(Name = "生产线")] - [ExporterHeader(DisplayName = "生产线")] - public string LineStationcode { get; set; } - /// - /// 生产码序列号日期 - /// - [Display(Name = "生产码序列号日期")] - [ExporterHeader(DisplayName = "生产码序列号日期")] - public string SequenceNumber { get; set; } - /// - /// 生产码 - /// - [Display(Name = "生产码")] - [ExporterHeader(DisplayName = "生产码")] - public string PN { get; set; } - /// - /// 物料号 - /// - [Display(Name = "物料号")] - [ExporterHeader(DisplayName = "物料号")] - public string MaterialNumber { get; set; } - /// - /// 物料描述 - /// - [Display(Name = "物料描述")] - [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDes { get; set; } - /// - /// WMS发货数量 - /// - [Display(Name = "WMS发货数量")] - [ExporterHeader(DisplayName = "WMS发货数量")] - public decimal SEQty { get; set; } - /// - /// EDI数量 - /// - [Display(Name = "EDI数量")] - [ExporterHeader(DisplayName = "EDI数量")] - public decimal EdiQty { get; set; } - /// - /// WMS发货与EDI数量差 - /// - [Display(Name = "WMS发货与EDI数量差")] - [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] - public decimal DiffQty => SEQty - EdiQty; - /// - /// 交货单号 - /// - [Display(Name = "交货单号")] - [ExporterHeader(DisplayName = "交货单号")] - public string WmsBillNum { get; set; } - /// - /// ParType - /// - [Display(Name = "ParType")] - [ExporterHeader(DisplayName = "ParType")] - public string ParType { get; set; } - /// - /// 配置码 - /// - [Display(Name = "配置码")] - [ExporterHeader(DisplayName = "配置码")] - public string MESConfigCode { get; set; } - /// - /// 发货日期 - /// - [Display(Name = "发货日期")] - [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] - public DateTime? ShippingDate { get; set; } - /// - /// 序列号 - /// - [Display(Name = "序列号")] - [ExporterHeader(DisplayName = "序列号")] - public string Seq { get; set; } - /// - /// PJIS日顺序号 - /// - [Display(Name = "PJIS日顺序号")] - [ExporterHeader(DisplayName = "PJIS日顺序号")] - public string PjsNum { get; set; } - /// - /// WMS目标库位 - /// - [Display(Name = "WMS目标库位")] - [ExporterHeader(DisplayName = "WMS目标库位")] - public string ToLoc { get; set; } - /// - /// ERP目标库位 - /// - [Display(Name = "ERP目标库位")] - [ExporterHeader(DisplayName = "ERP目标库位")] - public string ErpToLoc { get; set; } - /// - /// 客户下线时间 - /// - [Display(Name = "客户下线时间")] - [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] - public DateTime? AssemblyDate { get; set; } - /// - /// 小总成号 - /// - [Display(Name = "小总成号")] - [ExporterHeader(DisplayName = "小总成号")] - public string MatchNumber { get; set; } - /// - /// 注塑码 - /// - [Display(Name = "注塑码")] - [ExporterHeader(DisplayName = "注塑码")] - public string InjectionCode { get; set; } - /// - /// 匹配类型 - /// - [Display(Name = "匹配类型")] - [ExporterHeader(DisplayName = "是否完全匹配")] - [ValueMapping("是", true)] - [ValueMapping("否", false)] - public bool MateType => DiffQty == 0m; - /// - /// 差异说明 - /// - [Display(Name = "差异说明")] - [ExporterHeader(DisplayName = "差异说明")] - public string DiffDesc { get; set; } - /// - /// 备注 - /// - [Display(Name = "备注")] - [ExporterHeader(DisplayName = "备注")] - public string Remark { get; set; } + /// 发运、Edi与对比报告 + /// + public class SeEidCompareReport + { + /// + /// 类别 + /// + [Display(Name = "类别")] + [ExporterHeader(DisplayName = "类别")] + public string Category { get; set; } + /// + /// 车型 + /// + [Display(Name = "车型")] + [ExporterHeader(DisplayName = "车型")] + public string CarModeCode { get; set; } + /// + /// 生产线 + /// + [Display(Name = "生产线")] + [ExporterHeader(DisplayName = "生产线")] + public string LineStationcode { get; set; } + /// + /// 生产码序列号日期 + /// + [Display(Name = "生产码序列号日期")] + [ExporterHeader(DisplayName = "生产码序列号日期")] + public string SequenceNumber { get; set; } + /// + /// 生产码 + /// + [Display(Name = "生产码")] + [ExporterHeader(DisplayName = "生产码")] + public string PN { get; set; } + /// + /// 物料号 + /// + [Display(Name = "物料号")] + [ExporterHeader(DisplayName = "物料号")] + public string MaterialNumber { get; set; } + /// + /// 物料描述 + /// + [Display(Name = "物料描述")] + [ExporterHeader(DisplayName = "物料描述")] + public string MaterialDes { get; set; } + /// + /// WMS发货数量 + /// + [Display(Name = "WMS发货数量")] + [ExporterHeader(DisplayName = "WMS发货数量")] + public decimal SEQty { get; set; } + /// + /// EDI数量 + /// + [Display(Name = "EDI数量")] + [ExporterHeader(DisplayName = "EDI数量")] + public decimal EdiQty { get; set; } + /// + /// WMS发货与EDI数量差 + /// + [Display(Name = "WMS发货与EDI数量差")] + [ExporterHeader(DisplayName = "WMS发货与EDI数量差")] + public decimal DiffQty => SEQty - EdiQty; + /// + /// 交货单号 + /// + [Display(Name = "交货单号")] + [ExporterHeader(DisplayName = "交货单号")] + public string WmsBillNum { get; set; } + /// + /// ParType + /// + [Display(Name = "ParType")] + [ExporterHeader(DisplayName = "ParType")] + public string ParType { get; set; } + /// + /// 配置码 + /// + [Display(Name = "配置码")] + [ExporterHeader(DisplayName = "配置码")] + public string MESConfigCode { get; set; } + /// + /// 发货日期 + /// + [Display(Name = "发货日期")] + [ExporterHeader(DisplayName = "发货日期", Format = "yyyy-MM-dd")] + public DateTime? ShippingDate { get; set; } + /// + /// 序列号 + /// + [Display(Name = "序列号")] + [ExporterHeader(DisplayName = "序列号")] + public string Seq { get; set; } + /// + /// PJIS日顺序号 + /// + [Display(Name = "PJIS日顺序号")] + [ExporterHeader(DisplayName = "PJIS日顺序号")] + public string PjsNum { get; set; } + /// + /// WMS目标库位 + /// + [Display(Name = "WMS目标库位")] + [ExporterHeader(DisplayName = "WMS目标库位")] + public string ToLoc { get; set; } + /// + /// ERP目标库位 + /// + [Display(Name = "ERP目标库位")] + [ExporterHeader(DisplayName = "ERP目标库位")] + public string ErpToLoc { get; set; } + /// + /// 客户下线时间 + /// + [Display(Name = "客户下线时间")] + [ExporterHeader(DisplayName = "客户下线时间", Format = "yyyy-MM-dd")] + public DateTime? AssemblyDate { get; set; } + /// + /// 小总成号 + /// + [Display(Name = "小总成号")] + [ExporterHeader(DisplayName = "小总成号")] + public string MatchNumber { get; set; } + /// + /// 注塑码 + /// + [Display(Name = "注塑码")] + [ExporterHeader(DisplayName = "注塑码")] + public string InjectionCode { get; set; } + /// + /// 匹配类型 + /// + [Display(Name = "匹配类型")] + [ExporterHeader(DisplayName = "是否完全匹配")] + [ValueMapping("是", true)] + [ValueMapping("否", false)] + public bool MateType => DiffQty == 0m; + /// + /// 差异说明 + /// + [Display(Name = "差异说明")] + [ExporterHeader(DisplayName = "差异说明")] + public string DiffDesc { get; set; } + /// + /// 备注 + /// + [Display(Name = "备注")] + [ExporterHeader(DisplayName = "备注")] + public string Remark { get; set; } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs index 03f90227..29770c0d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisBBAC.cs @@ -1,11 +1,12 @@ using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// JisBBAC 发运、Edi与对比报告 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SeEidCompareReportJisBBAC : SeEidCompareReport +namespace Win.Sfs.SettleAccount.Reports { + /// + /// JisBBAC 发运、Edi与对比报告 + /// + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SeEidCompareReportJisBBAC : SeEidCompareReport + { + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs index da01018a..e339ae2f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SeEidCompareReportJisHBPO.cs @@ -1,11 +1,12 @@ using Magicodes.ExporterAndImporter.Excel; -namespace Win.Sfs.SettleAccount.Reports; - -/// -/// JisHBPO 发运、Edi与对比报告 -/// -[ExcelExporter(MaxRowNumberOnASheet = 500_000)] -public class SeEidCompareReportJisHBPO : SeEidCompareReport +namespace Win.Sfs.SettleAccount.Reports { + /// + /// JisHBPO 发运、Edi与对比报告 + /// + [ExcelExporter(MaxRowNumberOnASheet = 500_000)] + public class SeEidCompareReportJisHBPO : SeEidCompareReport + { + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReport.cs index 12af142e..f46521f1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { @@ -19,16 +14,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports /// public class SecondaryActuralAdjustmentReport : SettleAccountDocumentRootBase { - - public virtual List SecondaryActuralAdjustmentReportDetails { get; protected set; } - - protected SecondaryActuralAdjustmentReport() { } - public SecondaryActuralAdjustmentReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public SecondaryActuralAdjustmentReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -46,19 +37,18 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, SecondaryActuralAdjustmentReportDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); Check.NotNull(detail, nameof(SecondaryActuralAdjustmentReportDetail)); if (IsInDetails(detail.CustomItemCode, detail.CustomSubItemCode, detail.SupplierCode)) - { + { //to do 需要规范异常的处理逻辑 - throw new Exception(detail.CustomItemCode+":"+detail.CustomSubItemCode + "已经在明细中存在!"); + throw new Exception(detail.CustomItemCode + ":" + detail.CustomSubItemCode + "已经在明细中存在!"); } - SecondaryActuralAdjustmentReportDetails.Add(new SecondaryActuralAdjustmentReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.CustomItemCode, detail.CustomItemDesc, detail.OfflineQty, detail.CustomSubItemCode, detail.CustomSubItemDesc, detail.ErpSubItemQty, detail.ErpSubItemActualQty, detail.SupplierCode, detail.SupplierDesc, detail.SupplyProportion, detail.CustomSubItemPrice, detail.CustomSubItemSumQty, detail.SumPriceNoTax, detail.SumPriceWithTax, detail.HasChanged, detail.Buyer, detail.Remark, detail.Enabled)); + SecondaryActuralAdjustmentReportDetails.Add(new SecondaryActuralAdjustmentReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.CustomItemCode, detail.CustomItemDesc, detail.OfflineQty, detail.CustomSubItemCode, detail.CustomSubItemDesc, detail.ErpSubItemQty, detail.ErpSubItemActualQty, detail.SupplierCode, detail.SupplierDesc, detail.SupplyProportion, detail.CustomSubItemPrice, detail.CustomSubItemSumQty, detail.SumPriceNoTax, detail.SumPriceWithTax, detail.HasChanged, detail.Buyer, detail.Remark, detail.Enabled)); } @@ -87,8 +77,8 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports //} public virtual bool IsInDetails(string customItemCode, string customSubItemCode, string vendCode) - { - return SecondaryActuralAdjustmentReportDetails.Any(di => di.CustomItemCode == customItemCode && di.CustomSubItemCode == customSubItemCode && di.SupplierCode == vendCode.ToUpper() && di.IsDeleted == false); + { + return SecondaryActuralAdjustmentReportDetails.Any(di => di.CustomItemCode == customItemCode && di.CustomSubItemCode == customSubItemCode && di.SupplierCode == vendCode.ToUpper() && di.IsDeleted == false); } public virtual bool IsInDetails(Guid itemId) @@ -122,7 +112,7 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetail.cs index 7a5787f2..5349d20e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralAdjustmentReports/SecondaryActuralAdjustmentReportDetail.cs @@ -1,14 +1,12 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports { public class SecondaryActuralAdjustmentReportDetail : FullAuditedEntityBase { - /// /// 年度 /// @@ -19,13 +17,11 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports /// public string Period { set; get; } - /// /// 版本 /// public string Version { set; get; } - /// /// 单据ID /// @@ -36,7 +32,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports /// public string DocumentNumber { get; set; } - /// /// 客户总成物料号 /// @@ -50,15 +45,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "客户总成描述")] public string CustomItemDesc { get; set; } - /// /// 客户总成物料号下线数量 /// [Display(Name = "下线数量")] public decimal OfflineQty { get; set; } - - /// /// 客户组件物料号 /// @@ -79,22 +71,18 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "客户组件描述")] public string CustomSubItemDesc { get; set; } - - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "ERP组件用量")] public decimal ErpSubItemQty { get; set; } - /// /// ERP组件物料号每个总成用量 /// [Display(Name = "ERP组件实际用量")] public decimal ErpSubItemActualQty { get; set; } - /// /// 供应商代码 /// @@ -109,7 +97,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "供应商描述")] public string SupplierDesc { get; set; } - /// /// 供货比例 /// @@ -117,7 +104,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "供货比例")] public string SupplyProportion { get; set; } - /// /// 零件单价 /// @@ -132,7 +118,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "零件数量(回款)")] public decimal CustomSubItemSumQty { get; set; } - /// /// 金额(不含税) /// @@ -140,14 +125,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "金额(不含税)")] public decimal SumPriceNoTax { get; set; } - /// /// 金额(含税) /// [Display(Name = "金额(含税)")] public decimal SumPriceWithTax { set; get; } - /// /// 价格或零件号变动情况 /// @@ -155,7 +138,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "价格或零件号变动情况")] public string HasChanged { get; set; } = "否"; - /// /// 二配采购员 /// @@ -163,20 +145,16 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports [Display(Name = "二配采购员")] public string Buyer { get; set; } - - - protected SecondaryActuralAdjustmentReportDetail() { } - - public SecondaryActuralAdjustmentReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string customItemCode, string customItemDesc, decimal parentItemOfflineQty, string customSubItemCode, string customSubItemDesc, decimal erpSubItemQty, decimal erpSubItemActualQty, string supplierCode, string supplierDesc, string supplyProportion, decimal customSubItemPrice, decimal customSubItemSumQty, decimal noTaxAmount, decimal taxAmount, string hasChanged, string buyer, string remark, bool enabled) : base(id) + public SecondaryActuralAdjustmentReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string customItemCode, string customItemDesc, decimal parentItemOfflineQty, string customSubItemCode, string customSubItemDesc, decimal erpSubItemQty, decimal erpSubItemActualQty, string supplierCode, string supplierDesc, string supplyProportion, decimal customSubItemPrice, decimal customSubItemSumQty, decimal noTaxAmount, decimal taxAmount, string hasChanged, string buyer, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; DocumentNumber = documentNumber; Year = year; Period = period; - Version = version; + Version = version; CustomItemCode = customItemCode; CustomItemDesc = customItemDesc; @@ -200,10 +178,10 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports Enabled = enabled; } - public void Set( string remark, bool enabled) + public void Set(string remark, bool enabled) { Remark = remark; Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportManager.cs index 3589704f..00c7e32e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/ISecondaryActuralDiffReportManager.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Threading.Tasks; @@ -6,11 +6,9 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { public interface ISecondaryActuralDiffReportManager { - - Task CancelByYearAndPeriod(Guid branchId, string year,string period); + Task CancelByYearAndPeriod(Guid branchId, string year, string period); - - Task> GetAllDiffInfoByYear(Guid branchId, string year); + Task> GetAllDiffInfoByYear(Guid branchId, string year); } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReport.cs index a4ad20e7..d56d1911 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { @@ -19,16 +14,12 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports /// public class SecondaryActuralDiffReport : SettleAccountDocumentRootBase { - - public virtual List SecondaryActuralDiffReportDetails { get; protected set; } - - protected SecondaryActuralDiffReport() { } - public SecondaryActuralDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public SecondaryActuralDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -46,19 +37,18 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, SecondaryActuralDiffReportDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); Check.NotNull(detail, nameof(SecondaryActuralDiffReportDetail)); if (IsInDetails(detail.CustomItemCode, detail.CustomSubItemCode, detail.SupplierCode)) - { + { //to do 需要规范异常的处理逻辑 - throw new Exception(detail.CustomItemCode+":"+detail.CustomSubItemCode + "已经在明细中存在!"); + throw new Exception(detail.CustomItemCode + ":" + detail.CustomSubItemCode + "已经在明细中存在!"); } - SecondaryActuralDiffReportDetails.Add(new SecondaryActuralDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.CustomItemCode, detail.CustomItemDesc, detail.CustomSubItemCode, detail.ErpSubItemCode, detail.CustomSubItemDesc, detail.SupplierCode, detail.SupplierDesc, detail.StaPaymentPartyQty, detail.ActPaymentPartyQty, detail.DiffQty, detail.StdNoTaxAmount, detail.ActNoTaxAmount, detail.DiffAmount, detail.Remark, detail.Enabled)); + SecondaryActuralDiffReportDetails.Add(new SecondaryActuralDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.CustomItemCode, detail.CustomItemDesc, detail.CustomSubItemCode, detail.ErpSubItemCode, detail.CustomSubItemDesc, detail.SupplierCode, detail.SupplierDesc, detail.StaPaymentPartyQty, detail.ActPaymentPartyQty, detail.DiffQty, detail.StdNoTaxAmount, detail.ActNoTaxAmount, detail.DiffAmount, detail.Remark, detail.Enabled)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -86,8 +76,8 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports //} public virtual bool IsInDetails(string customItemCode, string customSubItemCode, string vendCode) - { - return SecondaryActuralDiffReportDetails.Any(di => di.CustomItemCode == customItemCode && di.CustomSubItemCode == customSubItemCode && di.SupplierCode == vendCode.ToUpper() && di.IsDeleted == false); + { + return SecondaryActuralDiffReportDetails.Any(di => di.CustomItemCode == customItemCode && di.CustomSubItemCode == customSubItemCode && di.SupplierCode == vendCode.ToUpper() && di.IsDeleted == false); } public virtual bool IsInDetails(Guid itemId) @@ -121,7 +111,7 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetail.cs index 2d4facfa..6ebdb7b5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportDetail.cs @@ -1,7 +1,6 @@ -using System; +using System; using System.ComponentModel.DataAnnotations; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { @@ -19,8 +18,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports /// [Display(Name = "客户总成物料号描述")] public string CustomItemDesc { get; set; } - - /// /// 客户组件物料号 @@ -36,28 +33,21 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public string ErpSubItemCode { get; set; } - - /// /// 客户组件物料号描述 /// [Display(Name = "客户组件物料号描述")] public string CustomSubItemDesc { get; set; } - - - /// /// 供应商代码 /// public string SupplierCode { private set; get; } - /// /// 供应商描述 /// - public string SupplierDesc { private set; get; } - + public string SupplierDesc { private set; get; } /// /// 标准零件数量(回款) @@ -65,29 +55,24 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public decimal StaPaymentPartyQty { get; protected set; } - /// /// 实际零件数量(回款) /// public decimal ActPaymentPartyQty { get; protected set; } - /// /// 数量差异 /// public decimal DiffQty { get; protected set; } - - /// /// 标准金额(不含税) /// public decimal StdNoTaxAmount { get; protected set; } - /// /// 实际金额(不含税) /// @@ -98,13 +83,11 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports /// 金额差异 /// - public decimal DiffAmount { get; protected set; } - + public decimal DiffAmount { get; protected set; } protected SecondaryActuralDiffReportDetail() { } - - public SecondaryActuralDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string customItemCode, string customItemDesc, string customSubItemCode,string erpSubItemCode,string customSubItemDesc, string vendCode, string vendDesc, decimal staPaymentPartyQty, decimal actPaymentPartyQty, decimal diffQty, decimal stdNoTaxAmount, decimal actNoTaxAmount, decimal diffAmount, string remark, bool enabled) : base(id) + public SecondaryActuralDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string customItemCode, string customItemDesc, string customSubItemCode, string erpSubItemCode, string customSubItemDesc, string vendCode, string vendDesc, decimal staPaymentPartyQty, decimal actPaymentPartyQty, decimal diffQty, decimal stdNoTaxAmount, decimal actNoTaxAmount, decimal diffAmount, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -112,16 +95,14 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports Year = year; Period = period; Version = version; - CustomItemCode = customItemCode; CustomItemDesc = customItemDesc; - + CustomSubItemCode = customSubItemCode; ErpSubItemCode = erpSubItemCode; CustomSubItemDesc = customSubItemDesc; - SupplierCode = vendCode; SupplierDesc = vendDesc; StaPaymentPartyQty = staPaymentPartyQty; @@ -132,13 +113,13 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports DiffAmount = diffAmount; Remark = remark; Enabled = enabled; - - } - public void Set( string remark, bool enabled) + } + + public void Set(string remark, bool enabled) { Remark = remark; Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportManager.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportManager.cs index 80daac59..16b05589 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportManager.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SecondaryActuralDiffReports/SecondaryActuralDiffReportManager.cs @@ -1,15 +1,10 @@ -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Services; -using Volo.Abp.Guids; -using Win.Sfs.SettleAccount.Prebatches; using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { @@ -30,10 +25,9 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports { _secondaryActuralDiffReportRepository = secondaryActuralDiffReportRepository; - _secondaryActuralDiffReportDetailRepository = secondaryActuralDiffReportDetailRepository; + _secondaryActuralDiffReportDetailRepository = secondaryActuralDiffReportDetailRepository; } - /// /// 根据年和月批量作废表单 /// @@ -53,7 +47,6 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports return true; } - /// /// 获取当年所有的差异信息 /// @@ -63,7 +56,7 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports public async Task> GetAllDiffInfoByYear(Guid branchId, string year) { //获取有效的未结算的数据 - var list = _secondaryActuralDiffReportRepository.GetDbSet().Where(p => p.Year == year && p.DocumentStatus != EnumDocumentStatus.New).ToList(); + var list = _secondaryActuralDiffReportRepository.GetDbSet().Where(p => p.Year == year && p.DocumentStatus != EnumDocumentStatus.New).ToList(); var billNums = list.Select(p => p.DocumentNumber).ToList(); //获取有效的未结算的明细数据 @@ -71,4 +64,4 @@ namespace Win.Sfs.SettleAccount.SecondaryActuralDiffReports return detailList; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/DiffUnsetttleReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/DiffUnsetttleReport.cs index 73098841..87aa17ab 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/DiffUnsetttleReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/DiffUnsetttleReport.cs @@ -1,12 +1,6 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Reports.SendUnsettledDiffReports { - + public class DiffUnsetttleReport { public string ItemCode { set; get; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReport.cs index cc8dfaeb..bd7f4036 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReport.cs @@ -1,15 +1,8 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; -using System.Linq; -using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; -using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; +using System.ComponentModel.DataAnnotations; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { @@ -22,7 +15,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports //public virtual List SendUnsettledDiffReportDetails { get; protected set; } - /// /// 统计时间起 /// @@ -37,15 +29,13 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports [Display(Name = "统计版本止")] public string EndVersion { get; set; } - - protected SendUnsettledDiffReport() { } public SendUnsettledDiffReport(Guid id, Guid branchId, string documentNumber, DateTime beginTime, DateTime endTime, string beginVersion, string endVersion, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, beginTime, endTime, customCode, customName, remark, creatorName) { BeginVersion = beginVersion; EndVersion = endVersion; - + UpstreamDocuments = new List(); //SendUnsettledDiffReportDetails = new List(); @@ -61,7 +51,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports Remark = remark; } - #region details handler //public virtual void AddDetail(IGuidGenerator guidGenerator, SendUnsettledDiffReportDetail detail) @@ -77,7 +66,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports // SendUnsettledDiffReportDetails.Add(new SendUnsettledDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.Status, detail.ItemCode, detail.ItemDesc, detail.OrderBillNum, detail.KENNCode, detail.Model, detail.Qty, detail.CP5Time, detail.FISYear, detail.Extend1, detail.SequenceNumber, detail.ChassisNumber, detail.ChassisNumber2, detail.SettledQty, detail.Remark, detail.Enabled)); //} - //public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) //{ // Check.NotNull(guidGenerator, nameof(guidGenerator)); @@ -138,7 +126,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports // return item; //} - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetail.cs index 02d4cff9..4cfb3613 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/SendUnsettledDiffReports/SendUnsettledDiffReportDetail.cs @@ -1,16 +1,11 @@ -using System; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Entities.Auditing; -using Win.Sfs.Shared; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; -using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports { - public class SendUnsettledDiffReportDetail : FullAuditedAggregateRootBase + public class SendUnsettledDiffReportDetail : FullAuditedAggregateRootBase { - //public Guid BranchId { set; get; } + //public Guid BranchId { set; get; } /// /// 年度 @@ -22,13 +17,11 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public string Period { set; get; } - /// /// 版本 /// public string Version { set; get; } - /// /// 单据ID /// @@ -39,7 +32,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public string DocumentNumber { get; set; } - /// /// 订单号 /// @@ -50,7 +42,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public string KENNCode { set; get; } - /// /// 物品编码 /// @@ -73,7 +64,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports public decimal Qty { get; protected set; } - /// /// CP5上线时间 /// @@ -84,13 +74,11 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public string FISYear { private set; get; } - /// /// Kao号 /// public string Extend1 { private set; get; } - /// /// 顺序号 /// @@ -106,8 +94,6 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public string ChassisNumber2 { private set; get; } - - /// /// 结算数量 /// @@ -119,11 +105,9 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports /// public int Status { private set; get; } - protected SendUnsettledDiffReportDetail() { } - - public SendUnsettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, int detailStatus, string itemCode, string itemDesc, string orderBillNum, string kENNCode, string model, decimal qty, DateTime cp5Time, string fisYear, string kaoNum, string seqNum, string vinCode, string chassisNumber2, decimal settledQty, string remark, bool enabled) :base(id) + public SendUnsettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, int detailStatus, string itemCode, string itemDesc, string orderBillNum, string kENNCode, string model, decimal qty, DateTime cp5Time, string fisYear, string kaoNum, string seqNum, string vinCode, string chassisNumber2, decimal settledQty, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -132,14 +116,13 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports Period = period; Version = version; Status = detailStatus; - + ItemCode = itemCode; ItemDesc = itemDesc; OrderBillNum = orderBillNum; KENNCode = kENNCode; - Model = model; Qty = qty; CP5Time = cp5Time; @@ -157,10 +140,7 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports //Enabled = enabled; } - - - - public void Set(Guid id,Guid branchId, Guid documentId, string documentNumber ) + public void Set(Guid id, Guid branchId, Guid documentId, string documentNumber) { Id = id; BranchId = branchId; @@ -168,6 +148,5 @@ namespace Win.Sfs.SettleAccount.SendUnsettledDiffReports DocumentNumber = documentNumber; } - } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReport.cs index 5bac18e1..9dbcf291 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockFisDiffReports { @@ -19,16 +14,12 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// public class StockFisDiffReport : SettleAccountDocumentRootBase { - - public virtual List StockFisDiffReportDetails { get; protected set; } - - protected StockFisDiffReport() { } - public StockFisDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public StockFisDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -46,19 +37,18 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, StockFisDiffReportDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); Check.NotNull(detail, nameof(StockFisDiffReportDetail)); - if (IsInDetails( detail.ItemCode)) + if (IsInDetails(detail.ItemCode)) { //to do 需要规范异常的处理逻辑 throw new Exception(detail.ItemCode + "已经在明细中存在!"); } - StockFisDiffReportDetails.Add(new StockFisDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.ItemCode, detail.ItemDesc, detail.CustomCode, detail.EstimationType, detail.FisQty, detail.StockQty, detail.DiffQty, detail.Remark, detail.Enabled)); + StockFisDiffReportDetails.Add(new StockFisDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.ItemCode, detail.ItemDesc, detail.CustomCode, detail.EstimationType, detail.FisQty, detail.StockQty, detail.DiffQty, detail.Remark, detail.Enabled)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -85,9 +75,9 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports // } //} - public virtual bool IsInDetails( string itemCode) + public virtual bool IsInDetails(string itemCode) { - return StockFisDiffReportDetails.Any(di =>di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); + return StockFisDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); } public virtual bool IsInDetails(Guid itemId) @@ -121,7 +111,7 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReportDetail.cs index 31ea0fbd..0f9c7652 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockFisDiffReports/StockSettledDiffReportDetail.cs @@ -1,6 +1,5 @@ -using System; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockFisDiffReports { @@ -28,8 +27,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports public string CustomCode { get; protected set; } - - /// /// Fis数量 /// @@ -38,18 +35,15 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports /// /// ERP客户库位入库数量 /// - public decimal StockQty { private set; get; } + public decimal StockQty { private set; get; } /// /// 差异数量 /// public decimal DiffQty { private set; get; } - - protected StockFisDiffReportDetail() { } - public StockFisDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string customCode, string estimationType, decimal fisQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) { BranchId = branchId; @@ -60,7 +54,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports Period = period; Version = version; - ItemCode = itemCode; ItemDesc = itemDesc; EstimationType = estimationType; @@ -74,7 +67,6 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports Enabled = enabled; } - public void Set(string remark, bool enabled) { @@ -82,4 +74,4 @@ namespace Win.Sfs.SettleAccount.StockFisDiffReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReport.cs index b0861d0c..77935073 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockSettledDiffReports { @@ -19,16 +14,12 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports /// public class StockSettledDiffReport : SettleAccountDocumentRootBase { - - public virtual List StockSettledDiffReportDetails { get; protected set; } - - protected StockSettledDiffReport() { } - public StockSettledDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public StockSettledDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -46,7 +37,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, StockSettledDiffReportDetail detail) { @@ -58,7 +48,7 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports throw new Exception(detail.ItemCode + "已经在明细中存在!"); } - StockSettledDiffReportDetails.Add(new StockSettledDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.ItemCode, detail.ItemDesc, detail.CustomCode, detail.EstimationType, detail.R3SettledQty, detail.StockQty, detail.DiffQty, detail.Remark, detail.Enabled)); + StockSettledDiffReportDetails.Add(new StockSettledDiffReportDetail(guidGenerator.Create(), BranchId, Id, DocumentNumber, detail.Year, detail.Period, detail.Version, detail.ItemCode, detail.ItemDesc, detail.CustomCode, detail.EstimationType, detail.R3SettledQty, detail.StockQty, detail.DiffQty, detail.Remark, detail.Enabled)); } public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) @@ -85,7 +75,7 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports // } //} - public virtual bool IsInDetails( string itemCode) + public virtual bool IsInDetails(string itemCode) { return StockSettledDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); } @@ -121,7 +111,7 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReportDetail.cs index 9f764465..4e92223f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockSettledDiffReports/StockSettledDiffReportDetail.cs @@ -1,6 +1,5 @@ -using System; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockSettledDiffReports { @@ -29,8 +28,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports public string CustomCode { get; protected set; } - - /// /// R3计算数量 /// @@ -39,19 +36,16 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports /// /// Erp出库数量 /// - public decimal StockQty { private set; get; } + public decimal StockQty { private set; get; } /// /// 差异数量 /// public decimal DiffQty { private set; get; } - - protected StockSettledDiffReportDetail() { } - - public StockSettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version,string itemCode, string itemDesc, string customCode, string estimationType, decimal r3SettledQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) + public StockSettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string customCode, string estimationType, decimal r3SettledQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -61,7 +55,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports Period = period; Version = version; - ItemCode = itemCode; ItemDesc = itemDesc; EstimationType = estimationType; @@ -75,7 +68,6 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports Enabled = enabled; } - public void Set(string remark, bool enabled) { @@ -83,4 +75,4 @@ namespace Win.Sfs.SettleAccount.StockSettledDiffReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReport.cs index 62242392..cdfbeb4a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReport.cs @@ -1,15 +1,10 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared.DomainBase; - -using Win.Sfs.Shared.Constant; +using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.Guids; -using Win.Sfs.Shared.Enums; using Win.Sfs.SettleAccount.Bases; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { @@ -19,16 +14,12 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// public class StockUnsettledDiffReport : SettleAccountDocumentRootBase { - - public virtual List StockUnsettledDiffReportDetails { get; protected set; } - - protected StockUnsettledDiffReport() { } - public StockUnsettledDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark,string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) + public StockUnsettledDiffReport(Guid id, Guid branchId, string documentNumber, string year, string period, string version, string customCode, string customName, string remark, string creatorName) : base(id, branchId, documentNumber, year, period, version, customCode, customName, remark, creatorName) { UpstreamDocuments = new List(); @@ -46,13 +37,12 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports Remark = remark; } - #region details handler public virtual void AddDetail(IGuidGenerator guidGenerator, StockUnsettledDiffReportDetail detail) { Check.NotNull(guidGenerator, nameof(guidGenerator)); Check.NotNull(detail, nameof(StockUnsettledDiffReportDetail)); - if (IsInDetails( detail.ItemCode)) + if (IsInDetails(detail.ItemCode)) { //to do 需要规范异常的处理逻辑 throw new Exception(detail.ItemCode + "已经在明细中存在!"); @@ -87,7 +77,7 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports public virtual bool IsInDetails(string itemCode) { - return StockUnsettledDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); + return StockUnsettledDiffReportDetails.Any(di => di.ItemCode == itemCode.ToUpper() && di.IsDeleted == false); } public virtual bool IsInDetails(Guid itemId) @@ -121,7 +111,7 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports return item; } - #endregion - + #endregion + } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetail.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetail.cs index 0b87b051..d6ce7964 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetail.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Reports/StockUnsettledDiffReports/StockUnsettledDiffReportDetail.cs @@ -1,6 +1,5 @@ -using System; +using System; using Win.Sfs.Shared.DomainBase; -using Win.Sfs.Shared.Enums; namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports { @@ -22,16 +21,12 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports public string CustomCode { get; protected set; } - - /// /// 暂估类 /// public string EstimationType { get; protected set; } - - /// /// Fis未结数量 /// @@ -42,20 +37,14 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports /// public decimal StockQty { private set; get; } - - - /// /// 差异数量 /// public decimal DiffQty { private set; get; } - - protected StockUnsettledDiffReportDetail() { } - - public StockUnsettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string customCode, string estimationType, decimal fisUnSettledQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) + public StockUnsettledDiffReportDetail(Guid id, Guid branchId, Guid documentId, string documentNumber, string year, string period, string version, string itemCode, string itemDesc, string customCode, string estimationType, decimal fisUnSettledQty, decimal stockQty, decimal diffQty, string remark, bool enabled) : base(id) { BranchId = branchId; DocumentId = documentId; @@ -72,15 +61,13 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports EstimationType = estimationType; FisUnSettledQty = fisUnSettledQty; StockQty = stockQty; - + DiffQty = diffQty; Remark = remark; Enabled = enabled; } - - public void Set(string remark, bool enabled) { @@ -88,4 +75,4 @@ namespace Win.Sfs.SettleAccount.StockUnsettledDiffReports Enabled = enabled; } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/Helper.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/Helper.cs index b7f82070..46ddf00f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/Helper.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/Helper.cs @@ -1,7 +1,3 @@ -using Magicodes.ExporterAndImporter.Core; -using NPOI.HSSF.UserModel; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; using System.Data; @@ -9,39 +5,35 @@ using System.Globalization; using System.IO; using System.Linq; using System.Reflection; -using System.Text; using System.Threading; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using NPOI.HSSF.UserModel; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; using Volo.Abp; using Win.Sfs.SettleAccount.Entities.ImportMap; namespace Win.Sfs.SettleAccount { - - - public class RepeatSubmit { public string ClassName { set; get; } public string ModthName { set; get; } - - public DateTime SubmitDateTime{ set; get; } + public DateTime SubmitDateTime { set; get; } } - //public static class SettleAccountHelper //{ // List<> //} - public class ExcelHelper { private IWorkbook _workbook; - private string _filePath; + private readonly string _filePath; public List GetSheetNames { get; set; } public List SheetNames { get; set; } @@ -99,8 +91,6 @@ namespace Win.Sfs.SettleAccount return GetSheetNames; } - - #endregion #region 获取数据源 @@ -133,7 +123,10 @@ namespace Win.Sfs.SettleAccount public DataTable GetTable(int idx, bool isFirstRowCoumn) { if (idx >= SheetNames.Count || idx < 0) + { throw new Exception("Do not Get This Sheet"); + } + return ExcelToDataTable(SheetNames[idx], isFirstRowCoumn); } @@ -159,20 +152,21 @@ namespace Win.Sfs.SettleAccount /// 返回的DataTable public DataTable ExcelToDataTable(string sheetName, bool isFirstRowColumn) { - ISheet sheet = null; var data = new DataTable(); data.TableName = sheetName; - int startRow = 0; try { - sheet = sheetName != null ? _workbook.GetSheet(sheetName) : _workbook.GetSheetAt(0); + var sheet = sheetName != null ? _workbook.GetSheet(sheetName) : _workbook.GetSheetAt(0); if (sheet != null) { var firstRow = sheet.GetRow(0); if (firstRow == null) + { return data; + } + int cellCount = firstRow.LastCellNum; //一行最后一个cell的编号 即总的列数 - startRow = isFirstRowColumn ? sheet.FirstRowNum + 1 : sheet.FirstRowNum; + var startRow = isFirstRowColumn ? sheet.FirstRowNum + 1 : sheet.FirstRowNum; for (int i = firstRow.FirstCellNum; i < cellCount; ++i) { @@ -196,18 +190,26 @@ namespace Win.Sfs.SettleAccount for (int i = startRow; i <= rowCount; ++i) { IRow row = sheet.GetRow(i); - if (row == null) continue; //没有数据的行默认是null        + if (row == null) + { + continue; //没有数据的行默认是null        + } DataRow dataRow = data.NewRow(); for (int j = row.FirstCellNum; j < cellCount; ++j) { if (row.GetCell(j) != null) //同理,没有数据的单元格都默认是null + { dataRow[j] = row.GetCell(j, MissingCellPolicy.RETURN_NULL_AND_BLANK).ToString(); + } } data.Rows.Add(dataRow); } } - else throw new Exception("Don not have This Sheet"); + else + { + throw new Exception("Don not have This Sheet"); + } return data; } @@ -240,7 +242,6 @@ namespace Win.Sfs.SettleAccount } - public List ExcelToListOne() where T : class, new() { @@ -252,14 +253,13 @@ namespace Win.Sfs.SettleAccount // _ls.AddRange(list); //} - var sheet = _workbook.GetSheetAt(0); + var sheet = _workbook.GetSheetAt(0); var list = ExportToList(sheet); _ls.AddRange(list); return _ls; } - /// /// 实体字段 /// @@ -279,11 +279,6 @@ namespace Win.Sfs.SettleAccount return _ls; } - - - - - /// /// Sheet中的数据转换为List集合 /// @@ -322,9 +317,9 @@ namespace Win.Sfs.SettleAccount for (int i = firstRow.FirstCellNum; i < cellCount; ++i) { var _columnName = firstRow.GetCell(i).StringCellValue; - if (_dic.ContainsKey(_columnName)) + if (_dic.TryGetValue(_columnName, out var value)) { - var propertyName = _dic[_columnName]; + var propertyName = value; _dicList.Add(i, propertyName); } } @@ -335,7 +330,11 @@ namespace Win.Sfs.SettleAccount for (int i = startRow; i <= rowCount; ++i) { IRow row = sheet.GetRow(i); - if (row == null) continue; + if (row == null) + { + continue; + } + T t = new T(); for (int j = row.FirstCellNum; j < cellCount; ++j) { @@ -349,12 +348,14 @@ namespace Win.Sfs.SettleAccount object cellValue = null; if (row.GetCell(j) != null) //同理,没有数据的单元格都默认是null + { cellValue = row.GetCell(j, MissingCellPolicy.RETURN_NULL_AND_BLANK).ToString(); + } + try { string propertyName = type.GetProperty(_dicList[j]).PropertyType.Name; - switch (propertyName) { case "DateTime": @@ -379,7 +380,6 @@ namespace Win.Sfs.SettleAccount string str = e.Message; } - } //同理,没有数据的单元格都默认是null } @@ -391,7 +391,6 @@ namespace Win.Sfs.SettleAccount return _ls; } - /// /// Sheet中的数据转换为List集合 /// @@ -434,9 +433,9 @@ namespace Win.Sfs.SettleAccount for (int i = firstRow.FirstCellNum; i < cellCount; ++i) { var _columnName = firstRow.GetCell(i).StringCellValue; - if (_dic.ContainsKey(_columnName)) + if (_dic.TryGetValue(_columnName, out var value)) { - var propertyName = _dic[_columnName]; + var propertyName = value; _dicList.Add(i, propertyName); } } @@ -446,7 +445,11 @@ namespace Win.Sfs.SettleAccount for (int i = startRow; i <= rowCount; ++i) { IRow row = sheet.GetRow(i); - if (row == null) continue; + if (row == null) + { + continue; + } + T t = new T(); for (int j = row.FirstCellNum; j < cellCount; ++j) { @@ -460,12 +463,14 @@ namespace Win.Sfs.SettleAccount object cellValue = null; if (row.GetCell(j) != null) //同理,没有数据的单元格都默认是null + { cellValue = row.GetCell(j, MissingCellPolicy.RETURN_NULL_AND_BLANK).ToString(); + } + try { string propertyName = type.GetProperty(_dicList[j]).PropertyType.Name; - switch (propertyName) { case "DateTime": @@ -500,7 +505,6 @@ namespace Win.Sfs.SettleAccount } } - public static class DataTableHelper { @@ -513,13 +517,11 @@ namespace Win.Sfs.SettleAccount return null; } - Type type = typeof(T); List arrayColumn = GetColumnsByDataTable(dtSource); foreach (DataRow dataRow in dtSource.Rows) { - Object entity = Activator.CreateInstance(type); //创建实例                   PropertyInfo[] listPro = type.GetProperties(BindingFlags.Public | BindingFlags.Instance);//Instance|Public:获取公共的的实例属性(非静态的)  Static|Public:获取公共的静态属性  Instance|Static|Public:获取公共的的实例或静态属性                 foreach (PropertyInfo entityCols in listPro) @@ -529,7 +531,6 @@ namespace Win.Sfs.SettleAccount { object cellvalue = dataRow[columnName]; - if (columnName != null && dataRow[columnName] != null && dataRow[columnName] != DBNull.Value ) @@ -542,7 +543,6 @@ namespace Win.Sfs.SettleAccount else { - Type genericTypeDefinition = entityCols.PropertyType.GetGenericTypeDefinition(); if (genericTypeDefinition == typeof(Nullable<>)) { @@ -553,23 +553,18 @@ namespace Win.Sfs.SettleAccount } } - list.Add((T)entity); } - return list; } -         #endregion -         public static List GetColumnsByDataTable(DataTable dt) { List strColumns = new List(); - if (dt != null && dt.Columns.Count > 0) { for (int i = 0; i < dt.Columns.Count; i++) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettingDefinitionProvider.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettingDefinitionProvider.cs index 2b7c14ad..6351d90f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettingDefinitionProvider.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettingDefinitionProvider.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Settings; +using Volo.Abp.Settings; namespace SettleAccount.Settings { @@ -11,4 +11,4 @@ namespace SettleAccount.Settings */ } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettings.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettings.cs index eae8091e..122d8a77 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettings.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Settings/SettleAccountSettings.cs @@ -1,4 +1,4 @@ -namespace SettleAccount.Settings +namespace SettleAccount.Settings { public static class SettleAccountSettings { @@ -8,4 +8,4 @@ * public const string MySettingName = GroupName + ".MySettingName"; */ } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDbProperties.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDbProperties.cs index d3916e53..5906d0df 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDbProperties.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDbProperties.cs @@ -1,10 +1,10 @@ -namespace Win.Sfs.SettleAccount +namespace Win.Sfs.SettleAccount { public static class SettleAccountDbProperties { public static string DbTablePrefix { get; set; } = "Set"; - public static string DbSchema { get; set; } = null; + public static string DbSchema { get; set; } public const string ConnectionStringName = "SettleAccount"; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDomainModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDomainModule.cs index 0a9b17e5..55d3b3cb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDomainModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccountDomainModule.cs @@ -1,7 +1,3 @@ - -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; using Volo.Abp.Domain; using Volo.Abp.Modularity; @@ -10,12 +6,10 @@ namespace Win.Sfs.SettleAccount [DependsOn( typeof(AbpDddDomainModule), typeof(SettleAccountDomainSharedModule) - + )] public class SettleAccountDomainModule : AbpModule { - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ExChangeCenterDbContext.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ExChangeCenterDbContext.cs index 5df596aa..5fa9a392 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ExChangeCenterDbContext.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ExChangeCenterDbContext.cs @@ -1,32 +1,24 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Win.Sfs.SettleAccount.Entities.BQ; -namespace Win.Sfs.SettleAccount.EntityFrameworkCore; - - -[ConnectionStringName("WMSBJBMPT")] - -public class ExChangeCenterDbContext:DbContext +namespace Win.Sfs.SettleAccount.EntityFrameworkCore { - public DbSet TED_SA_INV { set; get; } + [ConnectionStringName("WMSBJBMPT")] - - public ExChangeCenterDbContext(DbContextOptions options) : base(options) + public class ExChangeCenterDbContext : DbContext { - } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); - } + public DbSet TED_SA_INV { set; get; } + public ExChangeCenterDbContext(DbContextOptions options) : base(options) + { + } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ISettleAccountDbContext.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ISettleAccountDbContext.cs index e006e4d2..1cd8a8ef 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ISettleAccountDbContext.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/ISettleAccountDbContext.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Data; +using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount @@ -24,4 +24,4 @@ namespace Win.Sfs.SettleAccount * DbSet Questions { get; } */ } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs index 2cd8c59e..e8fe6ef9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountDbContextModelCreatingExtensions.cs @@ -13,10 +13,8 @@ using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.Controls; -using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.Entities.SettleAccounts; using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.Shared; using Win.Sfs.Shared.Constant; @@ -113,7 +111,6 @@ namespace Win.Sfs.SettleAccount builder.ConfigureHBPO_PD(options); builder.ConfigurePUB_PD(options); - //builder.ConfigureTED_SA_INV(options); //大众发票导入 //builder.ConfigureInvoice(options); @@ -322,197 +319,8 @@ namespace Win.Sfs.SettleAccount } #endregion 基础数据 - #region 北汽 - /// - /// 一汽轿车平台验收结算明细-导入 - /// - /// - /// - //private static void ConfigureHQCar(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - //{ - // builder.Entity(b => - // { - // b.ToTable($"{options.TablePrefix}_HQ_Car_Platform", options.Schema); - - // b.ConfigureByConvention(); - // b.Property(x => x.HQCarKanBan).HasMaxLength(150);//看板号(一汽轿车没有看板号) - // b.Property(x => x.MaterialVoucherNo).HasMaxLength(150); - // b.Property(x => x.Factory).HasMaxLength(50); - // b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150); - // b.Property(x => x.ExternalKanbanNumber).HasMaxLength(50); - // b.Property(x => x.KanbanNumber).HasMaxLength(150);//看板编号 - // b.Property(x => x.Period).HasMaxLength(50); - // b.Property(x => x.Year).HasMaxLength(50); - // b.Property(x => x.Version).HasMaxLength(50); - // b.Property(x => x.Supplier).HasMaxLength(50); - // b.Property(x => x.StorageLocation).HasMaxLength(50); - // b.Property(x => x.StorageLocationDesc).HasMaxLength(150); - // //创建组合索引 - // b.HasIndex(x => new { x.Version, x.KanbanNumber, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); - - // }); - //} - - //private static void ConfigureHQCarVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - //{ - // builder.Entity(b => - // { - // b.ToTable($"{options.TablePrefix}_HQ_Car_PlatformVersion", options.Schema); - // b.ConfigureByConvention(); - // b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); - // b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); - // }); - - //} - /// - /// 红旗主机场-未结明细-导入 - /// - /// - /// - //private static void ConfigureUnHQSettleAccount(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - //{ - // builder.Entity(b => - // { - // b.ToTable($"{options.TablePrefix}_UnHQSettleAccount", options.Schema); - - // b.ConfigureByConvention(); - // //b.Property(x => x.HQHKanBan).IsRequired().HasMaxLength(150);//必填项 - // b.Property(x => x.HQHKanBan).HasMaxLength(150);//有空的情况 - // b.Property(x => x.MaterialVoucherNo).HasMaxLength(150); - // b.Property(x => x.Factory).HasMaxLength(50); - // b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(150); - // b.Property(x => x.ExternalKanbanNumber).HasMaxLength(50); - // b.Property(x => x.KanbanNumber).HasMaxLength(150); - // b.Property(x => x.Period).HasMaxLength(50); - // b.Property(x => x.Year).HasMaxLength(50); - // b.Property(x => x.Version).HasMaxLength(50); - // b.Property(x => x.Supplier).HasMaxLength(50); - // b.Property(x => x.StorageLocation).HasMaxLength(50); - // b.Property(x => x.StorageLocationDesc).HasMaxLength(150); - // b.Property(x => x.AcceptanceNo).HasMaxLength(50); - - // //创建组合索引 - // //b.HasIndex(x => new { x.Version, x.HQHKanBan, x.MaterialCode }).IsUnique().HasFilter(IsDeletedFilter); - - // }); - //} - - /// - /// 红旗主机场-未结明细-版本 - /// - /// - /// - //private static void ConfigureUnHQSettleAccountVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - //{ - // builder.Entity(b => - // { - // b.ToTable($"{options.TablePrefix}_UnHQSettleAccountVersion", options.Schema); - // b.ConfigureByConvention(); - // b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); - // b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); - // }); - - //} - - /// - /// 大众发票汇总导入 - /// - /// - /// - //private static void ConfigureInvoice(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - //{ - // builder.Entity(b => - // { - // b.ToTable($"{options.TablePrefix}_Invoice", options.Schema); - - // b.ConfigureByConvention(); - // b.Property(x => x.Year).HasMaxLength(50); - // b.Property(x => x.Period).HasMaxLength(50); - // b.Property(x => x.Version).HasMaxLength(50); - // b.Property(x => x.Factory).HasMaxLength(50); - // b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(50);//零件号不能为空 - // b.Property(x => x.MaterialDesc).HasMaxLength(50); - // b.Property(x => x.Remark).HasMaxLength(1000); - - // }); - //} - /// - /// 大众发票汇总导入-版本 - /// - /// - /// - private static void ConfigureInvoiceVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - { - builder.Entity(b => - { - b.ToTable($"{options.TablePrefix}_InvoiceVersion", options.Schema); - - b.ConfigureByConvention(); - b.Property(x => x.Year).HasMaxLength(50); - b.Property(x => x.Period).HasMaxLength(50); - b.Property(x => x.Version).HasMaxLength(50); - b.Property(x => x.CustomerCode).HasMaxLength(50); - // b.Property(x => x.Factory).HasMaxLength(50); - }); - } - - /// - /// 大众准时化结算明细导入 - /// - /// - /// - //private static void ConfigureSettleAccount(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - //{ - // builder.Entity(b => - // { - // b.ToTable($"{options.TablePrefix}_Settle", options.Schema); - // b.ConfigureByConvention(); - - // b.Property(x => x.KENNCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - - // b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Year).HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Period).HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.MaterialCode).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.Qty).IsRequired(); - // b.Property(x => x.Model).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.SettlementID).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.SettlementSupplier).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // b.Property(x => x.ChassisNumber).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - // //b.Property(x => x.SettlementSupplier).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - - // b.Property(x => x.Enabled); - // b.HasIndex(x => new { x.state }); - // b.HasIndex(x => new { x.Version, x.ChassisNumber, x.MaterialCode, x.KENNCode }); - // }); - //} - /// - /// 大众准时化结算明细导入-版本 - /// - /// - /// - private static void ConfigureSettleAccountVersion(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) - { - builder.Entity(b => - { - b.ToTable($"{options.TablePrefix}_Settle_Version", options.Schema); - b.ConfigureByConvention(); - b.Property(x => x.Year).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.Period).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.Version).IsRequired().HasMaxLength(CommonConsts.MaxCodeLength); - b.Property(x => x.CustomerCode).HasMaxLength(CommonConsts.MaxCodeLength); - b.HasIndex(x => new { x.Version }).IsUnique().HasFilter(IsDeletedFilter); - }); - } - private static void ConfigureTaskJob(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { builder.Entity(b => @@ -1283,12 +1091,6 @@ namespace Win.Sfs.SettleAccount // }); //} - - - - - - private static void ConfigureBBAC_ADJ_DETAIL(this ModelBuilder builder, SettleAccountModelBuilderConfigurationOptions options) { //builder.Entity(b => diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs index 43689a01..28176f61 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountEntityFrameworkCoreModule.cs @@ -1,6 +1,4 @@ -using System.Configuration; using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Internal; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AuditLogging.EntityFrameworkCore; using Volo.Abp.Dapper; @@ -16,10 +14,8 @@ using Win.Sfs.SettleAccount.BTStockUnsettledDiffReports; using Win.Sfs.SettleAccount.EntityFrameworkCore; using Win.Sfs.SettleAccount.EstimatedStockDiffReports; using Win.Sfs.SettleAccount.Repository; -using Win.Sfs.SettleAccount.Repository.SettleAccount; using Win.Sfs.SettleAccount.SecondaryActuralAdjustmentReports; using Win.Sfs.SettleAccount.SecondaryActuralDiffReports; -using Win.Sfs.SettleAccount.SendUnsettledDiffReports; using Win.Sfs.SettleAccount.StockFisDiffReports; using Win.Sfs.SettleAccount.StockSettledDiffReports; using Win.Sfs.SettleAccount.StockUnsettledDiffReports; @@ -47,7 +43,6 @@ namespace Win.Sfs.SettleAccount ConfigureRepository(context); } - private static void ConfigureRepository(ServiceConfigurationContext context) { context.Services.AddAbpDbContext(options => @@ -89,7 +84,7 @@ namespace Win.Sfs.SettleAccount private void ConfigureDbContext() { Configure(options => { options.UseSqlServer(); }); - + } private void ConfigureEntity() @@ -103,7 +98,6 @@ namespace Win.Sfs.SettleAccount orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.EstimatedStockDiffReportDetails); }); - options.Entity(orderOptions => { orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.StockUnsettledDiffReportDetails); @@ -124,13 +118,11 @@ namespace Win.Sfs.SettleAccount orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.SecondaryActuralAdjustmentReportDetails); }); - options.Entity(orderOptions => { orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.SecondaryActuralDiffReportDetails); }); - //options.Entity(orderOptions => //{ // orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.SendUnsettledDiffReportDetails); @@ -141,13 +133,11 @@ namespace Win.Sfs.SettleAccount orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.BTNotConsignReportDetails); }); - options.Entity(orderOptions => { orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.BTSeqKBDiffReportDetails); }); - options.Entity(orderOptions => { orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.BTStockUnsettledDiffReportDetails); @@ -155,9 +145,6 @@ namespace Win.Sfs.SettleAccount #endregion - - - }); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountModelBuilderConfigurationOptions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountModelBuilderConfigurationOptions.cs index b5b4d8cb..797e8254 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountModelBuilderConfigurationOptions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/SettleAccountModelBuilderConfigurationOptions.cs @@ -1,4 +1,4 @@ -using JetBrains.Annotations; +using JetBrains.Annotations; using Volo.Abp.EntityFrameworkCore.Modeling; namespace Win.Sfs.SettleAccount @@ -15,4 +15,4 @@ namespace Win.Sfs.SettleAccount } } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDapperRepository.cs index b595fc55..5e90db47 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDapperRepository.cs @@ -1,29 +1,24 @@ -using Dapper; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Data; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.EntityFrameworkCore; namespace Win.Sfs.SettleAccount { public class FisOutputDapperRepository : DapperRepository, ITransientDependency { - public FisOutputDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - [UnitOfWork(false)] public virtual bool Execute(string billnum, string date) { @@ -41,22 +36,19 @@ namespace Win.Sfs.SettleAccount return true; } - - - public virtual async Task> GetListBySqlAsync(string sql, bool isTrans = false) { if (isTrans) { - IDbConnection conn = await GetDbConnectionAsync(); - IDbTransaction trans = await GetDbTransactionAsync(); - return (await conn.QueryAsync(sql, null, trans)) + IDbConnection conn = await GetDbConnectionAsync().ConfigureAwait(false); + IDbTransaction trans = await GetDbTransactionAsync().ConfigureAwait(false); + return (await conn.QueryAsync(sql, null, trans).ConfigureAwait(false)) .ToList(); } else { - IDbConnection conn = await GetDbConnectionAsync(); - return (await conn.QueryAsync(sql)) + IDbConnection conn = await GetDbConnectionAsync().ConfigureAwait(false); + return (await conn.QueryAsync(sql).ConfigureAwait(false)) .ToList(); } } @@ -65,36 +57,34 @@ namespace Win.Sfs.SettleAccount { if (isTrans) { - IDbConnection conn = await GetDbConnectionAsync(); - IDbTransaction trans = await GetDbTransactionAsync(); - return await conn.QuerySingleOrDefaultAsync(sql, null, trans); + IDbConnection conn = await GetDbConnectionAsync().ConfigureAwait(false); + IDbTransaction trans = await GetDbTransactionAsync().ConfigureAwait(false); + return await conn.QuerySingleOrDefaultAsync(sql, null, trans).ConfigureAwait(false); } else { - IDbConnection conn = await GetDbConnectionAsync(); - return await conn.QuerySingleOrDefaultAsync(sql); + IDbConnection conn = await GetDbConnectionAsync().ConfigureAwait(false); + return await conn.QuerySingleOrDefaultAsync(sql).ConfigureAwait(false); } } - public virtual async Task ExecuteSqlAsync(string sql, object obj = null, bool isTrans = false) { if (isTrans) { //return await DbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name }, DbTransaction); - IDbConnection conn = await GetDbConnectionAsync(); - IDbTransaction trans = await GetDbTransactionAsync(); - return await conn.ExecuteAsync(sql, obj, trans); + IDbConnection conn = await GetDbConnectionAsync().ConfigureAwait(false); + IDbTransaction trans = await GetDbTransactionAsync().ConfigureAwait(false); + return await conn.ExecuteAsync(sql, obj, trans).ConfigureAwait(false); } else { //return await DbConnection.ExecuteAsync("update People set Name = @NewName", new { NewName = name }, DbTransaction); - IDbConnection conn = await GetDbConnectionAsync(); - return await conn.ExecuteAsync(sql, obj); + IDbConnection conn = await GetDbConnectionAsync().ConfigureAwait(false); + return await conn.ExecuteAsync(sql, obj).ConfigureAwait(false); } } - #region 同步方法 public virtual List GetListBySql(string sql, bool isTrans = false) { @@ -128,7 +118,6 @@ namespace Win.Sfs.SettleAccount } } - public virtual int ExecuteSql(string sql, object obj = null, bool isTrans = false) { if (isTrans) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDbContext.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDbContext.cs index f37664c1..652af3ed 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDbContext.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/UnInterfaceDbContext.cs @@ -1,16 +1,6 @@ - using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Data; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities; - - namespace Win.Sfs.SettleAccount.EntityFrameworkCore { @@ -18,7 +8,6 @@ namespace Win.Sfs.SettleAccount.EntityFrameworkCore public class UnInterfaceDbContext : AbpDbContext, IUnInterfaceDbContext { #region DbSet - #endregion @@ -32,16 +21,11 @@ namespace Win.Sfs.SettleAccount.EntityFrameworkCore this.Database.SetCommandTimeout(System.TimeSpan.FromMinutes(30)); } - - protected override void OnModelCreating(ModelBuilder builder) { base.OnModelCreating(builder); - } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSBJBMPTDbContext.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSBJBMPTDbContext.cs index 8cc2fa6d..42b35fd7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSBJBMPTDbContext.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/EntityFrameworkCore/WMSBJBMPTDbContext.cs @@ -2,38 +2,39 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; -namespace Win.Sfs.SettleAccount.EntityFrameworkCore; - -[ConnectionStringName("WMSBJBMPT")] -public class WMSBJBMPTDbContext : DbContext +namespace Win.Sfs.SettleAccount.EntityFrameworkCore { - public DbSet TM_BJBMPT_JIT_RECORD { get; set; } - public DbSet TM_BJBMPT_JIS_RECORD { get; set; } - public DbSet TM_BJBMPT_OTHER_RECORD { get; set; } - - public WMSBJBMPTDbContext() + [ConnectionStringName("WMSBJBMPT")] + public class WMSBJBMPTDbContext : DbContext { - } + public DbSet TM_BJBMPT_JIT_RECORD { get; set; } + public DbSet TM_BJBMPT_JIS_RECORD { get; set; } + public DbSet TM_BJBMPT_OTHER_RECORD { get; set; } - public WMSBJBMPTDbContext(DbContextOptions options) : base(options) - { - } + public WMSBJBMPTDbContext() + { + } - //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - //{ - // if (!optionsBuilder.IsConfigured) - // { - // IConfiguration config = new ConfigurationBuilder() - // .SetBasePath(Directory.GetCurrentDirectory()) - // .AddJsonFile("appsettings.json") - // .Build(); - // var ConnectStr = config.GetConnectionString("WMSBJBMPT"); - // optionsBuilder.UseSqlServer(ConnectStr); - // } - //} + public WMSBJBMPTDbContext(DbContextOptions options) : base(options) + { + } - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - base.OnModelCreating(modelBuilder); + //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + //{ + // if (!optionsBuilder.IsConfigured) + // { + // IConfiguration config = new ConfigurationBuilder() + // .SetBasePath(Directory.GetCurrentDirectory()) + // .AddJsonFile("appsettings.json") + // .Build(); + // var ConnectStr = config.GetConnectionString("WMSBJBMPT"); + // optionsBuilder.UseSqlServer(ConnectStr); + // } + //} + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710050546_init.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710050546_init.cs index c47dd904..ac1e6e08 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710050546_init.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710050546_init.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710062137_20230710-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710062137_20230710-1.cs index d3e50b0a..9368ce7e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710062137_20230710-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230710062137_20230710-1.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711014038_20230711-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711014038_20230711-1.cs index 32513709..161e7ef7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711014038_20230711-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711014038_20230711-1.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.cs index 0d126218..8528ced3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230711073528_20230711-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230712032712_20230712-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230712032712_20230712-1.cs index 2c1a66cc..137857b5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230712032712_20230712-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230712032712_20230712-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.cs index 7a39f4a0..a1c0fc87 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230713031306_20230713-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714030100_20230714-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714030100_20230714-1.cs index 1d1e4e3e..1ead0f5b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714030100_20230714-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714030100_20230714-1.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714033202_20230714-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714033202_20230714-2.cs index 2d171f3b..55d71a1d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714033202_20230714-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714033202_20230714-2.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.cs index c2ad7a52..fd34eafa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230714063941_20230714-3.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.cs index d0175d33..7b1c8f2b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718010724_20230718-1.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.cs index 77e81861..31348d7d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230718011250_20230718-2.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.cs index ae770aaa..b380926b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719004135_20230719-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.cs index ac0f43e7..27d23d6c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719022720_20230719-2.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719032116_vmi.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719032116_vmi.cs index fa994ad1..3d9f1b77 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719032116_vmi.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719032116_vmi.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719053130_20230719-3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719053130_20230719-3.cs index 2350db1d..448ed110 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719053130_20230719-3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719053130_20230719-3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719090654_20230719-4.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719090654_20230719-4.cs index dcd138c0..a28269b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719090654_20230719-4.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230719090654_20230719-4.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.cs index 5c9aba83..099f0ee0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230720012742_vmi2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230721063549_20230721.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230721063549_20230721.cs index a375c0da..0866771f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230721063549_20230721.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230721063549_20230721.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722013448_20230722.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722013448_20230722.cs index ad770135..94007930 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722013448_20230722.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722013448_20230722.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722015432_202307220002.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722015432_202307220002.cs index 61ad9bce..37364759 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722015432_202307220002.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230722015432_202307220002.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724052214_20230724-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724052214_20230724-1.cs index ffffe3eb..798a7ec8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724052214_20230724-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724052214_20230724-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.cs index fcea6866..90b31b9b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230724063308_vmi3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726013523_20230726-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726013523_20230726-1.cs index 25ffcca6..aa77dff6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726013523_20230726-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726013523_20230726-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726021913_202307260001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726021913_202307260001.cs index 42d5f3a8..5abf7f77 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726021913_202307260001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726021913_202307260001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.cs index 645bf277..33cfa934 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064841_20230726-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.cs index a824549a..5f1f6a53 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726064930_20230726-3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726065932_vmi4.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726065932_vmi4.cs index 0e1f5c2c..9dfd7a7e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726065932_vmi4.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230726065932_vmi4.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727005325_vmi5.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727005325_vmi5.cs index 319c7789..3b238d17 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727005325_vmi5.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727005325_vmi5.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727011426_202307270001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727011426_202307270001.cs index 409f503a..3b172f1f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727011426_202307270001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727011426_202307270001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.cs index 1a196ab9..0bbe6499 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727024321_20230727-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs index 90fc830b..7cc5b20c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230727085151_202307270004.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230728013132_vmi6.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230728013132_vmi6.cs index 1b32ee8a..de7ea635 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230728013132_vmi6.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230728013132_vmi6.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731014604_20230731-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731014604_20230731-1.cs index c82e43c9..7f15cada 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731014604_20230731-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731014604_20230731-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731031816_20230731-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731031816_20230731-2.cs index abdcea9c..90717b19 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731031816_20230731-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230731031816_20230731-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230801054818_20230801-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230801054818_20230801-1.cs index 0eb64723..4405dad0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230801054818_20230801-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230801054818_20230801-1.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803013930_vmi7.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803013930_vmi7.cs index 20814ea7..8b8b1a35 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803013930_vmi7.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803013930_vmi7.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.cs index 7b06a7cc..0bf5d09d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230803033051_20230803-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs index 1efe33a3..9f849b1a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807024652_vmi8.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.cs index 95e33efb..33272c7c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807054442_vmi9.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807063408_vmi10.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807063408_vmi10.cs index e7f51d0d..84a64fbd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807063408_vmi10.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230807063408_vmi10.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808023302_202308080001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808023302_202308080001.cs index 275fffc5..60312af8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808023302_202308080001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808023302_202308080001.cs @@ -7,7 +7,7 @@ namespace Win.Sfs.SettleAccount.Migrations { protected override void Up(MigrationBuilder migrationBuilder) { - + migrationBuilder.CreateTable( name: "Set_BBAC_PD", columns: table => new @@ -86,7 +86,6 @@ namespace Win.Sfs.SettleAccount.Migrations table.PrimaryKey("PK_Set_PUB_PD", x => x.Id); }); - } protected override void Down(MigrationBuilder migrationBuilder) @@ -100,7 +99,6 @@ namespace Win.Sfs.SettleAccount.Migrations migrationBuilder.DropTable( name: "Set_PUB_PD"); - } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs index 43d019bb..73d3e5f7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808055821_20230808-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.cs index cf047df4..073f172e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230808062331_20230808-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809035500_vmi11.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809035500_vmi11.cs index d869b81a..f6025f61 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809035500_vmi11.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809035500_vmi11.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809054836_20230809-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809054836_20230809-1.cs index a8a355ba..8eb9336c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809054836_20230809-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809054836_20230809-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809074216_20230809-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809074216_20230809-2.cs index eabbfc10..05cb9440 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809074216_20230809-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230809074216_20230809-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810003703_202308100001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810003703_202308100001.cs index d4991ad0..18fe2b71 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810003703_202308100001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810003703_202308100001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810012032_20230810-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810012032_20230810-1.cs index 9df42133..80f42879 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810012032_20230810-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810012032_20230810-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810025021_20230810-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810025021_20230810-2.cs index e5a691ea..079cd37b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810025021_20230810-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810025021_20230810-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810081159_20230810-3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810081159_20230810-3.cs index 69e65dc4..53773e75 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810081159_20230810-3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230810081159_20230810-3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230811013305_202308110001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230811013305_202308110001.cs index 21014f2c..4c880634 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230811013305_202308110001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230811013305_202308110001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814052555_20230814-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814052555_20230814-1.cs index 49fe8bc8..0c1cd0d3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814052555_20230814-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814052555_20230814-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814073646_20230814-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814073646_20230814-2.cs index bb0d08fd..10bd3883 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814073646_20230814-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230814073646_20230814-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815013824_20230815-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815013824_20230815-1.cs index 60769bcd..6e1ec106 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815013824_20230815-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815013824_20230815-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815023057_20230815-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815023057_20230815-2.cs index fa797f88..6834a7d6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815023057_20230815-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815023057_20230815-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815054853_20230815-3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815054853_20230815-3.cs index 014e805a..a4b580af 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815054853_20230815-3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230815054853_20230815-3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817004419_20230817-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817004419_20230817-1.cs index ad8f201c..47ae3d17 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817004419_20230817-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817004419_20230817-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.cs index 00f03507..dfab832e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817033153_20230817-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.cs index 42c85598..42f24d19 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817035945_20230817-3.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.cs index 52ca6de7..5d7989e4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817051027_20230817-4.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.cs index 074b5f49..ae259bd8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230817052812_202308170001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs index fb345244..c8687eed 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818070358_20230818-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818073659_202308180001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818073659_202308180001.cs index 325cfdb1..d82525c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818073659_202308180001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230818073659_202308180001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230819034920_202308190002.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230819034920_202308190002.cs index 658e03f7..a8f0d7e4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230819034920_202308190002.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230819034920_202308190002.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.cs index d077a69b..2f353150 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230822072327_vmi12.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.cs index 27476ca4..50ca58fd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230823062342_20230823-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.cs index cb31ca62..ac28b53b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825011303_vmi14.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.cs index db4be684..36a8520d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825061422_vmi15.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.cs index c475a351..c9dc5183 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825063729_vmi16.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.cs index 8c2ccd1c..364cc751 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230825071603_20230825-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826031830_202308260001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826031830_202308260001.cs index 5aeb297f..5ab50462 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826031830_202308260001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826031830_202308260001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826032802_vmi17.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826032802_vmi17.cs index f02f6842..a56cc053 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826032802_vmi17.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230826032802_vmi17.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828060854_20230828.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828060854_20230828.cs index 77c25cfe..dec0e50a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828060854_20230828.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828060854_20230828.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828074927_vmi18.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828074927_vmi18.cs index 1f7aeac2..19fe6022 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828074927_vmi18.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828074927_vmi18.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828092102_20230828-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828092102_20230828-1.cs index 51fd37eb..d824a831 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828092102_20230828-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230828092102_20230828-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829061958_20230829-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829061958_20230829-1.cs index 7ba8aa8f..6b723425 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829061958_20230829-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829061958_20230829-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829062103_202308290001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829062103_202308290001.cs index 28ba4bbe..04d2cd07 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829062103_202308290001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230829062103_202308290001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.cs index 96c8f9a2..e45a009c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230831082843_20230831-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230906031332_202309060001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230906031332_202309060001.cs index 55327ff8..30c4119e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230906031332_202309060001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230906031332_202309060001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.cs index ddc5d426..967c23da 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230907075720_20230907-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.cs index 74b7e476..f5e535c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908031607_20230908-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.cs index a53d2a31..8f0fce47 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230908053049_20230908-2.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs index aff6130b..c85d1a6b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230909013408_202309090001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230913024309_20230913-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230913024309_20230913-1.cs index e9b289f8..868f2c9c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230913024309_20230913-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230913024309_20230913-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230914021528_20230914-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230914021528_20230914-1.cs index 0ea26f59..6871d3c6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230914021528_20230914-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230914021528_20230914-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915020001_20230915-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915020001_20230915-1.cs index c7bac9da..bd66bea3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915020001_20230915-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915020001_20230915-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915035754_202309150001.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915035754_202309150001.cs index 1b315561..65def444 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915035754_202309150001.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230915035754_202309150001.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230918060007_20230918-1.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230918060007_20230918-1.cs index 3fe65645..3b10d446 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230918060007_20230918-1.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Migrations/20230918060007_20230918-1.cs @@ -1,4 +1,4 @@ -using System; +using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Win.Sfs.SettleAccount.Migrations diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/Report/UnSettleAccountDiffReportDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/Report/UnSettleAccountDiffReportDapperRepository.cs index 98117ee7..b14b3303 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/Report/UnSettleAccountDiffReportDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/Report/UnSettleAccountDiffReportDapperRepository.cs @@ -1,9 +1,7 @@ -using Dapper; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -19,7 +17,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount.Report { } [UnitOfWork(false)] - public virtual async Task> GetDiffUnSettleReport(string year,string customcode) + public virtual async Task> GetDiffUnSettleReport(string year, string customcode) { string sqlString = "select ItemCode ,\n" + @@ -51,9 +49,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount.Report "\n" + " from\n" + - "( select ItemCode,DiffQty,version from\n"+ - "(SELECT ItemCode, DiffQty, version, id FROM Set_stock_unsettled_report_detail where CustomCode= '{1}') e inner join\n"+ - "(SELECT max(id) as id FROM Set_stock_unsettled_report_detail group by ItemCode, version) f on e.Id = f.id\n"+ + "( select ItemCode,DiffQty,version from\n" + + "(SELECT ItemCode, DiffQty, version, id FROM Set_stock_unsettled_report_detail where CustomCode= '{1}') e inner join\n" + + "(SELECT max(id) as id FROM Set_stock_unsettled_report_detail group by ItemCode, version) f on e.Id = f.id\n" + " ) a\n" + " pivot\n" + @@ -65,20 +63,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount.Report "\n" + " on c.ItemCode=d.SettleMaterialCode"; + string _sql = string.Format(sqlString, year, customcode); - string _sql = string.Format(sqlString, year,customcode); - - - var _db = await GetDbConnectionAsync(); + var _db = await GetDbConnectionAsync().ConfigureAwait(false); var _query = _db.Query(_sql); - - return _query.ToList(); } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs index e25b6ad1..492663b9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBQEfCoreRepository.cs @@ -1,8 +1,6 @@ -using System; using System.Collections.Generic; using System.Data; using System.Data.Common; -using System.Data.SqlClient; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -11,10 +9,8 @@ using Microsoft.EntityFrameworkCore.Storage; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Filter; -using Win.Sfs.Shared.RepositoryBase; +using System; namespace Win.Sfs.SettleAccount.Repository { @@ -27,8 +23,6 @@ namespace Win.Sfs.SettleAccount.Repository private readonly IDbContextProvider _dbContextProvider; - - public SettleAccountBQEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -41,7 +35,7 @@ namespace Win.Sfs.SettleAccount.Repository } - public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) + public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) { var command = DbContext.Database.GetDbConnection().CreateCommand(); @@ -57,63 +51,61 @@ namespace Win.Sfs.SettleAccount.Repository return command; } - public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) + public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) { var connection = DbContext.Database.GetDbConnection(); if (connection.State != ConnectionState.Open) { - await connection.OpenAsync(cancellationToken); + await connection.OpenAsync(cancellationToken).ConfigureAwait(false); } } - public virtual async Task> GetAllAsync( bool includeDetails = false, + public virtual async Task> GetAllAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { var query = includeDetails ? this.WithDetails() : this.GetQueryable(); //query = query.Where(p => p.BranchId.Equals(branchId)); - return await query.ToListAsync(cancellationToken: cancellationToken); + return await query.ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } public virtual async Task GetCountAsync(CancellationToken cancellationToken = default) { - return await this.GetQueryable() - - .LongCountAsync(GetCancellationToken(cancellationToken)); + return await GetQueryable() + + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } - public virtual async Task GetCountByFilterAsync( List filters, + public virtual async Task GetCountByFilterAsync(List filters, CancellationToken cancellationToken = default) { - return await this.GetQueryable() - + return await GetQueryable() + .WhereIf(filters?.Count != 0, filters.ToLambda()) - .LongCountAsync(GetCancellationToken(cancellationToken)); + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } - public virtual async Task> GetListByFilterAsync( List filters, + public virtual async Task> GetListByFilterAsync(List filters, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, bool includeDetails = false, CancellationToken cancellationToken = default) { var query = includeDetails ? this.WithDetails() : this.GetQueryable(); - // query = query.Where(p => p.BranchId.Equals(branchId)); + // query = query.Where(p => p.BranchId.Equals(branchId)); var entities = query.WhereIf(filters?.Count != 0, filters.ToLambda()); //2021-07-02 设置sorting首字母大小,因设置了驼峰规则,不匹配“ var memberProp = typeof(T).GetProperty(propertyName);”反射 - if(!string.IsNullOrEmpty(sorting)) + if (!string.IsNullOrEmpty(sorting)) { - sorting = sorting.Substring(0, 1).ToUpper() + sorting.Substring(1); + sorting = string.Concat(sorting.Substring(0, 1).ToUpper(), sorting.AsSpan(1)); } entities = GetSortingQueryable(entities, sorting); return await entities.PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); + .ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); - - } + } } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBranchEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBranchEfCoreRepository.cs index 8cc1f13c..acf32962 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBranchEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountBranchEfCoreRepository.cs @@ -1,8 +1,6 @@ -using System; using System.Collections.Generic; using System.Data; using System.Data.Common; -using System.Data.SqlClient; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -12,9 +10,8 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Filter; -using Win.Sfs.Shared.RepositoryBase; +using System; namespace Win.Sfs.SettleAccount.Repository { @@ -27,8 +24,6 @@ namespace Win.Sfs.SettleAccount.Repository private readonly IDbContextProvider _dbContextProvider; - - public SettleAccountBranchEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -41,7 +36,7 @@ namespace Win.Sfs.SettleAccount.Repository } - public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) + public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) { var command = DbContext.Database.GetDbConnection().CreateCommand(); @@ -57,13 +52,13 @@ namespace Win.Sfs.SettleAccount.Repository return command; } - public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) + public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) { var connection = DbContext.Database.GetDbConnection(); if (connection.State != ConnectionState.Open) { - await connection.OpenAsync(cancellationToken); + await connection.OpenAsync(cancellationToken).ConfigureAwait(false); } } public virtual async Task> GetAllAsync(TKey branchId, bool includeDetails = false, @@ -73,24 +68,24 @@ namespace Win.Sfs.SettleAccount.Repository //query = query.Where(p => p.BranchId.Equals(branchId)); - return await query.ToListAsync(cancellationToken: cancellationToken); + return await query.ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } public virtual async Task GetCountAsync(TKey branchId, CancellationToken cancellationToken = default) { - return await this.GetQueryable() + return await GetQueryable() //.Where(p => p.BranchId.Equals(branchId)) - .LongCountAsync(GetCancellationToken(cancellationToken)); + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual async Task GetCountByFilterAsync(TKey branchId, List filters, CancellationToken cancellationToken = default) { - return await this.GetQueryable() + return await GetQueryable() //.Where(p => p.BranchId.Equals(branchId)) .WhereIf(filters?.Count != 0, filters.ToLambda()) - .LongCountAsync(GetCancellationToken(cancellationToken)); + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual async Task> GetListByFilterAsync(TKey branchId, List filters, @@ -99,21 +94,19 @@ namespace Win.Sfs.SettleAccount.Repository CancellationToken cancellationToken = default) { var query = includeDetails ? this.WithDetails() : this.GetQueryable(); - // query = query.Where(p => p.BranchId.Equals(branchId)); + // query = query.Where(p => p.BranchId.Equals(branchId)); var entities = query.WhereIf(filters?.Count != 0, filters.ToLambda()); //2021-07-02 设置sorting首字母大小,因设置了驼峰规则,不匹配“ var memberProp = typeof(T).GetProperty(propertyName);”反射 - if(!string.IsNullOrEmpty(sorting)) + if (!string.IsNullOrEmpty(sorting)) { - sorting = sorting.Substring(0, 1).ToUpper() + sorting.Substring(1); + sorting = string.Concat(sorting.Substring(0, 1).ToUpper(), sorting.AsSpan(1)); } entities = GetSortingQueryable(entities, sorting); return await entities.PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - + .ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); - } + } } - -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreQueryableExtensions.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreQueryableExtensions.cs index 22dda058..bdeb0a23 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreQueryableExtensions.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreQueryableExtensions.cs @@ -1,7 +1,3 @@ -using System.Linq; -using Microsoft.EntityFrameworkCore; - - namespace Win.Sfs.SettleAccount.Repository { public static class SettleAccountEfCoreQueryableExtensions @@ -18,4 +14,4 @@ namespace Win.Sfs.SettleAccount.Repository // // .Include(x => x.BasicCurrency); //} } -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs index 4256a044..af88acdd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountEfCoreRepository.cs @@ -11,11 +11,7 @@ using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; - -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.RepositoryBase; -using Win.Utils; - namespace Win.Sfs.SettleAccount.Repository { @@ -32,17 +28,17 @@ namespace Win.Sfs.SettleAccount.Repository var ids = tList.Select(p => p.Id); - var updateList = await DbSet.Where(p => ids.Contains(p.Id)).ToListAsync(cancellationToken: cancellationToken); + var updateList = await DbSet.Where(p => ids.Contains(p.Id)).ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false); var updateIds = updateList.Select(p => p.Id); var createList = tList.Where(p => !updateIds.Contains(p.Id)); - await DbSet.AddRangeAsync(createList, cancellationToken); + await DbSet.AddRangeAsync(createList, cancellationToken).ConfigureAwait(false); DbSet.UpdateRange(updateList); - await DbContext.SaveChangesAsync(cancellationToken); + await DbContext.SaveChangesAsync(cancellationToken).ConfigureAwait(false); return true; } @@ -79,7 +75,7 @@ namespace Win.Sfs.SettleAccount.Repository foreach (var id in ids) { - await DeleteAsync(id,false, cancellationToken); + await DeleteAsync(id, false, cancellationToken).ConfigureAwait(false); } return true; @@ -89,11 +85,11 @@ namespace Win.Sfs.SettleAccount.Repository { } - public SettleAccountEfCoreRepository():base(null){} + public SettleAccountEfCoreRepository() : base(null) { } protected static IQueryable GetSortingQueryable(IQueryable entities, string sorting) { - return string.IsNullOrEmpty(sorting)?entities:DynamicQueryableExtensions.OrderBy(entities, sorting); + return string.IsNullOrEmpty(sorting) ? entities : DynamicQueryableExtensions.OrderBy(entities, sorting); //if (string.IsNullOrEmpty(sorting)) //{ // entities = entities.OrderByDescending("Id"); @@ -101,13 +97,9 @@ namespace Win.Sfs.SettleAccount.Repository //else //{ - - - // var sortParams = sorting?.Split(' '); // var sortName = sortParams[0]; - // Type t = typeof(TEntity); // var _first=t.GetProperties().Where(p => p.Name.ToUpper() == sortName.ToUpper()).FirstOrDefault(); // if (_first != null) @@ -115,9 +107,6 @@ namespace Win.Sfs.SettleAccount.Repository // sortName = _first.Name; // } - - - // bool isDesc; // if (sortParams.Length > 1) // { @@ -135,18 +124,16 @@ namespace Win.Sfs.SettleAccount.Repository //return entities; } - - public virtual async Task GetPropertyValueAsync(Func> factory, string propertyName) { - return await GetPropertyValueAsync(factory, new List { propertyName }); + return await GetPropertyValueAsync(factory, new List { propertyName }).ConfigureAwait(false); } public virtual async Task GetPropertyValueAsync(Func> factory, IEnumerable propertyNames, char separator = ',') { try { - var entity = await factory.Invoke(); + var entity = await factory.Invoke().ConfigureAwait(false); var sb = new StringBuilder(); foreach (var propertyName in propertyNames) { @@ -170,8 +157,6 @@ namespace Win.Sfs.SettleAccount.Repository } } - } - -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Code/CodeSettingRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Code/CodeSettingRepository.cs index 08de90a5..5cd2ac00 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Code/CodeSettingRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Code/CodeSettingRepository.cs @@ -1,25 +1,20 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.SettleAccount.Entities.CodeSettings; -using Win.Sfs.SettleAccount.Entities.Invoices; namespace Win.Sfs.SettleAccount.Repository.Code { - public class CodeSettingRepository:EfCoreRepository, ITransientDependency + public class CodeSettingRepository : EfCoreRepository, ITransientDependency { public CodeSettingRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - public virtual List GetList(string key) { @@ -27,22 +22,16 @@ namespace Win.Sfs.SettleAccount.Repository.Code try { DbContext.Database.SetCommandTimeout(1200); - _list=GetQueryable().Where(p => p.Project == key).ToList(); + _list = GetQueryable().Where(p => p.Project == key).ToList(); } catch (Exception e) { - + } return _list; } - - - } - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceRepository.cs index 7f4fd580..a7ba318d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceRepository.cs @@ -1,10 +1,8 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -12,7 +10,7 @@ using Win.Sfs.SettleAccount.Entities.Invoices; namespace Win.Sfs.SettleAccount.Repository.SettleAccount { - public class InvoiceRepository : EfCoreRepository, ITransientDependency + public class InvoiceRepository : EfCoreRepository, ITransientDependency { public InvoiceRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -28,7 +26,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } @@ -42,9 +40,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount if (list.Count > 0) { var _version = list.FirstOrDefault().Version; - var _ls = GetQueryable().Where(p => p.Version == _version).Select(p => new { MaterialCode = p.MaterialCode}).ToList(); + var _ls = GetQueryable().Where(p => p.Version == _version).Select(p => new { MaterialCode = p.MaterialCode }).ToList(); var _query = from r1 in list - join r2 in _ls on new {r1.MaterialCode } equals new { r2.MaterialCode } + join r2 in _ls on new { r1.MaterialCode } equals new { r2.MaterialCode } into temp from t in temp.DefaultIfEmpty() where t == null @@ -58,7 +56,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceVersionRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceVersionRepository.cs index 46a4af73..ceab484d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceVersionRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Invoices/InvoiceVersionRepository.cs @@ -1,10 +1,8 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -12,7 +10,7 @@ using Win.Sfs.SettleAccount.Entities.Invoices; namespace Win.Sfs.SettleAccount.Repository.SettleAccount { - public class InvoiceVersionRepository: EfCoreRepository, ITransientDependency + public class InvoiceVersionRepository : EfCoreRepository, ITransientDependency { public InvoiceVersionRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -28,7 +26,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } @@ -48,7 +46,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipDetailRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipDetailRepository.cs index 535154be..4bbabea9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipDetailRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipDetailRepository.cs @@ -1,10 +1,8 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -18,25 +16,25 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship { } - public virtual bool Delete(string version,string customerCode) + public virtual bool Delete(string version, string customerCode) { try { DbContext.Database.SetCommandTimeout(1200); - var _detailQuery = DbSet.Where(p => p.Version == version && p.CustomerCode==customerCode); + var _detailQuery = DbSet.Where(p => p.Version == version && p.CustomerCode == customerCode); _detailQuery.BatchDelete(); } catch (Exception e) { - throw e; + throw; } return true; } - public virtual List GetDetail(string version,string customerCode) + public virtual List GetDetail(string version, string customerCode) { - var list =GetQueryable().Where(p => p.Version == version && p.CustomerCode == customerCode).ToList(); - return list ; + var list = GetQueryable().Where(p => p.Version == version && p.CustomerCode == customerCode).ToList(); + return list; } public virtual bool DelDetailByErpPartCode(string version, List erpcodeList) @@ -46,7 +44,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship return true; } - public virtual bool Insert(List list) { try @@ -74,7 +71,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship } catch (Exception e) { - throw e; + throw; } return true; } @@ -86,8 +83,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship DbContext.Database.SetCommandTimeout(1200); - - var _ls=GetQueryable().Where(p=>p_list.Contains(p.Id)); + var _ls = GetQueryable().Where(p => p_list.Contains(p.Id)); //List _insertls = new List(); //if (list.Count > 0) //{ @@ -110,34 +106,25 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship } catch (Exception e) { - throw e; + throw; } return true; } - - - - public virtual bool Update(List list) { try { DbContext.Database.SetCommandTimeout(1200); - + DbContext.BulkUpdate(list); } catch (Exception e) { - throw e; + throw; } return true; } - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipVersionRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipVersionRepository.cs index 004c97d9..d77fd602 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipVersionRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/MaterialRelationships/MaterialRelationshipVersionRepository.cs @@ -1,10 +1,8 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -12,7 +10,7 @@ using Win.Sfs.SettleAccount.Entities.MaterialRelationships; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationships { - public class MaterialRelationshipVersionRepository:EfCoreRepository, ITransientDependency + public class MaterialRelationshipVersionRepository : EfCoreRepository, ITransientDependency { public MaterialRelationshipVersionRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) @@ -30,7 +28,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship } catch (Exception e) { - throw e; + throw; } return true; } @@ -39,7 +37,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship { try { - var _first = GetQueryable().FirstOrDefault(p => p.Version == p_version && p.CustomerCode==p_customCode); + var _first = GetQueryable().FirstOrDefault(p => p.Version == p_version && p.CustomerCode == p_customCode); if (_first == null) { var _version = new MaterialRelationshipVersion(GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode, p_factory); @@ -50,13 +48,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationship } catch (Exception e) { - throw e; + throw; } return true; } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/PendingDeduction/PendingDeductionDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/PendingDeduction/PendingDeductionDapperRepository.cs index a15c9ff9..1452b853 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/PendingDeduction/PendingDeductionDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/PendingDeduction/PendingDeductionDapperRepository.cs @@ -1,33 +1,16 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Microsoft.EntityFrameworkCore; -using NPOI.HPSF; -using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; -using SettleAccount.Bases; -using SettleAccount.Domain.BQ; -using System; using System.Collections.Generic; -using System.Data.Common; using System.Linq; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using SettleAccount.Domain.BQ; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.BQ.Temp; -using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.Reports; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using static System.Runtime.CompilerServices.RuntimeHelpers; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - + /// /// 2.大众发票与结算核对明细表-准时化 /// @@ -38,8 +21,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } - - [UnitOfWork(false)] /// /// BBAC生成待扣减 @@ -98,11 +79,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "INNER JOIN Set_BBAC_SE_DETAIL tmp2 ON\n" + "tmp1.KeyCode = tmp2.KeyCode\n"; - Dictionary> result = new Dictionary>(); - - string str = $"select" + " [Id] " + ",[SettleBillNum] " + @@ -177,7 +155,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report extend2: string.Empty, extend3: string.Empty, extend4: string.Empty, - p_businessType:itm.BusinessType + p_businessType: itm.BusinessType ); var bbacDetail = query.ToList(); @@ -271,11 +249,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report from tm1 in temp1.DefaultIfEmpty() select new HBPO_PD_DETAIL( guid: itm.Id, - keyCode: tm1!=null ? tm1.KeyCode : itm.KeyCode, + keyCode: tm1 != null ? tm1.KeyCode : itm.KeyCode, version: itm.Version, billNum: itm.BillNum, lU: itm.LU, - rELU: tm1!=null ? tm1.RepLU : itm.LU, + rELU: tm1 != null ? tm1.RepLU : itm.LU, pN: itm.PN, rEPN: itm.PN, site: itm.Site, @@ -288,7 +266,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report extend2: string.Empty, extend3: string.Empty, extend4: string.Empty, - p_businessType:itm.BusinessType + p_businessType: itm.BusinessType ); var bbacDetail = query.ToList(); @@ -298,7 +276,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - /// /// 其他业务生成待扣减 /// @@ -383,11 +360,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report from tm1 in temp1.DefaultIfEmpty() select new PUB_PD_DETAIL( guid: itm.Id, - keyCode: tm1!=null ? tm1.KeyCode : itm.KeyCode, + keyCode: tm1 != null ? tm1.KeyCode : itm.KeyCode, version: itm.Version, billNum: itm.BillNum, lU: itm.LU, - rELU: tm1==null ? tm1.RepLU : itm.LU, + rELU: tm1 == null ? tm1.RepLU : itm.LU, pN: itm.PN, rEPN: itm.PN, site: itm.Site, @@ -400,7 +377,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report extend2: string.Empty, extend3: string.Empty, extend4: string.Empty, - businessType:itm.BusinessType + businessType: itm.BusinessType ); var bbacDetail = query.ToList(); result.Add(bbac, bbacDetail); @@ -408,8 +385,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return result; } - - /// /// 发票分组下所有发票 /// @@ -430,7 +405,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report ",[InvoiceState] " + ",[ParentInvbillNum] " + ",[Tax] " + - "from set_INVOICE_GRP where InvGroupNum='{0}'",inv_group)).ToList(); + "from set_INVOICE_GRP where InvGroupNum='{0}'", inv_group)).ToList(); } /// /// 发票 @@ -439,11 +414,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// public virtual INVOICE_GRP GetInvoice(string inv_bill) { - - return DbConnection.QueryFirst(string.Format("select * from set_INVOICE_GRP where InvbillNum='{0}'",inv_bill)); - } - + return DbConnection.QueryFirst(string.Format("select * from set_INVOICE_GRP where InvbillNum='{0}'", inv_bill)); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs index c6433314..135bbce3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpPartDapperRepository.cs @@ -1,14 +1,9 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.Materials; using Win.Sfs.SettleAccount.Entities.Prices; using Win.Sfs.SettleAccount.Errors; @@ -29,17 +24,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public decimal DiffQty { set; get; } } - public class OutputSumInfo { public string BillNum { set; get; } public string OutputInfo { set; get; } - } - - /// /// 主数据Dapper表 /// @@ -50,23 +41,19 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public virtual List GetMaterialList() { return DbConnection.Query("select max(Id) ID,'' Factory,MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType from Set_material group by MaterialCode,MaterialDesc,EstimateTypeDesc,EstimateType ").ToList(); } - public virtual List GetErrorBillList() { - return DbConnection.Query("select [Id],[BillNum],[MaterialCode],[WmsBillNum],[MaterialDesc],[CustomerMaterialCode] from set_ErrorBill ").ToList(); } - public virtual List GetSapList(List childList, string version, bool isNotHistoryPart = false) where T : ReportDetailBase, new() { List _materialList = new List(); @@ -85,8 +72,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _list = DbConnection.Query (string.Format(str, version), null, null, true, 1200).ToList(); - - var query = from itm1 in childList join itm2 in _priceList on itm1.ParentSapMaterialCode equals itm2.SapErpPartCode into temp1 from tm1 in temp1.DefaultIfEmpty(new ErpPrice()) @@ -115,12 +100,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report }; tmpList = query.ToList(); - } else { - var query = from itm1 in childList join itm2 in _priceList on itm1.ParentSapMaterialCode equals itm2.SapErpPartCode into temp1 from tm1 in temp1.DefaultIfEmpty(new ErpPrice()) @@ -181,7 +164,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _list.ToList(); } - public virtual List GetDic(string tableName) { /****** SSMS 的 SelectTopNRows 命令的脚本 ******/ @@ -244,7 +226,5 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - - } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs index be303a03..f63c24e0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/ErpSumOutputDapperRepository.cs @@ -1,59 +1,48 @@ -using Dapper; 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 Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories.Dapper; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { public class TA_WMS_CTRL { - public string wms_seq { set; get; } - public string wms_table { set; get; } - public string wms_state { set; get; } - public string SourceBillNum { set; get; }//单号 + public string wms_seq { set; get; } + public string wms_table { set; get; } + public string wms_state { set; get; } + public string SourceBillNum { set; get; }//单号 - /// - /// 期间字段 - /// - public string JsonString { set; get; } + /// + /// 期间字段 + /// + public string JsonString { set; get; } - public string AccountDate { set; get; }//过账日期 + public string AccountDate { set; get; }//过账日期 } public class TA_WMS_JSKH - { [ExporterHeader(DisplayName ="GUID",IsIgnore =true)] + { + [ExporterHeader(DisplayName = "GUID", IsIgnore = true)] public string wms_seq { set; get; } [ExporterHeader(DisplayName = "行号")] public string POSNR { set; get; } - [ExporterHeader(DisplayName ="结算单号")] + [ExporterHeader(DisplayName = "结算单号")] public string ZVBELN { set; get; } - [ExporterHeader(DisplayName ="售达方")] + [ExporterHeader(DisplayName = "售达方")] public string KUNNR { set; get; } - [ExporterHeader(DisplayName ="订单原因")] + [ExporterHeader(DisplayName = "订单原因")] public string AUGRU { set; get; } - [ExporterHeader(DisplayName ="物料编码")] + [ExporterHeader(DisplayName = "物料编码")] public string MATNR { set; get; } - [ExporterHeader(DisplayName ="销售价格")] + [ExporterHeader(DisplayName = "销售价格")] public string ZPR0 { set; get; } - [ExporterHeader(DisplayName ="数量")] + [ExporterHeader(DisplayName = "数量")] public string KWMENG { set; get; } - [ExporterHeader(DisplayName ="工厂")] + [ExporterHeader(DisplayName = "工厂")] public string ZNOTE1 { set; get; } - [ExporterHeader(DisplayName ="单价")] + [ExporterHeader(DisplayName = "单价")] public string ZNOTE5 { set; get; } - [ExporterHeader(DisplayName ="状态")] + [ExporterHeader(DisplayName = "状态")] public string STATE { set; get; } - [ExporterHeader(DisplayName ="单号")] + [ExporterHeader(DisplayName = "单号")] public string REMARK { set; get; } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs index 07245ff9..99df9f94 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/FisUpdateStateDapperRepository.cs @@ -1,25 +1,12 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - - - /// /// 主数据Dapper表 /// @@ -30,15 +17,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } [UnitOfWork(isTransactional: false)] - public virtual void UpdateFisSettle() + public virtual void UpdateFisSettle() { - + DbConnection.Execute("EXEC sp_settle_fis_update", null, null, 1200, null); } - - - - } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs index 02433950..532ca014 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFSettledDetailDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -38,15 +35,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "寄销库数量")] public decimal 寄销库数量 { set; get; } - } - - - - - - public class HQFSettledDetailDiff { [ExporterHeader(DisplayName = "交货单号")] @@ -118,7 +108,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string condition = " "; - ////if (!string.IsNullOrEmpty(materialCode)) ////{ @@ -234,7 +223,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query(str, null, null, true, 1200, null); _list = _query.ToList(); - return _list; } @@ -243,7 +231,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report List _list = new List(); - string condition =string.Empty; + string condition = string.Empty; if (!string.IsNullOrEmpty(begin)) { @@ -299,7 +287,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " Set_PriceList \n" + " WHERE \n" + " ( \n" + - " Version = ( SELECT MAX( Version ) AS Expr1 FROM Set_PriceList ))) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode " ; + " Version = ( SELECT MAX( Version ) AS Expr1 FROM Set_PriceList ))) AS temp2 ON temp1.Sap编码 = temp2.MaterialCode "; var _sql = string.Format(str, version, condition); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -308,8 +296,5 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFShippingDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFShippingDapperRepository.cs index 0629b26e..f16c10fa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFShippingDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFShippingDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -71,7 +68,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public class HQFShippingDiff { [ExporterHeader(DisplayName = "交货单号")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs index a4645108..ca5bf48b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQFactorySettledDetailDapperRepository.cs @@ -1,11 +1,9 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.Data; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -62,7 +60,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " WHERE \n" + " t2.HQHKanBan IS NULL "; - var list11 = DbConnection.Query(string.Format(sql10, version)); var sql11 = "SELECT DISTINCT\n" + @@ -104,7 +101,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " t1.HQHKanBan,\n" + " t1.MaterialCode"; - var list12 = DbConnection.Query(string.Format(sql11, version)); //看板号为备件 @@ -168,12 +164,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } - public virtual List GetHQFactoryDetailDiffReportList_org(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) { @@ -213,7 +207,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report conditionDate += string.Format(" and LastModificationTime<='{0}' ", end); } - //temp3.HQHKanBan 订货看板编号 temp3.ExternalKanbanNumber 外部单号 string str = "SELECT\n" + @@ -365,11 +358,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) temp3\n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp3.MaterialCode = TEMP2.MaterialCode"; - var _sql = string.Format(str, version, contion, conditionDate); - - ////发运数据中,查出看板号+物料号相同的重复数据 //var sql2 = "SELECT\n" + // " a.WmsBillNum,\n" + @@ -386,9 +376,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //var _sql2 = string.Format(sql2, condition); //var listCompare = DbConnection.Query(_sql2); - - - ////查询发运表中,看板号+物料号没有重复的数据 //var sql3 = "SELECT\n" + //" a.WmsBillNum,\n" + @@ -406,12 +393,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //var _sql3 = string.Format(sql3, condition); //var listCompare1 = DbConnection.Query(_sql3); - - - - - - var sql10 = "SELECT DISTINCT\n" + " t1.* \n" + "FROM\n" + @@ -448,10 +429,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " t2.HQHKanBan IS NULL"; - var list11 = DbConnection.Query(string.Format(sql10, version)); - var sql11 = "SELECT DISTINCT\n" + " t1.* \n" + "FROM\n" + @@ -489,10 +468,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " t1.HQHKanBan,\n" + " t1.MaterialCode"; - var list12 = DbConnection.Query(string.Format(sql11, version)); - var sql12 = "SELECT\n" + " a.ExternalKanbanNumber AS ExternalKanbanNumber,\n" + " a.KanbanNumber AS KanbanNumber,\n" + @@ -533,7 +510,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _lscopy.Add(itm); } - //List _ls = new List(); //foreach (var itm in listCompare.ToList()) //{ @@ -571,7 +547,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query(_sql, null, null, true, 1200, null); _list = _query.ToList(); - foreach (var itm1 in _list) { //var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.订货看板编号 && p.MaterialCode == itm1.Sap编码); @@ -590,13 +565,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } - - /// /// 红旗系统未对比对红旗主机厂未结,其中红旗系统未结数据中还包括有发货有结算中发货数量大于结算的也要整合到未结当中 /// @@ -606,7 +578,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// /// - public virtual List GetSettleToFactoryDetailDiffReportList(string version, string materialCode, + public virtual List GetSettleToFactoryDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) { @@ -617,10 +589,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - var sql10 = " SELECT DISTINCT \n" + " t1.* \n" + " FROM \n" + @@ -645,7 +615,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " WHERE \n" + " t2.HQHKanBan IS NULL "; - var list11 = DbConnection.Query(string.Format(sql10, version)); var sql11 = "SELECT DISTINCT\n" + @@ -687,7 +656,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " t1.HQHKanBan,\n" + " t1.MaterialCode"; - var list12 = DbConnection.Query(string.Format(sql11, version)); var sql12 = "SELECT\n" + @@ -731,8 +699,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _lscopy.Add(itm); } - - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -768,8 +734,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _ls.Add(itm); } - - //数据整合,相同看板号+物料号的交货单号合并成一行中以逗号分隔 foreach (var itm1 in _list) { @@ -778,7 +742,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { itm1.交货单号 = itm.WmsBillNum; itm1.交货时间 = itm.WmsDate; - // itm1.退货数量 = itm.ReturnQty; + // itm1.退货数量 = itm.ReturnQty; } var itmcopy = _lscopy.FirstOrDefault(p => p.HQHKanBan == itm1.订货看板编号 && p.MaterialCode == itm1.Sap编码); @@ -790,12 +754,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } - public virtual List GetSettleToFactoryDetailDiffReportList_org(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) { @@ -835,8 +797,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report conditionDate += string.Format(" and LastModificationTime<='{0}' ", end); } - - string str = "SELECT\n" + " temp.交货单号,\n" + " temp.交货时间,\n" + @@ -953,12 +913,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " LEFT JOIN ( SELECT SUM ( Qty ) Qty, HQHKanBan, MaterialCode,ExternalKanbanNumber,Factory,StorageLocationDesc FROM Set_UnHQSettleAccount WHERE Version ='{2}' GROUP BY HQHKanBan, MaterialCode,ExternalKanbanNumber,Factory,StorageLocationDesc ) temp3 ON temp.[订货看板编号] = temp3.HQHKanBan \n" + " AND temp.[客户物料号] = temp3.MaterialCode"; - - var _sql = string.Format(str, conditionDate, contion, version); - - //发运数据中,查出看板号+物料号相同的重复数据 var sql2 = "SELECT\n" + " a.WmsBillNum,\n" + @@ -975,9 +931,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql2 = string.Format(sql2, condition); var listCompare = DbConnection.Query(_sql2); - - - //查询发运表中,看板号+物料号没有重复的数据 var sql3 = "SELECT\n" + " a.WmsBillNum,\n" + @@ -995,10 +948,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql3 = string.Format(sql3, condition); var listCompare1 = DbConnection.Query(_sql3); - - - - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -1037,7 +986,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query(_sql, null, null, true, 1200, null); _list = _query.ToList(); - foreach (var itm1 in _list) { var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.订货看板编号 && p.MaterialCode == itm1.Sap编码); @@ -1048,12 +996,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } - public class CompareFactoryExtend { public string WmsBillNum { set; get; } @@ -1073,15 +1019,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string MaterialCode { set; get; } } - - public class HQFactoryUnSettledDetailDiff { [ExporterHeader(DisplayName = "交货单号")] public string 交货单号 { set; get; } [ExporterHeader(DisplayName = "交货时间")] public string 交货时间 { set; get; } - + [ExporterHeader(DisplayName = "订货看板编号")] public string 订货看板编号 { set; get; } @@ -1091,13 +1035,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "存储地点描述")] public string 存储地点描述 { set; get; } - [ExporterHeader(DisplayName = "外部单号")] + [ExporterHeader(DisplayName = "外部单号")] public string 外部单号 { set; get; } [ExporterHeader(DisplayName = "Sap编码")] public string Sap编码 { set; get; } - [ExporterHeader(DisplayName = "客户物料号")] public string 客户物料号 { set; get; } [ExporterHeader(DisplayName = "零件中文名称")] @@ -1108,11 +1051,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "发货定价")] public decimal 发货定价 { set; get; } - + [ExporterHeader(DisplayName = "发货数量")] public decimal 发货数量 { set; get; } - [ExporterHeader(DisplayName = "退货数量")] public decimal 退货数量 { set; get; } @@ -1122,7 +1064,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "系统未结总金额")] public decimal 系统未结总金额 { set; get; } - [ExporterHeader(DisplayName = "系统未结数量")] public decimal 系统未结数量 { set; get; } @@ -1134,20 +1075,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "数量差异")] public decimal 数量差异 { set; get; } - - - - } - /// /// 红旗主机厂比对红旗未结 /// public class HQSettledUnFactoryDetailDiff { - [ExporterHeader(DisplayName = "订货看板编号")] public string 订货看板编号 { set; get; } @@ -1160,11 +1095,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "外部单号")] public string 外部单号 { set; get; } - [ExporterHeader(DisplayName = "Sap编码")] public string Sap编码 { set; get; } - [ExporterHeader(DisplayName = "客户物料号")] public string 客户物料号 { set; get; } [ExporterHeader(DisplayName = "零件中文名称")] @@ -1172,18 +1105,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "物料组")] public string 物料组 { set; get; } - [ExporterHeader(DisplayName = "结算单价")] public decimal 结算单价 { set; get; } - + [ExporterHeader(DisplayName = "结算数量")] public decimal 结算数量 { set; get; } [ExporterHeader(DisplayName = "结算金额")] public decimal 结算金额 { set; get; } - [ExporterHeader(DisplayName = "系统未结数量")] public decimal 系统未结数量 { set; get; } [ExporterHeader(DisplayName = "红旗未结数量")] @@ -1191,13 +1122,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "数量差异")] public decimal 差异 { set; get; } - - - - } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs index 9b047f13..4434ddc7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHSettledDetailDapperRepository.cs @@ -1,11 +1,9 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.Data; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -38,7 +36,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public class CompareExtend1 { public string ExternalKanbanNumber { set; get; } - public string KanbanNumber { set; get; } + public string KanbanNumber { set; get; } public string AcceptanceDate { set; get; } public string HQHKanBan { set; get; } public string MaterialCode { set; get; } @@ -53,9 +51,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string MaterialCode { set; get; } } - - - /// /// 红旗H平台输出报表 /// @@ -92,7 +87,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // // condition += string.Format(" and b.LastModificationTime<='{0}' ", end); // //} - // #region 第二次更改 // //string str = "SELECT\n" + // //" isnull( temp1.交货单号, '' ) 交货单号,\n" + @@ -190,7 +184,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // //" LEFT JOIN set_backQty temp4 ON temp1.订货看板编号 = temp4.Code \n" + // //" AND temp1.Sap编码= temp4.MaterialCode"; - // //string str = "SELECT\n" + // //" isnull( temp1.交货单号, '' ) 交货单号,\n" + // //" temp1.交货时间,\n" + @@ -286,8 +279,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // //" AND temp1.Sap编码= temp4.MaterialCode"; // #endregion - - // //var sql2 = "SELECT\n" + // //" a.WmsBillNum,\n" + // //" t1.MaterialCode MaterialCode,\n" + @@ -303,9 +294,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // //var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - - - // //var sql3 = "SELECT\n" + // //" a.WmsBillNum,\n" + // //" t1.MaterialCode MaterialCode,\n" + @@ -322,10 +310,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // // var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin_1]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - - - - // var sql10 = "SELECT DISTINCT\n" + // " t1.* \n" + // "FROM\n" + @@ -350,13 +334,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // "WHERE\n" + // " t2.HQHKanBan IS NULL"; - // var list11 = DbConnection.Query(string.Format(sql10, version)); - - - - // var sql11 = "SELECT DISTINCT\n" + // " t1.* \n" + // "FROM\n" + @@ -382,10 +361,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // " t1.HQHKanBan,\n" + // " t1.MaterialCode"; - // var list12 = DbConnection.Query(string.Format(sql11, version)); - // var sql12 = "SELECT\n" + // " a.ExternalKanbanNumber AS ExternalKanbanNumber,\n" + // " a.KanbanNumber AS KanbanNumber,\n" + @@ -402,7 +379,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // var list13 = DbConnection.Query(string.Format(sql12, version)); - // List _lscopy = new List(); // foreach (var itm in list11) @@ -428,7 +404,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // _lscopy.Add(itm); // } - // //List _ls = new List(); // //foreach (var itm in listCompare.ToList()) // //{ @@ -468,7 +443,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // var _query = DbConnection.Query("[dbo].[p_hq_unsettle_1]", new { version = version }, null, true, 1200, CommandType.StoredProcedure); // _list = _query.ToList(); - // foreach (var itm1 in _list) // { // //var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.订货看板编号 && p.MaterialCode == itm1.Sap编码); @@ -487,8 +461,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // } // } - - // return _list; //} @@ -522,10 +494,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " t2.HQHKanBan IS NULL"; - var list11 = DbConnection.Query(string.Format(sql10, version)); - var sql11 = "SELECT DISTINCT\n" + " t1.* \n" + "FROM\n" + @@ -551,10 +521,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " t1.HQHKanBan,\n" + " t1.MaterialCode"; - var list12 = DbConnection.Query(string.Format(sql11, version)); - var sql12 = "SELECT\n" + " a.ExternalKanbanNumber AS ExternalKanbanNumber,\n" + " a.KanbanNumber AS KanbanNumber,\n" + @@ -571,7 +539,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var list13 = DbConnection.Query(string.Format(sql12, version)); - List _lscopy = new List(); foreach (var itm in list11) @@ -600,7 +567,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query("[dbo].[p_hq_unsettle_1]", new { version = version }, null, true, 1200, CommandType.StoredProcedure); _list = _query.ToList(); - foreach (var itm1 in _list) { var itmcopy = _lscopy.FirstOrDefault(p => p.HQHKanBan == itm1.订货看板编号 && p.MaterialCode == itm1.Sap编码); @@ -952,7 +918,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" ) ccc"; #endregion - //var _sql = string.Format(str, version); //var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -972,7 +937,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// /// - public virtual List GetReverseSettledDetailDiffReportList(string version, string materialCode, + public virtual List GetReverseSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup, string iscontionversion) { List _list = new List(); @@ -982,10 +947,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var listCompare = DbConnection.Query("[dbo].[p_hq_unsettle_inner]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - var listCompare1 = DbConnection.Query("[dbo].[p_hq_unsettle_leftjoin]", new { begin = begin, end = end }, null, true, 1200, CommandType.StoredProcedure); - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -1021,8 +984,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _ls.Add(itm); } - - //数据整合,相同看板号+物料号的交货单号合并成一行中以逗号分隔 foreach (var itm1 in _list) { @@ -1034,12 +995,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } - /// /// 红旗未结明细数据输出(包含有发货有结算中发货大于结算的数据) /// @@ -1322,7 +1281,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report #endregion - #region 又更改规则了20220425 要求去比对出库单 //string str = "SELECT\n" + //" * \n" + @@ -1492,12 +1450,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" ) UNION2"; #endregion - //var _sql = string.Format(str, contion, condition,version); var _sql = string.Format(str, contion, conditionDate); - - //发运数据中,查出看板号+物料号相同的重复数据 //var sql2 = "SELECT\n" + //" a.WmsBillNum,\n" + @@ -1529,9 +1484,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql2 = string.Format(sql2, condition); var listCompare = DbConnection.Query(_sql2); - - - //查询发运表中,看权号+物料号没有重复的数据 //var sql3 = "SELECT\n" + //" a.WmsBillNum,\n" + @@ -1569,7 +1521,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var listCompare1 = DbConnection.Query(_sql3); - string contionCompare = string.Empty; //选中,是否过滤掉当期结算数据 if (iscontionversion == "0") @@ -1615,12 +1566,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // "WHERE\n" + // " t2.HQHKanBan IS NULL"; - //var list_leftjoin_hplatform = DbConnection.Query(string.Format(sql10, contionCompare)); - - - ////红旗结算数据中,看板号+物料号有重复的数据 //var sql11 = "SELECT DISTINCT\n" + //" t1.* \n" + @@ -1656,7 +1603,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" t1.MaterialCode"; //var list_innerjoin_hplatform = DbConnection.Query(string.Format(sql11, contionCompare)); - //string contionCompareBJ = string.Empty; ////选中,是否过滤掉当期结算数据 //if (iscontionversion == "0") @@ -1681,7 +1627,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //var list_hplaform_bj = DbConnection.Query(string.Format(sql12, contionCompareBJ)); - ////结算数据比较 //List _lscopy = new List(); @@ -1709,7 +1654,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //} #endregion - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -1766,13 +1710,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //} } - return _list; } - - public virtual List GetSharePartSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string materialGroup) { @@ -1780,7 +1721,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //string condition = " where 1=1 "; - string condition = " "; //if (!string.IsNullOrEmpty(begin)) //{ @@ -1791,7 +1731,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // condition += string.Format(" and a.LastModificationTime<='{0}' ", end); //} - string str = "SELECT\n" + " temp1.*,\n" + " isnull( temp2.Price, 0 ) 发货定价,\n" + @@ -1871,7 +1810,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //string condition = " where 1=1 "; - string condition = " "; //if (!string.IsNullOrEmpty(begin)) //{ @@ -1953,8 +1891,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public HQHSharePartSettledDetailDiff() { } - public HQHSharePartSettledDetailDiff(string sapMaterialCode, string materialCode, string materialDesc,decimal price, - string storageLocation,string storageLocationDesc,decimal selprice,decimal diffprice,decimal sumprice,decimal settleprice, decimal qty, + public HQHSharePartSettledDetailDiff(string sapMaterialCode, string materialCode, string materialDesc, decimal price, + string storageLocation, string storageLocationDesc, decimal selprice, decimal diffprice, decimal sumprice, decimal settleprice, decimal qty, decimal sockQty) { Sap编码 = sapMaterialCode; @@ -1992,7 +1930,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "零件中文名称")] public string 零件中文名称 { set; get; } - + [ExporterHeader(DisplayName = "验收单日期")] public string 验收单日期 { set; get; } @@ -2015,14 +1953,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "差异总金额")] public decimal 差异总金额 { set; get; } - - [ExporterHeader(DisplayName = "寄销库数量")] public decimal 寄销库数量 { set; get; } - - - } public class HQHSharePartSettledDetailDiffSum @@ -2033,7 +1966,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } public HQHSharePartSettledDetailDiffSum(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 materialgroup) + decimal sockQty, string materialgroup) { Sap编码 = sapMaterialCode; 物料描述 = materialDesc; @@ -2049,7 +1982,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report 结算金额 = settleprice; 物料组 = materialgroup; } - [ExporterHeader(DisplayName = "工厂",IsIgnore =true)] + [ExporterHeader(DisplayName = "工厂", IsIgnore = true)] public string 工厂 { set; get; } [ExporterHeader(DisplayName = "收货仓库")] public string 收货仓库 { set; get; } @@ -2071,7 +2004,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "零件中文名称")] public string 物料描述 { set; get; } - [ExporterHeader(DisplayName = "验收单日期",IsIgnore =true)] + [ExporterHeader(DisplayName = "验收单日期", IsIgnore = true)] public string 验收单日期 { set; get; } [ExporterHeader(DisplayName = "结算验收单号", IsIgnore = true)] @@ -2096,9 +2029,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "寄销库数量")] public decimal 寄销库数量 { set; get; } - - - } public class HQHSettledDetailDiff { @@ -2161,7 +2091,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "看板编号")] public string 看板编号 { set; get; } - + } public class HQHSettledDetailDiffDto @@ -2188,7 +2118,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string Sap编码 { set; get; } [ExporterHeader(DisplayName = "零件中文名称")] public string 零件中文名称 { set; get; } - + [ExporterHeader(DisplayName = "结算数量")] public decimal 结算数量 { set; get; } [ExporterHeader(DisplayName = "结算单价")] @@ -2207,7 +2137,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 看板编号 { set; get; } } - public class HQHUnSettledDetailDiff { [ExporterHeader(DisplayName = "交货单号")] @@ -2220,7 +2149,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 收货仓库描述 { set; get; } [ExporterHeader(DisplayName = "订货看板编号")] public string 订货看板编号 { set; get; } - [ExporterHeader(DisplayName = "订货零件号",IsIgnore =true)] + [ExporterHeader(DisplayName = "订货零件号", IsIgnore = true)] public string 订货零件号 { set; get; } [ExporterHeader(DisplayName = "发货零件号", IsIgnore = true)] public string 发货零件号 { set; get; } @@ -2230,16 +2159,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 客户物料号 { set; get; } [ExporterHeader(DisplayName = "零件中文名称")] public string 零件中文名称 { set; get; } - + [ExporterHeader(DisplayName = "物料组(车型)")] public string 物料组 { set; get; } [ExporterHeader(DisplayName = "验收单日期")] public string 验收单日期 { set; get; } - [ExporterHeader(DisplayName = "结算验收单号",IsIgnore =true)] + [ExporterHeader(DisplayName = "结算验收单号", IsIgnore = true)] public string 结算验收单号 { set; get; } - [ExporterHeader(DisplayName = "外部单号")] + [ExporterHeader(DisplayName = "外部单号")] public string 外部单号 { set; get; } [ExporterHeader(DisplayName = "发货数量")] @@ -2270,7 +2199,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "差异总金额")] public decimal 差异总金额 { set; get; } - [ExporterHeader(DisplayName = "工厂",IsIgnore =true)] + [ExporterHeader(DisplayName = "工厂", IsIgnore = true)] public string 工厂 { set; get; } [ExporterHeader(DisplayName = "看板编号")] @@ -2286,7 +2215,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 交货单号 { set; get; } [ExporterHeader(DisplayName = "交货时间")] public string 交货时间 { set; get; } - + [ExporterHeader(DisplayName = "订货看板编号")] public string 订货看板编号 { set; get; } [ExporterHeader(DisplayName = "订货零件号", IsIgnore = true)] @@ -2303,7 +2232,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "物料组(车型)")] public string 物料组 { set; get; } - [ExporterHeader(DisplayName = "验收单日期",IsIgnore =true)] + [ExporterHeader(DisplayName = "验收单日期", IsIgnore = true)] public string 验收单日期 { set; get; } [ExporterHeader(DisplayName = "发货数量")] @@ -2327,10 +2256,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "实际发货总金额")] public decimal 实际发货总金额 { set; get; } - [ExporterHeader(DisplayName = "看板编号",IsIgnore =true)] + [ExporterHeader(DisplayName = "看板编号", IsIgnore = true)] public string 看板编号 { set; get; } - } public class HQHSettleQtyDiff diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHShippingDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHShippingDapperRepository.cs index fe6f333b..1750a850 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHShippingDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQHShippingDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -72,7 +69,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public class HQHShippingDiff { [ExporterHeader(DisplayName = "交货单号")] @@ -103,7 +99,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 收货仓库描述 { set; get; } [ExporterHeader(DisplayName = "供应商")] public string 供应商 { set; get; } - + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs index 2b402a17..058bd810 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMSettledDetailDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -27,7 +24,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string condition = " "; - ////if (!string.IsNullOrEmpty(materialCode)) ////{ @@ -123,8 +119,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - public virtual List GetDiffQtyList(string version) { List _list = new List(); @@ -146,7 +140,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query(str, null, null, true, 1200, null); _list = _query.ToList(); - return _list; } @@ -157,8 +150,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string condition = " "; - - if (!string.IsNullOrEmpty(begin)) { condition += string.Format(" and a.LastModificationTime>='{0}' ", begin); @@ -215,9 +206,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - - } public class HQMSharePartSettledDetailDiff @@ -246,7 +234,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "寄销库数量")] public decimal 寄销库数量 { set; get; } - } public class HQMSettledDetailDiff { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMShippingDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMShippingDapperRepository.cs index 191e9c81..2e531cc8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMShippingDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/HQMShippingDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -71,7 +68,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public class HQMShippingDiff { [ExporterHeader(DisplayName = "交货单号")] diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoicePriceListDiffDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoicePriceListDiffDapperRepository.cs index 5817bc73..3df1842b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoicePriceListDiffDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoicePriceListDiffDapperRepository.cs @@ -1,22 +1,14 @@ -using Dapper; -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Reports.InvoicePriceListDiff; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccount { - public class InvoicePriceListDiffDapperRepository :DapperRepository, ITransientDependency + public class InvoicePriceListDiffDapperRepository : DapperRepository, ITransientDependency { public InvoicePriceListDiffDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -30,7 +22,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount " a.Number, a.Accounting, a.AccountDate, b.BeginDate, b.EndDate, isnull(b.Price,0) Price, b.Type\n" + " FROM Set_Invoice AS a Left JOIN\n" + " Set_PriceList AS b ON a.MaterialCode = b.MaterialCode\n" + - " WHERE (a.InputDate BETWEEN b.BeginDate AND b.EndDate) " ; + " WHERE (a.InputDate BETWEEN b.BeginDate AND b.EndDate) "; var _query = DbConnection.Query(sqlString); var _list = _query.ToList(); var query = from itm in _list group itm by new { itm.MaterialCode, itm.TextCode } into g where g.Count() > 1 select g; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs index 8c8fc90a..dd4e686a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDetailDiffDapperRepository.cs @@ -1,21 +1,15 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - + /// /// 2.大众发票与结算核对明细表-准时化 /// @@ -25,14 +19,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } - public virtual List GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end ,string cp7begin,string cp7end,string kennCode,string chassisNumber,string materialGroup) + public virtual List GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup) { List _list = new List(); - - if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Count(p => p.Version == version)>0) + + if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Any(p => p.Version == version)) { - _list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p=>p.Version==version).ToList(); - _list= _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + _list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p => p.Version == version).ToList(); + _list = _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); } else { @@ -59,14 +53,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report condition += string.Format(" and B.cp7<='{0}' ", cp7end); } - string tablestr = (_count == 0) ? " ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" : " (SELECT * FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}') b \n"; string str = "SELECT\n" + - string.Format(" '{0}' version ,\n",version)+ + string.Format(" '{0}' version ,\n", version) + " temp1.*,\n" + " TEMP2.Price,(\n" + " Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" + @@ -122,7 +115,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _list = _query.ToList(); - if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Count(p => p.Version == version) > 0) + if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Any(p => p.Version == version)) { _list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p => p.Version == version).ToList(); _list = _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); @@ -136,8 +129,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report CacheManager.CacheInvoiceSettledDetailDiff.AddRange(_list); } - - } return _list; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs index bdfe7f08..44e7542b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffDapperRepository.cs @@ -1,9 +1,6 @@ -using Dapper; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -12,7 +9,6 @@ using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob { - /// /// 1.大众发票与结算汇总核对表-UPdate /// @@ -25,8 +21,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob public virtual List GetInvoiceSettledDiffReportList(string version, string year, string tablename, string materialcode) { - - string sqlString = "SELECT\n" + " temp1.*, temp1.InvoicePrice - Isnull( temp2.Price, 0 ) DiffPrice , \n" + @@ -53,7 +47,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob " b.InvoiceQty - ISnull(\n" + " c.Qty,\n" + " IsNull( d.qty, 0 ))) DiffQty,\n" + - + " g.MaterialCode AS SapMaterialCode,\n" + " g.MaterialDesc AS MaterialDesc, \n" + " g.EstimateTypeDesc as SapMaterialGroup \n " + @@ -93,24 +87,14 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob " Set_PriceListVersion \n" + " )) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode"; - - - - string _sql = string.Format(sqlString, version); var _query = DbConnection.Query(_sql); - var _list = _query.OrderBy(p => p.Factory).ToList(); - - - return _list; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffRepository.cs index c0458f0e..9e518cca 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffRepository.cs @@ -1,14 +1,10 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccount @@ -24,12 +20,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount try { DbContext.Database.SetCommandTimeout(1200); - + DbContext.BulkInsert(list); } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffVersionRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffVersionRepository.cs index aa72722c..0a548bbc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffVersionRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/InvoiceSettledDiffVersionRepository.cs @@ -1,14 +1,9 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.Invoices; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccount @@ -19,21 +14,20 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount { } - - public virtual bool Insert(Guid Id,string p_version, string p_customCode, string p_factory,string customName,string creatorName,string projectName ) + public virtual bool Insert(Guid Id, string p_version, string p_customCode, string p_factory, string customName, string creatorName, string projectName) { try { - var version = new InvoiceSettledDiffVersion(Id, DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode, customName,creatorName,projectName); - List _ls = new List(); - _ls.Add(version); - DbContext.BulkInsert(_ls); - + var version = new InvoiceSettledDiffVersion(Id, DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode, customName, creatorName, projectName); + List _ls = new List(); + _ls.Add(version); + DbContext.BulkInsert(_ls); + } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs index df80f958..a741863f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/KanbanUnSettledDapperRepository.cs @@ -1,16 +1,11 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.FISes; -using Win.Sfs.SettleAccount.FISes; //using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report @@ -18,7 +13,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public class SettleKBWithOutCode { - // Factory MaterialCode InvoiceQty InvoiceAmt InvoicePrice SapMaterialCode MaterialDesc SapMaterialGroup DiffPrice SalePrice SocketQty + // Factory MaterialCode InvoiceQty InvoiceAmt InvoicePrice SapMaterialCode MaterialDesc SapMaterialGroup DiffPrice SalePrice SocketQty [ExporterHeader(DisplayName = "期间")] public string Version { get; set; } @@ -34,7 +29,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string MaterialDesc { get; set; } [ExporterHeader(DisplayName = "开票数量")] public decimal InvoiceQty { get; set; } - [ExporterHeader(DisplayName ="发货数量")] + [ExporterHeader(DisplayName = "发货数量")] public decimal Qty { get; set; } [ExporterHeader(DisplayName = "开票金额")] public decimal InvoiceAmt { get; set; } @@ -54,11 +49,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public decimal DiffPrice { get; set; } } - - - - - public class KanbanUnSettled { [ExporterHeader(DisplayName = "交货单号")] @@ -75,7 +65,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string CustomerPartCode { set; get; } [ExporterHeader(DisplayName = "物料组")] public string MaterialGroup { set; get; } - [ExporterHeader(DisplayName = "结算数量",IsIgnore =true)] + [ExporterHeader(DisplayName = "结算数量", IsIgnore = true)] public decimal SettleQty { set; get; } [ExporterHeader(DisplayName = "发货数量")] public decimal WMSDeliveryQty { set; get; } @@ -84,7 +74,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "实际发货数量")] public decimal DiffQty { set; get; } - [ExporterHeader(DisplayName = "单价")] public decimal Price { set; get; } [ExporterHeader(DisplayName = "差异金额")] @@ -115,12 +104,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "差异金额")] public string DiffAMT { set; get; } - - } - - public class CompareKanban { public string WmsBillNum { set; get; } @@ -131,10 +116,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - - - public class KanbanUnSettledDapperRepository : DapperRepository, ITransientDependency { public KanbanUnSettledDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) @@ -315,8 +296,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" ) aaa \n" + //" WHERE 1=1"; - - #region 原定规则,又改了! //string sql = "SELECT\n" + //" * \n" + @@ -481,8 +460,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report #endregion - sql = string.Format(sql,contion,strDate); - + sql = string.Format(sql, contion, strDate); //发运数据中,查出看板号+物料号相同的重复数据 var sql2 = "SELECT\n" + @@ -496,10 +474,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " 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 _sql2 = string.Format(sql2, str); var listCompare = DbConnection.Query(_sql2); - //查询发运表中,看权号+物料号没有重复的数据 var sql3 = "SELECT\n" + " a.WMSDeliveryNote WmsBillNum,\n" + @@ -516,7 +493,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql3 = string.Format(sql3, str); var listCompare1 = DbConnection.Query(_sql3); - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -555,7 +531,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _query = DbConnection.Query(sql, null, null, true, 1200, null); var _list = _query.ToList(); - //数据整合,相同看板号+物料号的交货单号合并成一行中以逗号分隔 foreach (var itm1 in _list) { @@ -567,9 +542,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - - - return _list; } @@ -636,15 +608,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) 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(sql, null, null, true, 1200, null); var _list = _query.ToList(); return _list; } - /// /// 有发货有结算,且发货数量大于结算数量的数据,将要整合到未结数据中 /// @@ -707,23 +676,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) 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(sql, null, null, true, 1200, null); var _list = _query.ToList(); return _list; } - - - - - - - - - public virtual List GetNoKanbanReportList(string version, string begintime, string endtime) { var sql = "SELECT\n" + @@ -748,7 +706,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) temp1\n" + " 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(sql, null, null, true, 1200, null); var _list = _query.ToList(); return _list; @@ -758,7 +715,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var sql = " SELECT\n" + - " '{0}' Version ,"+ + " '{0}' Version ," + " temp1.Factory,\n" + " temp1.MaterialCode,\n" + " temp1.InvoiceQty,\n" + @@ -770,8 +727,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.InvoicePrice - ISNULL( temp2.Price, 0 ) AS DiffPrice,\n" + " temp2.Price AS SalePrice \n" + - ", temp1.ClaimQty \n"+ - ", temp1.CP7ScrapQty \n"+ + ", temp1.ClaimQty \n" + + ", temp1.CP7ScrapQty \n" + " FROM\n" + " (\n" + @@ -785,12 +742,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " g.MaterialDesc,\n" + " g.EstimateTypeDesc AS SapMaterialGroup, \n" + - " CASE WHEN e.Type = 'CP7报废' THEN \n"+ - " isnull(e.Qty, 0) ELSE 0 \n"+ - " END AS CP7ScrapQty, \n"+ - " CASE WHEN e.Type = '索赔' THEN \n"+ - " isnull(e.Qty, 0) ELSE 0 \n"+ - " END AS ClaimQty \n"+ + " CASE WHEN e.Type = 'CP7报废' THEN \n" + + " isnull(e.Qty, 0) ELSE 0 \n" + + " END AS CP7ScrapQty, \n" + + " CASE WHEN e.Type = '索赔' THEN \n" + + " isnull(e.Qty, 0) ELSE 0 \n" + + " END AS ClaimQty \n" + " FROM\n" + " (\n" + @@ -853,15 +810,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " temp1.SapMaterialGroup IN ( '柱护板成品-NCS', '高光盖板成品-BORA', '高光盖板成品-A SUV', '高光盖板成品-B9 ACC', '成品-NCS NF装饰条', '成品-Q3 HG' ))"; string str = string.Empty; - str += " where 1=1 "; sql = string.Format(sql, version); var _query = DbConnection.Query(sql, null, null, true, 1200, null); var _list = _query.ToList(); return _list; - - - } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs index cc068b8f..d9c8b398 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PriceQtyDiffDapperReportRepository.cs @@ -1,13 +1,10 @@ -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.SettleAccount.Entities.ERPDto; -using Dapper; -using Volo.Abp.DependencyInjection; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { @@ -22,9 +19,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public virtual List GetDiffReport(string year, string customcode, string version) { - - - string sqlString = " SELECT 物料编码, 描述, Qad出库数量, 发票数量, 量差, 量差金额, 发票单价, 核算单价, 发票合计, 单价差, 转化后QAD金额, " + @@ -74,12 +68,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " WHERE(Version = '{0}') AND(CustomerCode = 'R0003')) AS temp6 ON " + " temp1.MaterialCode = temp6.SettlementPartCode) AS F"; - - string _sql = string.Format(sqlString, version); var _query = DbConnection.Query(_sql); - var _list= _query.ToList(); - + var _list = _query.ToList(); + return _list; } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs index 519eddd5..5cb5434f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/PubSaSeCompareDapperRepository.cs @@ -8,32 +8,32 @@ using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; - -/// -/// Pub结算与发运对比Dapper仓储 -/// -public class PubSaSeCompareDapperRepository : DapperRepository, ITransientDependency +namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - public PubSaSeCompareDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - /// - /// 获取差异 + /// Pub结算与发运对比Dapper仓储 /// - public virtual List GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime) + public class PubSaSeCompareDapperRepository : DapperRepository, ITransientDependency { - string strSeWhere = string.Empty; - if (!string.IsNullOrWhiteSpace(seStartDateTime)) + public PubSaSeCompareDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { - strSeWhere = $" AND BillTime >= '{seStartDateTime}' "; } - if (!string.IsNullOrWhiteSpace(seEndDateTime)) + + /// + /// 获取差异 + /// + public virtual List GetDetailDiffReportList(string businessType, string version, string seStartDateTime, string seEndDateTime) { - strSeWhere = $" AND BillTime <= '{seEndDateTime}' "; - } - string strSqlText = @$" + string strSeWhere = string.Empty; + if (!string.IsNullOrWhiteSpace(seStartDateTime)) + { + strSeWhere = $" AND BillTime >= '{seStartDateTime}' "; + } + if (!string.IsNullOrWhiteSpace(seEndDateTime)) + { + strSeWhere = $" AND BillTime <= '{seEndDateTime}' "; + } + string strSqlText = @$" SELECT A.LU AS SeCustomerPartCode, A.FactoryPartCode AS SeFactoryPartCode, @@ -53,124 +53,122 @@ public class PubSaSeCompareDapperRepository : DapperRepository(strSqlText, null, null, true, 1200, null).ToList(); - } - - public virtual List GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup) - { - List _list = new List(); - - if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Count(p => p.Version == version) > 0) - { - _list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p => p.Version == version).ToList(); - _list = _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + return DbConnection.Query(strSqlText, null, null, true, 1200, null).ToList(); } - else - { - - //string isExistSql = string.Format("SELECT count(1) lincount FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}'", version); - //int _count = DbConnection.ExecuteScalar(isExistSql); - int _count = 0; - string condition = " where 1=1 "; - if (!string.IsNullOrEmpty(begin)) - { - condition += string.Format(" and a.BeginTime>='{0}' ", begin); - } - if (!string.IsNullOrEmpty(end)) - { - condition += string.Format(" and a.BeginTime<='{0}' ", end); - } - if (!string.IsNullOrEmpty(cp7begin)) - { - condition += string.Format(" and B.cp7>='{0}' ", cp7begin); - } - if (!string.IsNullOrEmpty(cp7end)) - { - condition += string.Format(" and B.cp7<='{0}' ", cp7end); - } - - - string tablestr = (_count == 0) ? - " ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" : - - " (SELECT * FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}') b \n"; - string str = - "SELECT\n" + - string.Format(" '{0}' version ,\n", version) + -" temp1.*,\n" + -" TEMP2.Price,(\n" + -" Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" + -"FROM\n" + -" (\n" + -" SELECT\n" + -" b.YEAR,\n" + -" a.OrderBillNum Kenncode,\n" + -" b.MaterialCode,\n" + -" b.Model,\n" + -" a.ChassisNumber,\n" + -" a.Qty,\n" + -" a.BeginTime CP5Time,\n" + -" a.ChassisNumber2,\n" + -" B.CP7 CP7Time,\n" + -" a.QTY SettledQty,\n" + -" a.ErpMaterialCode ParentSapMaterialCode,\n" + -" a.WMSState,\n" + -" a.WMSBillNum,\n" + -" d.MaterialCode SapMaterialCode,\n" + -" d.MaterialDesc MaterialDesc,\n" + -" d.EstimateTypeDesc MaterialGroup,\n" + -" e.MaterialDesc ParentMaterialDesc,\n" + -" c.InvoicePrice,\n" + -" Round( c.InvoicePrice * a.qty,2 ) InvoiceAmt,\n" + -" Round( c.InvoicePrice * a.Qty,2 ) SettleAmt,\n" + -" 0 DiffSettleFisQty,\n" + -" 0 DiffSettleInvQty, \n" + -" a.Qty InvoiceQty ,\n" + -" IsNull( B.Qty, 0 ) SettleReadyQty, \n" + -" a.UnSettleVersion \n" + -" FROM\n" + -tablestr + - -" INNER JOIN Set_fis a ON b.ChassisNumber = a.ChassisNumber2 \n" + -" AND b.KENNCode = a.KENNCode \n" + -" AND b.MaterialCode = a.ItemCode\n" + -" LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON a.ItemCode = c.MaterialCode\n" + -" LEFT JOIN set_material d ON a.ItemCode = d.CustomerPartCode\n" + -" LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) e ON a.ErpMaterialCode = e.MaterialCode {1} \n" + -" ) TEMP1\n" + -" LEFT JOIN (\n" + -" SELECT\n" + -" Price,\n" + -" MaterialCode \n" + -" FROM\n" + -" Set_PriceList \n" + -" WHERE\n" + -" 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(_sql, null, null, true, 1200, null); - - _list = _query.ToList(); + public virtual List GetInvoiceSettledDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup) + { + List _list = new List(); - if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Count(p => p.Version == version) > 0) + if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Any(p => p.Version == version)) { _list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p => p.Version == version).ToList(); _list = _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); } else { - if (CacheManager.CacheInvoiceSettledDetailDiff == null) + + //string isExistSql = string.Format("SELECT count(1) lincount FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}'", version); + //int _count = DbConnection.ExecuteScalar(isExistSql); + int _count = 0; + + string condition = " where 1=1 "; + if (!string.IsNullOrEmpty(begin)) { - CacheManager.CacheInvoiceSettledDetailDiff = new List(); + condition += string.Format(" and a.BeginTime>='{0}' ", begin); + } + if (!string.IsNullOrEmpty(end)) + { + condition += string.Format(" and a.BeginTime<='{0}' ", end); + } + if (!string.IsNullOrEmpty(cp7begin)) + { + condition += string.Format(" and B.cp7>='{0}' ", cp7begin); + } + if (!string.IsNullOrEmpty(cp7end)) + { + condition += string.Format(" and B.cp7<='{0}' ", cp7end); } - CacheManager.CacheInvoiceSettledDetailDiff.AddRange(_list); - } + string tablestr = (_count == 0) ? + " ( SELECT * FROM Set_Settle b WHERE b.Version = '{0}' ) b\n" : + + " (SELECT * FROM [Set_Settle_RAM] WITH(SNAPSHOT) where Version = '{0}') b \n"; + string str = + "SELECT\n" + + string.Format(" '{0}' version ,\n", version) + + " temp1.*,\n" + + " TEMP2.Price,(\n" + + " Isnull( temp2.Price, 0 ) * isnull( temp1.Qty, 0 )) Amt \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " b.YEAR,\n" + + " a.OrderBillNum Kenncode,\n" + + " b.MaterialCode,\n" + + " b.Model,\n" + + " a.ChassisNumber,\n" + + " a.Qty,\n" + + " a.BeginTime CP5Time,\n" + + " a.ChassisNumber2,\n" + + " B.CP7 CP7Time,\n" + + " a.QTY SettledQty,\n" + + " a.ErpMaterialCode ParentSapMaterialCode,\n" + + " a.WMSState,\n" + + " a.WMSBillNum,\n" + + " d.MaterialCode SapMaterialCode,\n" + + " d.MaterialDesc MaterialDesc,\n" + + " d.EstimateTypeDesc MaterialGroup,\n" + + " e.MaterialDesc ParentMaterialDesc,\n" + + " c.InvoicePrice,\n" + + " Round( c.InvoicePrice * a.qty,2 ) InvoiceAmt,\n" + + " Round( c.InvoicePrice * a.Qty,2 ) SettleAmt,\n" + + " 0 DiffSettleFisQty,\n" + + " 0 DiffSettleInvQty, \n" + + " a.Qty InvoiceQty ,\n" + + " IsNull( B.Qty, 0 ) SettleReadyQty, \n" + + " a.UnSettleVersion \n" + + " FROM\n" + + tablestr + + + " INNER JOIN Set_fis a ON b.ChassisNumber = a.ChassisNumber2 \n" + + " AND b.KENNCode = a.KENNCode \n" + + " AND b.MaterialCode = a.ItemCode\n" + + " LEFT JOIN ( SELECT SUM( amt )/ SUM( Qty ) InvoicePrice, MaterialCode FROM set_invoice WHERE version = '{0}' GROUP BY materialcode ) c ON a.ItemCode = c.MaterialCode\n" + + " LEFT JOIN set_material d ON a.ItemCode = d.CustomerPartCode\n" + + " LEFT JOIN (select max(Id) Id,MaterialCode,MaterialDesc from Set_material group by MaterialCode,MaterialDesc) e ON a.ErpMaterialCode = e.MaterialCode {1} \n" + + " ) TEMP1\n" + + " LEFT JOIN (\n" + + " SELECT\n" + + " Price,\n" + + " MaterialCode \n" + + " FROM\n" + + " Set_PriceList \n" + + " WHERE\n" + + " 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(_sql, null, null, true, 1200, null); + + _list = _query.ToList(); + + if (CacheManager.CacheMaterials != null && CacheManager.CacheInvoiceSettledDetailDiff.Any(p => p.Version == version)) + { + _list = CacheManager.CacheInvoiceSettledDetailDiff.Where(p => p.Version == version).ToList(); + _list = _list.GroupBy(p => new { p.ChassisNumber, p.MaterialCode, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + } + else + { + if (CacheManager.CacheInvoiceSettledDetailDiff == null) + { + CacheManager.CacheInvoiceSettledDetailDiff = new List(); + } + CacheManager.CacheInvoiceSettledDetailDiff.AddRange(_list); + } + } + return _list; } - return _list; - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchBaseDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchBaseDapperReportRepository.cs index 5dc6644d..693214f5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchBaseDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchBaseDapperReportRepository.cs @@ -1,13 +1,10 @@ -using Dapper; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.SettleAccount.Entities.SecMatch; @@ -19,9 +16,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { - } - public virtual List GetReportList(string version,string model) + public virtual List GetReportList(string version, string model) { List _ls = new List(); @@ -29,7 +25,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var sql1 = " SELECT\n " + - + " '{0}' Version,\n" + " Price,\n" + " ISNULL( SettlementPrice, 0 ) SettlementPrice,(\n" + @@ -76,11 +72,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " MaterialCode \n" + " ) temp2 ON temp1.SettlementPartCode = temp2.MaterialCode "; - sql1 = string.Format(sql1, version); List _ls1 = DbConnection.Query(sql1).ToList(); - var sql2= " SELECT\n" + - + var sql2 = " SELECT\n" + + " A.Version,\n" + " ( A.Model + A.PartType ) [INDEX],\n" + " c.Description Factory,\n" + @@ -110,7 +105,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND a.Version = b.Version\n" + " LEFT JOIN ( SELECT Project, VALUE, Description FROM Set_code WHERE project = '工厂车型' ) c ON a.Model = c.\n" + "VALUE\n" + - + "WHERE\n" + " a.Version = '{0}'"; sql2 = string.Format(sql2, version); @@ -133,17 +128,17 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report , 1 , 1 , String.Empty - ,itm.Price - ,itm.SettlementPrice - ,itm.DiffPrice - ,itm.SettlementNumber - ,itm.TheoreticalSettlementNumber - ,itm.RealSettlementNumber - ,itm.RealSettlementPrice - ,false - ,itm.DiffAmount + , itm.Price + , itm.SettlementPrice + , itm.DiffPrice + , itm.SettlementNumber + , itm.TheoreticalSettlementNumber + , itm.RealSettlementNumber + , itm.RealSettlementPrice + , false + , itm.DiffAmount , string.Empty - ,"结算件" + , "结算件" ); itm.PartType = "结算件"; itm.MaterialPartCode = itm.SettleMentPartCode; @@ -186,7 +181,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } if (!string.IsNullOrEmpty(model)) { - _ls=_ls.Where(p => p.Model == model).ToList(); + _ls = _ls.Where(p => p.Model == model).ToList(); } return _ls; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchSummaryDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchSummaryDapperReportRepository.cs index ed5bbc06..dce70c99 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchSummaryDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SecMatchSummaryDapperReportRepository.cs @@ -1,9 +1,6 @@ -using Dapper; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -17,13 +14,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { - } public virtual List GetReportList(string version, string model) { - - var sql= " SELECT \n" + + var sql = " SELECT \n" + " row_number() over(order by SupplierCode) as RowId ,\n" + " SupplierCode ,\n" + " SupplierName ,\n" + @@ -51,73 +46,59 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) a pivot (\n" + " sum( a.RealSettlementPrice ) FOR Model IN ([AUDI Q5],[BORA NF],[AUDI B9])) c "; - sql= string.Format(sql, version); + sql = string.Format(sql, version); var _query = DbConnection.Query(sql); return _query.ToList(); - //return _ls; } - - public virtual List GetReportSummaryList(string version, string model) { - var sql= "select \n" + - "车型,\n" + - "isnull([二次配套件],0) [二次配套件],\n" + - "isnull([CKD返协],0) [CKD返协],\n" + - "isnull([自制件],0) [自制件],\n" + - "isnull([装配费],0) [装配费],\n" + - "isnull([结算件差异金额],0) [结算件差异金额] ,\n" + - "isnull([补结算],0) [补结算],\n" + - "isnull([二配+补结],0) [二配+补结],\n" + - "isnull([二次配套件],0) +\n" + - "isnull([CKD返协],0) +\n" + - "isnull([自制件],0)+\n" + - "isnull([装配费],0) +\n" + - "isnull([结算件差异金额],0) +\n" + - "isnull([补结算],0) +\n" + - "isnull([二配+补结],0) [小计],\n" + - "isnull([结算件],0) [结算件],\n" + - "isnull([差异结算/补结算],0) [差异结算/补结算],\n" + - "isnull([二次配套件],0) +\n" + - "isnull([CKD返协],0) +\n" + - "isnull([自制件],0)+\n" + - "isnull([装配费],0) +\n" + - "isnull([结算件差异金额],0) +\n" + - "isnull([补结算],0) +\n" + - "isnull([二配+补结],0)+\n" + - "isnull([结算件],0)+\n" + - "isnull([差异结算/补结算],0) [实际结算金额],\n" + - "isnull([测试未发现结算差异],0) [测试未发现结算差异]\n" + - "FROM\n" + - "(SELECT model 车型, PartType,RealSettlementPrice\n" + - " FROM [SettleAccountService].[dbo].[Set_SecMatchBase] ) a\n" + - " pivot \n" + - " ( sum(a.RealSettlementPrice) for a.parttype in ( [二次配套件],[CKD返协],[自制件],[装配费],[结算件差异金额],[补结算],[二配+补结],[小计],[结算件],[差异结算/补结算],[实际结算金额],[测试未发现结算差异])) RES"; + var sql = "select \n" + + "车型,\n" + + "isnull([二次配套件],0) [二次配套件],\n" + + "isnull([CKD返协],0) [CKD返协],\n" + + "isnull([自制件],0) [自制件],\n" + + "isnull([装配费],0) [装配费],\n" + + "isnull([结算件差异金额],0) [结算件差异金额] ,\n" + + "isnull([补结算],0) [补结算],\n" + + "isnull([二配+补结],0) [二配+补结],\n" + + "isnull([二次配套件],0) +\n" + + "isnull([CKD返协],0) +\n" + + "isnull([自制件],0)+\n" + + "isnull([装配费],0) +\n" + + "isnull([结算件差异金额],0) +\n" + + "isnull([补结算],0) +\n" + + "isnull([二配+补结],0) [小计],\n" + + "isnull([结算件],0) [结算件],\n" + + "isnull([差异结算/补结算],0) [差异结算/补结算],\n" + + "isnull([二次配套件],0) +\n" + + "isnull([CKD返协],0) +\n" + + "isnull([自制件],0)+\n" + + "isnull([装配费],0) +\n" + + "isnull([结算件差异金额],0) +\n" + + "isnull([补结算],0) +\n" + + "isnull([二配+补结],0)+\n" + + "isnull([结算件],0)+\n" + + "isnull([差异结算/补结算],0) [实际结算金额],\n" + + "isnull([测试未发现结算差异],0) [测试未发现结算差异]\n" + + "FROM\n" + + "(SELECT model 车型, PartType,RealSettlementPrice\n" + + " FROM [SettleAccountService].[dbo].[Set_SecMatchBase] ) a\n" + + " pivot \n" + + " ( sum(a.RealSettlementPrice) for a.parttype in ( [二次配套件],[CKD返协],[自制件],[装配费],[结算件差异金额],[补结算],[二配+补结],[小计],[结算件],[差异结算/补结算],[实际结算金额],[测试未发现结算差异])) RES"; sql = string.Format(sql, version); var _query = DbConnection.Query(sql); return _query.ToList(); - //return _ls; } - - - - - - - - } } - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleDoorPanelDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleDoorPanelDapperRepository.cs index 502143b9..1c5d0975 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleDoorPanelDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleDoorPanelDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -17,7 +14,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } - public virtual List GetSettleDoorPanelReportList(string estimateTypeDesc, string version, string sapCode, string matialCode) { string sqlString = "SELECT\n" + @@ -97,9 +93,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "单价差异")] public decimal InvoiceDiffPrice { set; get; } - - - } public class SettleDoorPanelSumExport @@ -109,12 +102,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "期间")] public string Version { set; get; } - [ExporterHeader(DisplayName = "物料组(车型)")] public string MaterialGroup { set; get; } - - [ExporterHeader(DisplayName = "价格差异总金额")] public decimal InvoiceDiffPrice { set; get; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs index b3a2d5a0..d5dd586a 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleFisDiffDetailDapperRepository.cs @@ -1,12 +1,8 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using System; using System.Collections.Generic; -using System.Data.Common; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -18,32 +14,32 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { [ExporterHeader(DisplayName = "年")] public string Year { set; get; } - [ExporterHeader(DisplayName = "KENN号" )] + [ExporterHeader(DisplayName = "KENN号")] public string KENNCode { set; get; } [ExporterHeader(DisplayName = "底盘号")] public string ChassisNumber { set; get; } - [ExporterHeader(DisplayName = "车型" )] + [ExporterHeader(DisplayName = "车型")] public string Model { set; get; } - [ExporterHeader(DisplayName = "CP5A日期" )] + [ExporterHeader(DisplayName = "CP5A日期")] public string CP5A { set; get; } - [ExporterHeader(DisplayName = "CP7日期" )] + [ExporterHeader(DisplayName = "CP7日期")] public string CP7 { set; get; } - [ExporterHeader(DisplayName = "零件号" )] + [ExporterHeader(DisplayName = "零件号")] public string MaterialCode { set; get; } - [ExporterHeader(DisplayName = "结算数量" )] + [ExporterHeader(DisplayName = "结算数量")] public decimal SettleQty { set; get; } - [ExporterHeader(DisplayName = "M100状态" )] + [ExporterHeader(DisplayName = "M100状态")] public string WMSBillNum { set; get; } - [ExporterHeader(DisplayName = "M100数量" )] + [ExporterHeader(DisplayName = "M100数量")] public decimal Qty { set; get; } [ExporterHeader(DisplayName = "差异")] public decimal DiffQty { set; get; } - [ExporterHeader(DisplayName = "开票单价" )] - public decimal Price{ set; get; } + [ExporterHeader(DisplayName = "开票单价")] + public decimal Price { set; get; } [ExporterHeader(DisplayName = "差异金额")] - public decimal DiffPrice{ set; get; } - [ExporterHeader(DisplayName = "SAP编码")] + public decimal DiffPrice { set; get; } + [ExporterHeader(DisplayName = "SAP编码")] public string SapCode { set; get; } } @@ -52,8 +48,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public class SettleFisDiffSum { - // 物料组车型 SAP编码 零件号 结算数量 M100数量 差异总数 开票单价 差异金额 - + // 物料组车型 SAP编码 零件号 结算数量 M100数量 差异总数 开票单价 差异金额 [ExporterHeader(DisplayName = "物料组车型")] public string MaterialCodeGroup { set; get; } @@ -85,9 +80,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } - - - public virtual List GetReportList(string version, string year, string begintime, string endtime) { @@ -134,30 +126,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _query.ToList(); - - } } - - - - - - - - - - - - - - - - - - - - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs index c1b46d5c..a496f7a2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleKBWithCodeDapperReportRepository.cs @@ -1,10 +1,8 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -29,7 +27,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// public virtual List GetSettleKBWithCodeReportList(string kanBan, string version, string sapMaterialCode, - string customerPartCode,string estimateTypeDesc, string begintime, string endtime) + string customerPartCode, string estimateTypeDesc, string begintime, string endtime) { string condition = " "; @@ -43,9 +41,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report condition += string.Format(" where 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 "; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); + var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); + var datetime = date.ToShortDateString() + " 23:59:59 "; string sqlString = "SELECT\n" + " temp1.* ,\n" + " ISNULL ( temp2.Price, 0 ) AS Price,--开票金额\n" + @@ -97,18 +95,15 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " A.VERSION = '{0}' \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,datetime); + string addSqlStr = string.Format(sqlString, version, condition, datetime); //if (!string.IsNullOrEmpty(kanBan)) //{ @@ -130,10 +125,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string _sql = string.Format(addSqlStr, addwhere); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); - var _lst = _query.ToList(); - var sql1 = "SELECT \n" + " A.WMSDeliveryNote WmsBillNum,\n" + " t1.MaterialCode MaterialCode,\n" + @@ -145,10 +138,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " 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(sql1); - List _ls1 = new List(); foreach (var itm in listCompare1.ToList()) { @@ -174,14 +165,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - - - - - - - var sql2 = "SELECT \n" + " A.WMSDeliveryNote WmsBillNum,\n" + " t1.MaterialCode MaterialCode,\n" + @@ -194,8 +177,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " LEFT JOIN Set_material t1 ON A.MaterialCode = t1.CustomerPartCode"; var listCompare = DbConnection.Query(sql2); - - List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -222,10 +203,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - foreach (var itm1 in _lst) { - itm1.SettleWMSDiffQty = itm1.SettleNumber -( (!string.IsNullOrEmpty(itm1.RealQty))?decimal.Parse(itm1.RealQty): 0); + 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) { @@ -233,8 +213,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report itm1.WMSActualGoodsDate = item.WmsDate; } - - var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.Kanban && p.MaterialCode == itm1.MaterialCode); if (itm != null) { @@ -242,13 +220,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report itm1.WMSActualGoodsDate = itm.WmsDate; } - } return _lst; } - public virtual List GetVWKanBanInvoiceDiff(string version) { var str = "SELECT\n" + @@ -268,18 +244,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _list.ToList(); } - - - - - - - - - - - - /// /// /// @@ -359,9 +323,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //} - - - } /// @@ -391,7 +352,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //[ExporterHeader(DisplayName = "厂内物料号")] //public string SapMaterialCode { set; get; } - [ExporterHeader(DisplayName = "物料组(车型)")] public string EstimateTypeDesc { set; get; } @@ -412,7 +372,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "结算金额")] public decimal SettlePrice { set; get; } - + [ExporterHeader(DisplayName = "结算与发货差异")] public decimal SettleWMSDiffQty { set; get; } @@ -442,8 +402,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "实际交货数量")] public string RealQty { set; get; } - - } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs index d204ec62..c8c25fc1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePart90DapperReportRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -20,7 +17,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } - /// /// 大众备件数据调整:期初没有WMS发运数据,调整的数据就是给WMS一份,给结算一份 /// @@ -126,7 +122,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public virtual List GetSettleSparePart90ReportList_old(string purchaseOrderNo, string version, string sapCode, string matialCode, string begintime, string endtime) { @@ -211,7 +206,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " 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); @@ -290,7 +285,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - //public virtual List GetSettleSparePart90SumQtyDiff(string version) //{ // string sqlString = "SELECT\n" + @@ -306,7 +300,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report // string addwhere = string.Empty; // string addSqlStr = string.Format(sqlString, version); - // string _sql = string.Format(addSqlStr, addwhere); // var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -314,12 +307,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //} - } - - - public class SparePart90SumQtyDiff { public decimal 数量差异 { set; get; } @@ -327,12 +316,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public string 厂内物料号 { set; get; } } - - - - - - /// /// 大众看板有条码报表 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs index 61401990..01e14d38 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartDapperReportRepository.cs @@ -1,11 +1,8 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; - using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -18,8 +15,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } - - /// /// 带采购订单号和无订单号一起统计报表 WHERE Extend != 'is90' 去掉 备件调整数据,开票单价财务说会有调整,做了一个开票单价平均数据 /// @@ -34,7 +29,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string begintime, string endtime) { - //string sqlString = "SELECT\n" + // " union1.* \n" + // "FROM\n" + @@ -267,10 +261,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " AND temp1.[物料代码] = TEMP5.Extend1 \n" + " ) union1"; - - string _sql = string.Format(sqlString, version); - + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); var _lst = _query.ToList(); @@ -289,10 +281,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " A.WMSDeliveryNote IS NOT NULL "; - var listCompare1 = DbConnection.Query(sql1); - List _ls1 = new List(); foreach (var itm in listCompare1.ToList()) { @@ -318,8 +308,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - //取客户物料号CustomerPartCode来匹配 var sql2 = "SELECT\n" + " A.WMSDeliveryNote WmsBillNum,\n" + @@ -334,10 +322,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var listCompare = DbConnection.Query(sql2); - - - - //结算表中订单日期也要合并 var sql10 = "SELECT DISTINCT\n" + " t1.* \n" + @@ -375,13 +359,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " t2.KanbanNumber IS NULL"; - var list11 = DbConnection.Query(string.Format(sql10, version)); - - - - var sql11 = "SELECT DISTINCT\n" + " t1.* \n" + "FROM\n" + @@ -419,46 +398,44 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " t1.KanbanNumber,\n" + " t1.MaterialCode"; - var list12 = DbConnection.Query(string.Format(sql11, version)); //看板号为空的情况下,取外部单号的值 -// var sql12 = " SELECT DISTINCT \n" + -//" t1.* \n" + -//" FROM \n" + -//" ( \n" + -//" SELECT \n" + -//" a.ExternalKanbanNumber AS ExternalKanbanNumber, \n" + -//" a.KanbanNumber AS KanbanNumber, \n" + -//" CONVERT ( VARCHAR ( 100 ), a.AcceptanceDate, 23 ) AS AcceptanceDate, \n" + -//" HQHKanBan, \n" + -//" b2.MaterialCode \n" + -//" FROM \n" + -//" Set_UnHQSettleAccount a \n" + -//" LEFT JOIN Set_material b2 ON a.MaterialCode = b2.CustomerPartCode \n" + -//" WHERE \n" + -//" Version = '{0}' \n" + -//" AND HQHKanBan is null \n" + -//" ) t1 \n" + -//" LEFT JOIN ( \n" + -//" SELECT \n" + -//" HQHKanBan, \n" + -//" MaterialCode \n" + -//" FROM \n" + -//" Set_UnHQSettleAccount a \n" + -//" WHERE \n" + -//" Version = '{0}' \n" + -//" AND HQHKanBan is null \n" + -//" GROUP BY \n" + -//" HQHKanBan, \n" + -//" MaterialCode \n" + -//" HAVING \n" + -//" COUNT ( * ) > 1 \n" + -//" ) t2 ON t1.HQHKanBan = t2.HQHKanBan \n" + -//" AND t1.MaterialCode = t2.MaterialCode "; - -// var list13 = DbConnection.Query(string.Format(sql12, version)); - + // var sql12 = " SELECT DISTINCT \n" + + //" t1.* \n" + + //" FROM \n" + + //" ( \n" + + //" SELECT \n" + + //" a.ExternalKanbanNumber AS ExternalKanbanNumber, \n" + + //" a.KanbanNumber AS KanbanNumber, \n" + + //" CONVERT ( VARCHAR ( 100 ), a.AcceptanceDate, 23 ) AS AcceptanceDate, \n" + + //" HQHKanBan, \n" + + //" b2.MaterialCode \n" + + //" FROM \n" + + //" Set_UnHQSettleAccount a \n" + + //" LEFT JOIN Set_material b2 ON a.MaterialCode = b2.CustomerPartCode \n" + + //" WHERE \n" + + //" Version = '{0}' \n" + + //" AND HQHKanBan is null \n" + + //" ) t1 \n" + + //" LEFT JOIN ( \n" + + //" SELECT \n" + + //" HQHKanBan, \n" + + //" MaterialCode \n" + + //" FROM \n" + + //" Set_UnHQSettleAccount a \n" + + //" WHERE \n" + + //" Version = '{0}' \n" + + //" AND HQHKanBan is null \n" + + //" GROUP BY \n" + + //" HQHKanBan, \n" + + //" MaterialCode \n" + + //" HAVING \n" + + //" COUNT ( * ) > 1 \n" + + //" ) t2 ON t1.HQHKanBan = t2.HQHKanBan \n" + + //" AND t1.MaterialCode = t2.MaterialCode "; + + // var list13 = DbConnection.Query(string.Format(sql12, version)); List _lscopy = new List(); @@ -479,14 +456,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _lscopy.Add(itm); } - - - - - - - - List _ls = new List(); foreach (var itm in listCompare.ToList()) { @@ -512,7 +481,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - foreach (var itm1 in _lst) { //itm1.收货与交货差异 = itm1.收货数量 - ((!string.IsNullOrEmpty(itm1.实际交货数量)) ? decimal.Parse(itm1.实际交货数量) : 0); @@ -523,8 +491,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report itm1.交货日期 = item.WmsDate; } - - var itm = _ls.FirstOrDefault(p => p.Kanban == itm1.采购订单号 && p.MaterialCode == itm1.物料代码); if (itm != null) { @@ -538,15 +504,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report itm1.订单日期 = itmcopy.AcceptanceDate; } - } return _lst; } - - /// /// 大众备件有单号,统计有结算无发货 /// @@ -632,8 +595,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - /// /// 大众备件无单号,求和汇总显示 /// @@ -709,8 +670,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - /// /// 不管备件有无单号,财务要求都做一个汇总,然后和寄售库进行比对 /// @@ -778,16 +737,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) AS temp1\n" + " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode"; - string _sql = string.Format(sqlString, version); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); return _query.ToList(); } - - - /// /// 大众备件未结(带单号),包含有发货有结算(条件:发货数量大于结算数据)也整合到大众备件未结中 /// 用于--寄售未结比对WMS库存(因为日期传参问题,单独拿出) @@ -1138,12 +1093,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" ) unint2"; #endregion - - string _sql = string.Format(sqlString, conditionDate); - - //发运数据中,查出看板号+物料号相同的重复数据 var sql2 = "SELECT\n" + " a.WMSDeliveryNote WmsBillNum,\n" + @@ -1160,9 +1111,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql2 = string.Format(sql2, condition); var listCompare = DbConnection.Query(_sql2); - - - //查询发运表中,看板号+物料号没有重复的数据 var sql3 = "SELECT\n" + " a.WMSDeliveryNote WmsBillNum,\n" + @@ -1179,10 +1127,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql3 = string.Format(sql3, condition); var listCompare1 = DbConnection.Query(_sql3); - - - - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -1218,8 +1162,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _ls.Add(itm); } - - var _query = DbConnection.Query(_sql, null, null, true, 1200, null); _list = _query.ToList(); @@ -1233,7 +1175,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } @@ -1392,13 +1333,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " LEFT OUTER JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE Version = '202110' ) AS TEMP2 ON temp1.SAP编码 = TEMP2.MaterialCode \n" + " ) unint2;"; - - - string _sql = string.Format(sqlString, conditionDate); - - //发运数据中,查出看板号+物料号相同的重复数据 var sql2 = "SELECT\n" + " a.WMSDeliveryNote WmsBillNum,\n" + @@ -1415,9 +1351,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql2 = string.Format(sql2, condition); var listCompare = DbConnection.Query(_sql2); - - - //查询发运表中,看板号+物料号没有重复的数据 var sql3 = "SELECT\n" + " a.WMSDeliveryNote WmsBillNum,\n" + @@ -1434,10 +1367,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql3 = string.Format(sql3, condition); var listCompare1 = DbConnection.Query(_sql3); - - - - //发运数据比较 List _ls = new List(); foreach (var itm in listCompare.ToList()) @@ -1473,8 +1402,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report _ls.Add(itm); } - - var _query = DbConnection.Query(_sql, null, null, true, 1200, null); _list = _query.ToList(); @@ -1488,41 +1415,23 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } } - return _list; } - } - - - - - - - - - - public class SparePartSumQtyDiff -{ - public decimal 数量差异 { set; get; } - public string 订单号 { set; get; } - public string 物料号 { set; get; } -} - - - - - - + { + public decimal 数量差异 { set; get; } + public string 订单号 { set; get; } + public string 物料号 { set; get; } + } -/// -/// 大众看板有条码报表 -/// -//[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)] + /// + /// 大众看板有条码报表 + /// + //[ExcelExporter(Name = "未结明细", AutoFitAllColumn = true, MaxRowNumberOnASheet = 500000)] public class SettleSparePartExport { @@ -1530,11 +1439,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } - - - public SettleSparePartExport( string sapMaterialCode, string materialCode, string materialDesc, - decimal shouqty,decimal reqty, decimal qty, decimal diff,decimal price,decimal invocprice, - decimal dingprice,decimal diffprice,decimal diffsumprice, decimal sockQty) + public SettleSparePartExport(string sapMaterialCode, string materialCode, string materialDesc, + decimal shouqty, decimal reqty, decimal qty, decimal diff, decimal price, decimal invocprice, + decimal dingprice, decimal diffprice, decimal diffsumprice, decimal sockQty) { SAP编码 = sapMaterialCode; 物料代码 = materialCode; @@ -1551,12 +1458,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report 寄售库存数量 = sockQty; } - [ExporterHeader(DisplayName = "交货单号")] public string 交货单号 { set; get; } [ExporterHeader(DisplayName = "交货日期 ")] public string 交货日期 { set; get; } - [ExporterHeader(DisplayName = "订单日期")] public string 订单日期 { set; get; } @@ -1570,7 +1475,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "物料描述")] public string 物料描述 { set; get; } - [ExporterHeader(DisplayName = "采购订单文本",IsIgnore =true)] + [ExporterHeader(DisplayName = "采购订单文本", IsIgnore = true)] public string 采购订单文本 { set; get; } [ExporterHeader(DisplayName = "发货数量")] @@ -1599,10 +1504,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "寄售库存数量")] public decimal 寄售库存数量 { set; get; } - [ExporterHeader(DisplayName = "交货数量",IsIgnore =true)] + [ExporterHeader(DisplayName = "交货数量", IsIgnore = true)] public decimal 交货数量 { set; get; } - [ExporterHeader(DisplayName = "退货数量",IsIgnore =true)] + [ExporterHeader(DisplayName = "退货数量", IsIgnore = true)] public string 退货数量 { set; get; } [ExporterHeader(DisplayName = "实际交货数量", IsIgnore = true)] @@ -1624,7 +1529,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "订单日期")] public string 订单日期 { set; get; } - [ExporterHeader(DisplayName = "SAP编码")] public string SAP编码 { set; get; } [ExporterHeader(DisplayName = "物料代码")] @@ -1635,8 +1539,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "采购订单文本")] public string 采购订单文本 { set; get; } - - [ExporterHeader(DisplayName = "收货数量",IsIgnore =true)] + [ExporterHeader(DisplayName = "收货数量", IsIgnore = true)] public decimal 收货数量 { set; get; } [ExporterHeader(DisplayName = "开票数量")] public decimal 开票数量 { set; get; } @@ -1654,10 +1557,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "差异总金额")] public decimal 差异总金额 { set; get; } - } - public class SettleSparePartDetailExport { @@ -1665,13 +1566,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { } - [ExporterHeader(DisplayName = "交货单号")] public string 交货单号 { set; get; } [ExporterHeader(DisplayName = "交货日期 ")] public string 交货日期 { set; get; } - [ExporterHeader(DisplayName = "订单日期")] public string 订单日期 { set; get; } @@ -1699,7 +1598,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "发货与开票差异", IsIgnore = true)] public decimal 发货与开票差异 { set; get; } - [ExporterHeader(DisplayName = "开票单价")] public decimal 开票单价 { set; get; } @@ -1725,8 +1623,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "实际交货与开票差异")] public string 实际交货与开票差异 { set; get; } - - } /// @@ -1762,7 +1658,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "已结数量")] public decimal 已结数量 { set; get; } - [ExporterHeader(DisplayName = "收货与交货差异", IsIgnore = true)] public decimal 收货与交货差异 { set; get; } [ExporterHeader(DisplayName = "退货数量")] @@ -1779,10 +1674,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "实际发货总金额")] public decimal 实际发货总金额 { set; get; } - [ExporterHeader(DisplayName = "寄售库存数量", IsIgnore = true)] public decimal 寄售库存数量 { set; get; } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartExtendDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartExtendDapperReportRepository.cs index 61bc7f3f..a21e23a5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartExtendDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettleSparePartExtendDapperReportRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -84,7 +81,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string begintime, string endtime) { - var sql = "SELECT\n" + " temp1.*,\n" + " Isnull( TEMP2.Price, 0 ) Price,\n" + @@ -142,31 +138,27 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - - } - public class SettleSpareExtendPartExport + public class SettleSpareExtendPartExport { - //交货日期 交货单号 订单日期 采购订单号 SAP编码 物料代码 物料描述 采购订单文本 发货数量 开票数量 发货与开票差异 开票单价 开票金额 定价 单价差异 差异总金额 - [ExporterHeader("收货数量数量")] - public decimal ReceiptQty { set; get; } - [ExporterHeader("开票数量")] - public decimal InvoicedQty { set; get; } - [ExporterHeader("金额")] - public decimal AmountNoTax { set; get; } - [ExporterHeader("金额")] + [ExporterHeader("收货数量数量")] + public decimal ReceiptQty { set; get; } + [ExporterHeader("开票数量")] + public decimal InvoicedQty { set; get; } + [ExporterHeader("金额")] + public decimal AmountNoTax { set; get; } + [ExporterHeader("金额")] public decimal PurchasePriceNoTax { set; get; } - public string MaterialCode { set; get; } - public string MaterialGroup { set; get; } - public string MaterialGroupCode { set; get; } - public string SapCode { set; get; } - public string SockQty { set; get; } + public string MaterialCode { set; get; } + public string MaterialGroup { set; get; } + public string MaterialGroupCode { set; get; } + public string SapCode { set; get; } + public string SockQty { set; get; } } - // ReceiptQty InvoicedQty AmountNoTax PurchasePriceNoTax MaterialCode MaterialGroup MaterialGroupCode SapCode + // ReceiptQty InvoicedQty AmountNoTax PurchasePriceNoTax MaterialCode MaterialGroup MaterialGroupCode SapCode ///// ///// 大众看板有条码报表 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledMaterialReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledMaterialReportRepository.cs index acdd7c9a..677d6e1e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledMaterialReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledMaterialReportRepository.cs @@ -1,12 +1,8 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; -using System.Data.Common; -using System.Diagnostics; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -14,7 +10,6 @@ using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - public class SettledMaterial { [ExporterHeader(DisplayName = "版本")] @@ -37,12 +32,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report /// /// CP5A日期 /// - [ExporterHeader(DisplayName = "CP5日期",Format = "yyyy-MM-dd")] + [ExporterHeader(DisplayName = "CP5日期", Format = "yyyy-MM-dd")] public virtual DateTime CP5A { set; get; } /// /// CP7 /// - [ExporterHeader(DisplayName = "CP7日期",Format = "yyyy-MM-dd")] + [ExporterHeader(DisplayName = "CP7日期", Format = "yyyy-MM-dd")] public virtual DateTime CP7 { set; get; } /// /// 零件号 @@ -73,17 +68,16 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - - public class SettledMaterialReportRepository : DapperRepository ,ITransientDependency + public class SettledMaterialReportRepository : DapperRepository, ITransientDependency { public SettledMaterialReportRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - public virtual List GetSettledMaterialReportList(int state, string version, string year, string materialcode,string erpmaterialcode) + public virtual List GetSettledMaterialReportList(int state, string version, string year, string materialcode, string erpmaterialcode) { - + string sqlString = "SELECT\n" + " a.[Version]\n" + " ,a.[KENNCode]\n" + @@ -101,7 +95,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " FROM [SettleAccountService].[dbo].[Set_settle] a left join Set_fis_th b\n" + " on a.MaterialCode=b.MaterialCode and a.ChassisNumber=b.ChassisNumber "; - string str = string.Empty; str += " where 1=1 "; if (!string.IsNullOrEmpty(version)) @@ -116,7 +109,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { str += string.Format(" and a.materialcode='{0}' \n", materialcode); } - if (state!=0) + if (state != 0) { str += string.Format(" and a.state={0} \n", state); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledPartAndErpPartPriceDiffRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledPartAndErpPartPriceDiffRepository.cs index 968a0c02..8d711d04 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledPartAndErpPartPriceDiffRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SettledPartAndErpPartPriceDiffRepository.cs @@ -1,9 +1,3 @@ -using Dapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs index 9fe7b358..b11b242f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/SharePartUnSettledDapperRepository.cs @@ -1,16 +1,10 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Microsoft.EntityFrameworkCore; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.FISes; -using Win.Sfs.SettleAccount.FISes; //using Win.Sfs.Shared.Enums.SettleAccount; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report @@ -43,8 +37,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "差异金额")] public decimal DiffAMT { set; get; } - - //[ExporterHeader(DisplayName = "交货单号")] //public string WmsBillNum { set; get; } //[ExporterHeader(DisplayName = "发货日期")] @@ -74,39 +66,33 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public class SharePartUnSettledExtend { [ExporterHeader(DisplayName = "物料编码")] - public string SAPCode {set;get;} + public string SAPCode { set; get; } [ExporterHeader(DisplayName = "客户物料号")] - public string MaterialCode {set;get;} + public string MaterialCode { set; get; } [ExporterHeader(DisplayName = "物料描述")] - public string MaterialDesc {set;get;} + public string MaterialDesc { set; get; } [ExporterHeader(DisplayName = "物料组(车型)")] - public string MaterilGroup {set;get;} + public string MaterilGroup { set; get; } [ExporterHeader(DisplayName = "发货数量")] - public string Qty {set;get;} + public string Qty { set; get; } [ExporterHeader(DisplayName = "收货数量")] - public string ReceiptQty {set;get;} + public string ReceiptQty { set; get; } [ExporterHeader(DisplayName = "数量差异")] - public string DiffQty {set;get;} + public string DiffQty { set; get; } [ExporterHeader(DisplayName = "单价")] public decimal Price { set; get; } [ExporterHeader(DisplayName = "差异金额")] public string DiffAMT { set; get; } - - } - - - - public class SharePartUnSettledDapperRepository : DapperRepository, ITransientDependency { public SharePartUnSettledDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { } - public virtual List GetOrderSharePartReportList( string version, string begintime, string endtime) + public virtual List GetOrderSharePartReportList(string version, string begintime, string endtime) { var sql = "SELECT\n" + @@ -142,12 +128,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " version = ( SELECT MAX( Version ) FROM Set_PriceList )) temp2 ON temp1.SAPCode = temp2.MaterialCode"; string str = string.Empty; - str += " where 1=1 "; var _query = DbConnection.Query(sql, null, null, true, 1200, null); var _list = _query.ToList(); return _list; } - public virtual List GetNoOrderSharePartReportList( string version, string begintime, string endtime) + public virtual List GetNoOrderSharePartReportList(string version, string begintime, string endtime) { var sql = "SELECT\n" + " temp1.*,\n" + @@ -176,7 +161,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " version = ( SELECT MAX( Version ) FROM Set_PriceList )) temp2 ON temp1.SAPCode = temp2.MaterialCode"; string str = string.Empty; - str += " where 1=1 "; var _query = DbConnection.Query(sql, null, null, true, 1200, null); var _list = _query.ToList(); return _list; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs index 1800c762..420603b2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnInvoiceSettledDetailDiffDapperRepository.cs @@ -1,21 +1,14 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Reports; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - /// ///3.大众准时化结算数量差异比对表 /// @@ -25,14 +18,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report : base(dbContextProvider) { } - public virtual List GetDetailDiffReportList(string version, string materialCode, string begin, string end ,string cp7begin,string cp7end,string kennCode,string chassisNumber,string materialGroup) + public virtual List GetDetailDiffReportList(string version, string materialCode, string begin, string end, string cp7begin, string cp7end, string kennCode, string chassisNumber, string materialGroup) { List _list = new List(); string condition = " where 1=1 "; - //if (!string.IsNullOrEmpty(materialCode)) //{ // condition += string.Format(" d.MaterialCode='{0}' ", materialCode); @@ -103,12 +95,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " b.Qty IS NULL \n" + " ) temp1\n" + " LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE 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(_sql, null, null, true, 1200, null); - _list=_query.ToList(); + var _sql = string.Format(str, version, condition); - + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + _list = _query.ToList(); return _list; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs index cb231b93..c3275b3d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettleDiffDapperRepository.cs @@ -1,10 +1,8 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; @@ -12,19 +10,18 @@ using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - public class UnSettleDiff: ReportDetailBase + public class UnSettleDiff : ReportDetailBase { - [ExporterHeader(DisplayName = "交货单号")] public override string WmsBillNum { set; get; } - [ExporterHeader(DisplayName = "实际发货日期",Format = "yyyy-MM-dd")] + [ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")] 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)] + [ExporterHeader(DisplayName = "交货状态", IsIgnore = true)] public override string WmsState { set; get; } [ExporterHeader(DisplayName = "物料号")] public override string SapMaterialCode { set; get; } @@ -42,30 +39,27 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public override decimal Price { set; get; } [ExporterHeader(DisplayName = "金额 ")] public override decimal Amt { set; get; } - [ExporterHeader(DisplayName = "结算平台未结数量")] + [ExporterHeader(DisplayName = "结算平台未结数量")] public decimal Qty { set; get; } [ExporterHeader(DisplayName = "大众R3未结数量")] public decimal UNSettleQty { set; get; } [ExporterHeader(DisplayName = "差异")] public decimal DiffQty { set; get; } - [ExporterHeader(DisplayName = "差异金额",IsIgnore =true)] + [ExporterHeader(DisplayName = "差异金额", IsIgnore = true)] public decimal DiffAmt { set; get; } [ExporterHeader(DisplayName = "大众标识")] public string UnsettledReason { set; get; } - [ExporterHeader(DisplayName = "结算日期",IsIgnore =true)] + [ExporterHeader(DisplayName = "结算日期", IsIgnore = true)] public override DateTime CP7Time { set; get; } - [ExporterHeader(DisplayName = "开票单价",IsIgnore =true)] + [ExporterHeader(DisplayName = "开票单价", IsIgnore = true)] public override decimal InvoicePrice { set; get; } //交货单号 实际发货日期 KENN号 底盘号 底盘格式整理 M100交货状态 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 结算平台未结数量 定价 金额 大众R3未结数量 差异 差异金额 - - } - public class UnSettleDiff1 + public class UnSettleDiff1 { - //[ExporterHeader(DisplayName = "交货单号 ")] //public string WmsBillNum { set; get; } [ExporterHeader(DisplayName = "实际发货日期", Format = "yyyy-MM-dd")] @@ -97,7 +91,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "大众R3未结数量")] public decimal UNSettleQty { set; get; } - [ExporterHeader(DisplayName = "差异")] public decimal DiffQty { set; get; } //[ExporterHeader(DisplayName = "差异金额")] @@ -105,8 +98,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //交货单号 实际发货日期 KENN号 底盘号 底盘格式整理 M100交货状态 物料号 物料描述 客户物料 组件组物料 组件组物料描述 物料组(车型) 结算平台未结数量 定价 金额 大众R3未结数量 差异 差异金额 - - } /// /// 6.大众准时化未结差异比对表 @@ -118,12 +109,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public virtual List GetDiffReport(int type, string begin, string end, string materialCode, string kennCode,string chassisNumber,string version) + public virtual List GetDiffReport(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); @@ -136,7 +126,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { condition += string.Format(" and BeginTime<='{0}' ", end); } - + //if (!string.IsNullOrEmpty(kennCode)) //{ // condition += string.Format(" and a.kenncode='{0}' ", kennCode); @@ -153,7 +143,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " T2.Price,\n" + " Qty -(\n" + " ISNULL( UnSettleQty, 0 )) DiffQty ,\n" + -" Round((Qty - (ISNULL(UnSettleQty, 0))) * isnull(T2.Price, 0),2) DiffAmt \n"+ +" Round((Qty - (ISNULL(UnSettleQty, 0))) * isnull(T2.Price, 0),2) DiffAmt \n" + "FROM\n" + " (\n" + " SELECT\n" + @@ -219,26 +209,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "WHERE\n" + " 1 = 1"; + var _sql = string.Format(sql1, condition, version); - - - var _sql = string.Format(sql1, condition,version); - - - var _query = DbConnection.Query(_sql); return _query.ToList(); } - - public virtual List 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); @@ -269,10 +251,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ISNULL( UnSettleQty, 0 )) DiffQty ,\n" + " Round((Qty - (ISNULL(UnSettleQty, 0))) * isnull(T2.Price, 0),2) DiffAmt \n" + - - - - "FROM\n" + " (\n" + " SELECT\n" + @@ -307,7 +285,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "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"+ +"and ChassisNumber2=tm1.ChassisNumber2 and ItemCode=tm1.ItemCode FOR XML PATH('')),1, 1, '') AS WMSBillNum,\n" + " sum( qty ) qty \n" + " FROM\n" + @@ -342,13 +320,10 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report var _sql = string.Format(sql1, condition, version); - - - var _query = DbConnection.Query(_sql, null, null, true, 1200, null); + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); return _query.ToList(); } - - } + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDapperReportRepository.cs index efb7802b..7eef6ced 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDapperReportRepository.cs @@ -1,15 +1,10 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using Microsoft.EntityFrameworkCore; -using System; using System.Collections.Generic; using System.Linq; using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.FISes; using Win.Sfs.SettleAccount.FISes; //using Win.Sfs.Shared.Enums.SettleAccount; @@ -23,7 +18,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public virtual List GetUnSettledReportList(string state, string version, string year, string begintime, string endtime) { // string sqlString = " select\n" + @@ -49,10 +43,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //" on a.ChassisNumber2=b.ChassisNumber and a.ItemCode=b.MaterialCode {0} group by ChassisNumber2 {1} )\n" + //" d on c.ChassisNumber2=d.ChassisNumber2 order by ChassisNumber2"; - - - - string sqlString = " select " + @@ -84,9 +74,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " (select ISNull(SUM(qty),0) qty2, kenncode, ChassisNumber from Set_settle group by kenncode, ChassisNumber) b " + " on a.ChassisNumber2 = b.ChassisNumber and a.KENNCode = b.KENNCode {1} ) temp1 on c.ChassisNumber2 = temp1.ChassisNumber2 and c.KENNCode = temp1.KENNCode "; - - - string str = string.Empty; str += " where 1=1 "; //if (!string.IsNullOrEmpty(version)) @@ -150,9 +137,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report i++; } - - - sqlString = string.Format(sqlString, str, _buffer.ToString()); } var _query = DbConnection.Query(sqlString, null, null, true, 1200, null); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs index b2a92d40..19aa71c6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/UnSettledDetailDapperRepository.cs @@ -1,18 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.FISes; -using Dapper; -using Win.Sfs.SettleAccount.FISes; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto; using Win.Sfs.SettleAccount.Entities.UnSettle; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.Entities.Prices; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { @@ -30,7 +23,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } public class UnSettledDetailDapperRepository : DapperRepository, ITransientDependency { - + public UnSettledDetailDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -50,12 +43,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } else { - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; str += string.Format(" and beginTime<='{0}' ", datetime); } - + var sqlString = " SELECT\n" + " temp1.WMSState,\n" + @@ -104,7 +97,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ChassisNumber2,\n" + " KENNCode KENNCode2, \n" + - " QTY,\n" + " ErpMaterialCode ParentSapMaterialCode,\n" + " '' FLAG \n" + @@ -140,29 +132,22 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) 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 set_backQty tt on temp1.SapMaterialCode = tt.MaterialCode and temp1.ChassisNumber = tt.Code "; -; + ; //var _materialList = DbConnection.Query("select * from set_material").ToList(); //var _priceList = DbConnection.Query("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(_sql, null, null,true, 1200, null); - + var _query = DbConnection.Query(_sql, null, null, true, 1200, null); var _list = _query.ToList(); //_list= _list.Where(p => p.SapMaterialCode == sapCode).ToList(); - - - return _list; } - - public virtual List GetDiffReport1(string year, string begin, string end, string customcode, string version, string materialCode, string materialGroup, string sapCode) { @@ -200,7 +185,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //"Round(ISNULL( temp1.DiffQty, 0 )* ISNULL( temp2.Price, 0 ),2) DiffAMT,\n" + //"temp1.DiffQty\n"+ - //"FROM\n" + //"(\n" + //"SELECT\n" + @@ -362,25 +346,18 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //"Set_PriceList ) ) temp2 ON\n" + //"temp1.SapMaterialCode = temp2.MaterialCode\n"; - - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; - string _sql= string.Format("exec [dbo].[p_SystemR3Diff] '{0}','{1}'",string.IsNullOrEmpty(end)? datetime : end + string _sql = string.Format("exec [dbo].[p_SystemR3Diff] '{0}','{1}'", string.IsNullOrEmpty(end) ? datetime : end , version); - var _query = DbConnection.Query(_sql, null, null, true, 1200,System.Data.CommandType.Text); + var _query = DbConnection.Query(_sql, null, null, true, 1200, System.Data.CommandType.Text); var _list = _query.ToList(); - - - - - return _list; } - /// /// 漏结 /// @@ -478,38 +455,30 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) temp1\n" + " LEFT JOIN ( SELECT Price, MaterialCode FROM Set_PriceList WHERE version = ( SELECT Max( Version ) FROM Set_PriceList ) ) temp2 ON temp1.SapMaterialCode = temp2.MaterialCode"; - //var _materialList = DbConnection.Query("select * from set_material").ToList(); //var _priceList = DbConnection.Query("select MaterialCode,Price from Set_PriceList where version=(select max(version) from set_Set_PriceListVersion)").ToList(); - - string _sql = string.Format(sqlString, str); - - var _query = DbConnection.Query(_sql); + var _query = DbConnection.Query(_sql); var _list = _query.ToList(); _list = _list.Where(p => p.SapMaterialCode == sapCode).ToList(); return _list; } - + public virtual List GetRemoveDetail() { - - var sqlString = "select * from Set_FisRemove"; string _sql = string.Format(sqlString); ; var _query = DbConnection.Query(_sql); - var _list = _query.ToList(); - return _list; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs index ea9ef760..18139f26 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsDapperRepository.cs @@ -1,23 +1,8 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories.Dapper; -using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Entities.Materials; -using Win.Sfs.SettleAccount.Entities.Prices; -using Win.Sfs.SettleAccount.Reports; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - - public class SalesStockSum { public string Version { set; get; } @@ -45,7 +30,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } - public class SalesStock { public string SapCode { set; get; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs index 62ae8173..1c4c4faa 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/WmsOutputSumDapperRepository.cs @@ -1,10 +1,7 @@ -using Dapper; -using Magicodes.ExporterAndImporter.Core; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; @@ -13,17 +10,9 @@ using Volo.Abp.EntityFrameworkCore; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report { - public class WmsOutputSumReport2 { - - - - - - - [ImporterHeader(Name = "行号")] [ExporterHeader(DisplayName = "行号")] public string 行号 { set; get; } @@ -88,8 +77,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "备注")] public string 备注 { set; get; } - - //public string 行号 { set; get; } //public string 客户 { set; get; } //public string 出库类型 { set; get; } @@ -108,13 +95,8 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //public string 备注 { set; get; } - - - - } - public class WmsOutputSumReport { [ImporterHeader(Name = "行号")] @@ -185,27 +167,26 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public class WmsOutPutSumExtend { [ExporterHeader(DisplayName = "客户 ")] - public string 客户 {set;get;} + public string 客户 { set; get; } [ExporterHeader(DisplayName = "出库类型")] - public string 出库类型 {set;get;} + public string 出库类型 { set; get; } [ExporterHeader(DisplayName = "出库单")] - public string 出库单 {set;get;} + public string 出库单 { set; get; } [ExporterHeader(DisplayName = "物料号")] - public string 物料号 {set;get;} + public string 物料号 { set; get; } [ExporterHeader(DisplayName = "物料描述")] - public string 物料描述 {set;get;} + public string 物料描述 { set; get; } [ExporterHeader(DisplayName = "出库单号")] - public string 出库单号 {set;get;} + public string 出库单号 { set; get; } [ExporterHeader(DisplayName = "物料组")] - public string 物料组 {set;get;} + public string 物料组 { set; get; } [ExporterHeader(DisplayName = "待出库")] - public string 待出库 {set;get;} + public string 待出库 { set; get; } [ExporterHeader(DisplayName = "已出库")] public string 已出库 { set; get; } } - public class WmsOutputtSearchWithCode { [ImporterHeader(Name = "行号")] @@ -223,7 +204,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "出库类型")] public string 出库类型 { set; get; } - //[ImporterHeader(Name = "结算编码")] //[ExporterHeader(DisplayName = "结算编码")] //public string 结算编码 { set; get; } @@ -249,7 +229,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //[ExporterHeader(DisplayName = "结算数量")] public decimal 结算数量 { set; get; } [ImporterHeader(Name = "实际出库数量")] - [ExporterHeader(DisplayName = "实际出库数量",IsIgnore =true)] + [ExporterHeader(DisplayName = "实际出库数量", IsIgnore = true)] public decimal 实际出库数量 { set; get; } [ImporterHeader(Name = "差异数量")] [ExporterHeader(DisplayName = "差异数量", IsIgnore = true)] @@ -280,8 +260,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report [ExporterHeader(DisplayName = "备注")] public string 备注 { set; get; } - - //public string 行号 { set; get; } //public string 客户 { set; get; } //public string 出库类型 { set; get; } @@ -300,15 +278,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report //public string 备注 { set; get; } - - - - } - - - public class WmsOutputSumDapperRepository: DapperRepository, ITransientDependency + public class WmsOutputSumDapperRepository : DapperRepository, ITransientDependency { public WmsOutputSumDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) @@ -334,7 +306,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " EstimateType 物料组编码,\n" + - " ISnull([ 0 ], 0 ) 结算数量,\n" + " ISNULL([ 2 ], 0 ) 实际出库数量,\n" + " ISNULL([ 0 ], 0 ) - ISNULL([ 2 ], 0 ) 差异数量,\n" + @@ -894,10 +865,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " BillNum,\n" + " SapMaterialCode,\n" + " Price, \n" + -" Extend union all\n"+ - - - +" Extend union all\n" + "SELECT\n" + "'4007' LOGN,\n" + @@ -920,12 +888,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "BillNum,\n" + "SapMaterialCode,\n" + "Price ,\n" + -"CustomerCode\n"+ - - - - - +"CustomerCode\n" + " ) temp\n" + " LEFT JOIN ( SELECT max( Id ) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType ) temp2 ON temp.MaterialCode = temp2.MaterialCode \n" + @@ -934,8 +897,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ORDER BY\n" + " 客户,出库类型,结算单;"; - - _sql = string.Format(_sql, version); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); return _query.ToList(); @@ -944,8 +905,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report public virtual List GetWmsSumReportList(string version, string state) { - - var _sql = "SELECT\n" + " ROW_NUMBER()OVER(ORDER BY Type DESC) 行号 ,\n" + " temp1.Client 客户,\n" + @@ -1112,7 +1071,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " Set_WmsOneTimeSaleOutPutDetial \n" + "WHERE\n" + " VERSION = '{0}' \n" + -" AND STATE = 3 union all \n"+ +" AND STATE = 3 union all \n" + "SELECT\n" + "'自定义发货出库' AS Type,\n" + @@ -1129,16 +1088,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "Set_WmsCustomerKanbanOutPutDetial\n" + "WHERE\n" + "VERSION = '{0}'\n" + -"AND State =3\n"+ - - - - +"AND State =3\n" + " ) temp1 \n" + " LEFT JOIN(SELECT max(Id) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType) temp2 ON temp1.MaterialCode = temp2.MaterialCode "; - _sql = string.Format(_sql, version, state); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -1146,8 +1100,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _query.ToList(); } - - /// /// 有条码的业务(可根据条码/K号/底盘号,查询是否结算过,结算期间) /// @@ -1272,9 +1224,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) temp1\n" + " LEFT JOIN ( SELECT MAX ( Id ) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType ) temp2 ON temp1.MaterialCode = temp2.MaterialCode"; - - - _sql = string.Format(_sql, getcnumber); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -1284,7 +1233,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _ls; } - public virtual List GetWmsSearchWithCodeReportList1(string CNumber, string materialCode) { @@ -1295,7 +1243,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report string getcnumber = ""; var _org_cnumbersList = CNumber.Split(new char[] { '\n' }).Distinct().ToList(); var _cnumbersList = _org_cnumbersList[0].Replace("\\n", ",").TrimEnd(',').Split(','); - if (_cnumbersList.Count() == 1) + if (_cnumbersList.Length == 1) { getcnumber = "'" + _org_cnumbersList[0].Replace("\\n", "") + "'"; } @@ -1410,9 +1358,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " ) temp1\n" + " LEFT JOIN ( SELECT MAX ( Id ) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType ) temp2 ON temp1.MaterialCode = temp2.MaterialCode"; - - - _sql = string.Format(_sql, getcnumber); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -1422,15 +1367,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _ls; } - - - - public virtual List GetWmsSumCancelReportList(string version, string state) { - - var _sql = "SELECT\n" + " ROW_NUMBER()OVER(ORDER BY Type DESC) 行号 ,\n" + " temp1.Client 客户,\n" + @@ -1599,9 +1538,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report " VERSION = '{0}' \n" + " AND State = 4 union all \n" + - - - "SELECT\n" + "'自定义发货出库' AS Type,\n" + "customercode Client,\n" + @@ -1619,15 +1555,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report "VERSION = '{0}'\n" + "AND State =4\n" + - - - - - " ) temp1 \n" + " LEFT JOIN(SELECT max(Id) Id, MaterialCode, MaterialDesc, EstimateType, EstimateTypeDesc FROM Set_material GROUP BY MaterialCode, MaterialDesc, EstimateTypeDesc, EstimateType) temp2 ON temp1.MaterialCode = temp2.MaterialCode "; - _sql = string.Format(_sql, version, state); var _query = DbConnection.Query(_sql, null, null, true, 1200, null); @@ -1635,13 +1565,6 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report return _query.ToList(); } - - - - - } - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/fisUnSettledDapperReportRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/fisUnSettledDapperReportRepository.cs index 9fdfa9d4..5bdaad70 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/fisUnSettledDapperReportRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Report/fisUnSettledDapperReportRepository.cs @@ -1,14 +1,9 @@ -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Entities.FISes; -using Dapper; -using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report @@ -22,46 +17,44 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report } public virtual List GetDiffReport(string year, string customcode, string version) - { - var sqlString = "SELECT\n" + - " '{0}' Version,\n" + - " ErpMaterialCode,\n" + - " sum( Qty ) Qty,\n" + - " MaterialDesc \n" + - "FROM\n" + - " (\n" + - " SELECT\n" + - " ChassisNumber2,\n" + - " ErpMaterialCode,\n" + - " 1 Qty,\n" + - " MaterialDesc \n" + - " FROM\n" + - " set_fis F\n" + - " INNER JOIN (\n" + - " SELECT\n" + - " t1.ChassisNumber,\n" + - " t1.KENNCode \n" + - " FROM\n" + - " ( SELECT DISTINCT ( ChassisNumber ), KENNCode FROM set_settle WHERE version = '{0}' ) t1\n" + - " LEFT JOIN ( SELECT DISTINCT ( ChassisNumber ), KENNCode FROM set_settle WHERE version < '{0}' ) t2 ON t1.ChassisNumber = t2.ChassisNumber \n" + - " AND t1.KENNCode = t2.KENNCode\n" + - " LEFT JOIN set_prebatch t3 ON t1.KENNCode = t3.KENNCode \n" + - " WHERE\n" + - " t2.ChassisNumber IS NULL \n" + - " AND t3.KENNCode IS NULL \n" + - " ) G ON f.ChassisNumber2 = g.ChassisNumber \n" + - " AND f.KENNCode = g.KENNCode\n" + - " LEFT JOIN Set_material M ON F.ErpMaterialCode = M.MaterialCode \n" + - " GROUP BY\n" + - " ChassisNumber2,\n" + - " ErpMaterialCode,\n" + - " M.MaterialDesc \n" + - " ) a \n" + - "GROUP BY\n" + - " ErpMaterialCode,\n" + - " MaterialDesc"; - - + { + var sqlString = "SELECT\n" + + " '{0}' Version,\n" + + " ErpMaterialCode,\n" + + " sum( Qty ) Qty,\n" + + " MaterialDesc \n" + + "FROM\n" + + " (\n" + + " SELECT\n" + + " ChassisNumber2,\n" + + " ErpMaterialCode,\n" + + " 1 Qty,\n" + + " MaterialDesc \n" + + " FROM\n" + + " set_fis F\n" + + " INNER JOIN (\n" + + " SELECT\n" + + " t1.ChassisNumber,\n" + + " t1.KENNCode \n" + + " FROM\n" + + " ( SELECT DISTINCT ( ChassisNumber ), KENNCode FROM set_settle WHERE version = '{0}' ) t1\n" + + " LEFT JOIN ( SELECT DISTINCT ( ChassisNumber ), KENNCode FROM set_settle WHERE version < '{0}' ) t2 ON t1.ChassisNumber = t2.ChassisNumber \n" + + " AND t1.KENNCode = t2.KENNCode\n" + + " LEFT JOIN set_prebatch t3 ON t1.KENNCode = t3.KENNCode \n" + + " WHERE\n" + + " t2.ChassisNumber IS NULL \n" + + " AND t3.KENNCode IS NULL \n" + + " ) G ON f.ChassisNumber2 = g.ChassisNumber \n" + + " AND f.KENNCode = g.KENNCode\n" + + " LEFT JOIN Set_material M ON F.ErpMaterialCode = M.MaterialCode \n" + + " GROUP BY\n" + + " ChassisNumber2,\n" + + " ErpMaterialCode,\n" + + " M.MaterialDesc \n" + + " ) a \n" + + "GROUP BY\n" + + " ErpMaterialCode,\n" + + " MaterialDesc"; string _sql = string.Format(sqlString, version); ; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs index 621d17f0..b215ea65 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountRepository.cs @@ -1,17 +1,11 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; -using System.Data.SqlClient; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; namespace Win.Sfs.SettleAccount.Repository.SettleAccount { @@ -86,7 +80,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount { } - + public virtual bool Delete(string version) { try @@ -97,7 +91,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } @@ -122,13 +116,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount // } //} - - BulkConfig cfg = new BulkConfig() { BulkCopyTimeout=0, BatchSize=100000, }; - DbContext.BulkInsert(list,cfg); + BulkConfig cfg = new BulkConfig() { BulkCopyTimeout = 0, BatchSize = 100000, }; + DbContext.BulkInsert(list, cfg); } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountVersionRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountVersionRepository.cs index 6537dd75..bab7b16c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountVersionRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettleAccounts/SettleAccountVersionRepository.cs @@ -1,21 +1,15 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.SettleAccounts; namespace Win.Sfs.SettleAccount.Repository.SettleAccount { - public class SettleAccountVersionRepository : EfCoreRepository, ITransientDependency { @@ -33,28 +27,28 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } - public virtual bool Insert(Guid guid,string p_version,string p_customCode,string p_factory) + public virtual bool Insert(Guid guid, string p_version, string p_customCode, string p_factory) { try { DbContext.Database.SetCommandTimeout(1200); - var _first= GetQueryable().FirstOrDefault(p => p.Version == p_version); + var _first = GetQueryable().FirstOrDefault(p => p.Version == p_version); if (_first == null) { var version = new SettleAccountVersion(guid, GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode, p_factory); List _ls = new List(); _ls.Add(version); - DbContext.BulkInsert(_ls) ; + DbContext.BulkInsert(_ls); } } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartRepository.cs index 20a09abe..fd2cd594 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartRepository.cs @@ -1,16 +1,11 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; using Win.Sfs.SettleAccount.Entities.SettlementParts; namespace Win.Sfs.SettleAccount.Repository.SettleAccount @@ -96,7 +91,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } @@ -111,23 +106,22 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount if (list.Count > 0) { var _version = list.FirstOrDefault().Version; - var _customerCode= list.FirstOrDefault().CustomerCode; - var _ls = GetQueryable().Where(p => p.Version == _version && p.CustomerCode==_customerCode).ToList(); + var _customerCode = list.FirstOrDefault().CustomerCode; + var _ls = GetQueryable().Where(p => p.Version == _version && p.CustomerCode == _customerCode).ToList(); var _add = from r1 in list - join r2 in _ls on new { r1.SettlementPartCode, r1.Price } equals new { r2.SettlementPartCode, r2.Price } - into temp - from t in temp.DefaultIfEmpty() - where t == null - select r1; - var partcodeList=_add.Select(p=>p.SettlementPartCode).Distinct().ToList(); - + join r2 in _ls on new { r1.SettlementPartCode, r1.Price } equals new { r2.SettlementPartCode, r2.Price } + into temp + from t in temp.DefaultIfEmpty() + where t == null + select r1; + var partcodeList = _add.Select(p => p.SettlementPartCode).Distinct().ToList(); + foreach (var code in partcodeList) { - - var _first=_add.FirstOrDefault(p => p.SettlementPartCode == code && p.Version==_version); + var _first = _add.FirstOrDefault(p => p.SettlementPartCode == code && p.Version == _version); - var delete=_ls.Where(p => p.SettlementPartCode == code && p.Version==_version).ToList(); + var delete = _ls.Where(p => p.SettlementPartCode == code && p.Version == _version).ToList(); DbContext.BulkDelete(delete); if (_first != null) { @@ -139,7 +133,7 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartVersionRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartVersionRepository.cs index 7249010a..4858be50 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartVersionRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/SettlementParts/SettlementPartVersionRepository.cs @@ -1,22 +1,15 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; +using Microsoft.EntityFrameworkCore; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Uow; -using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Entities.SettleAccounts; using Win.Sfs.SettleAccount.Entities.SettlementParts; namespace Win.Sfs.SettleAccount.Repository.SettleAccount { - public class SettlementPartVersionRepository : EfCoreRepository, ITransientDependency { @@ -34,28 +27,28 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccount } catch (Exception e) { - throw e; + throw; } return true; } - public virtual bool Insert(string p_version,string p_customCode,string p_factory) + public virtual bool Insert(string p_version, string p_customCode, string p_factory) { try { DbContext.Database.SetCommandTimeout(1200); - var _first= GetQueryable().FirstOrDefault(p => p.Version == p_version && p.CustomerCode==p_customCode); + var _first = GetQueryable().FirstOrDefault(p => p.Version == p_version && p.CustomerCode == p_customCode); if (_first == null) { var version = new SettlementPartVersion(GuidGenerator.Create(), GuidGenerator.Create(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), p_version, p_customCode, p_factory); List _ls = new List(); _ls.Add(version); - DbContext.BulkInsert(_ls) ; + DbContext.BulkInsert(_ls); } } catch (Exception e) { - throw e; + throw; } return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskDapperRepository.cs index 90d99cc6..160d7afb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskDapperRepository.cs @@ -1,28 +1,25 @@ -using Dapper; -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Data; using System.Linq; -using System.Text; using System.Text.Json; using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.SettleAccount.Entities; - namespace Win.Sfs.SettleAccount.Repository { public class JobOutputSum { - public int Compelte { set; get; } - public int UnComplete { set; get; } + public int Compelte { set; get; } + public int UnComplete { set; get; } public int Apply { set; get; } public int Cancel { set; get; } public string BillNum { set; get; } - } - public class TaskDapperRepository: DapperRepository, ITransientDependency + } + public class TaskDapperRepository : DapperRepository, ITransientDependency { public TaskDapperRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) @@ -58,8 +55,6 @@ namespace Win.Sfs.SettleAccount.Repository "WHERE\n" + " 1 = 1 \n"; - - if (!string.IsNullOrEmpty(p_task.Email)) { str += string.Format(" and b.Email='{0}'", p_task.Email); @@ -72,7 +67,7 @@ namespace Win.Sfs.SettleAccount.Repository { str += string.Format(" and Creator='{0}'", p_task.Creator); } - if(!string.IsNullOrEmpty(p_task.StateName)) + if (!string.IsNullOrEmpty(p_task.StateName)) { str += string.Format(" and A.StateName='{0}'", p_task.Name); } @@ -85,15 +80,15 @@ namespace Win.Sfs.SettleAccount.Repository str += string.Format(" and b.type='{0}'", p_task.Type); } str += " order by a.CreatedAt desc "; - var _db= await GetDbConnectionAsync(); - var _query= await _db.QueryAsync(str); + var _db = await GetDbConnectionAsync().ConfigureAwait(false); + var _query = await _db.QueryAsync(str).ConfigureAwait(false); var _lst = _query.ToList(); - if (p_task.Name == "看板结算输出" || p_task.Name == "准时化结算核对明细" || p_task.Name == "备件结算输出") + if (p_task.Name == "看板结算输出" || p_task.Name == "准时化结算核对明细" || p_task.Name == "备件结算输出") { var _ls = DbConnection.Query("select * from Set_JobOutputSum"); foreach (var itm in _ls) { - var _entityList= _lst.Where(p => p.FileName == itm.BillNum).ToList(); + var _entityList = _lst.Where(p => p.FileName == itm.BillNum).ToList(); foreach (var entity in _entityList) { entity.InvocationData = JsonSerializer.Serialize(entity); @@ -105,20 +100,16 @@ namespace Win.Sfs.SettleAccount.Repository public virtual async Task> GetUpFileAsync(string taskid) { - var _ls = await GetTaskJobsAsync(new Job() { TaskId = taskid }) ; + var _ls = await GetTaskJobsAsync(new Job() { TaskId = taskid }).ConfigureAwait(false); var _first = _ls.FirstOrDefault(); var options = new JsonSerializerOptions { Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping }; - var _task = System.Text.Json.JsonSerializer.Deserialize>(_first.FileName,options); + var _task = System.Text.Json.JsonSerializer.Deserialize>(_first.FileName, options); return _task; } - - - - } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskJobRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskJobRepository.cs index 69bd034d..fa2edf49 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskJobRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/Tasks/TaskJobRepository.cs @@ -1,10 +1,7 @@ -using EFCore.BulkExtensions; -using Microsoft.EntityFrameworkCore; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using EFCore.BulkExtensions; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -18,13 +15,12 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob { } - public virtual bool UpdateTaskJob(Guid id,TaskJob p_job) + public virtual bool UpdateTaskJob(Guid id, TaskJob p_job) { try { - - - var _first=DbSet.FirstOrDefault(p => p.Id == id); + + var _first = DbSet.FirstOrDefault(p => p.Id == id); if (_first != null) { if (!string.IsNullOrEmpty(p_job.DownFileName)) @@ -37,14 +33,13 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob } } DbContext.BulkUpdate(new List() { _first }); - //(new List() { _first }); + //(new List() { _first }); } catch (Exception e) { - throw e; + throw; } - return true; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/WmsJitOutput/WmsJitOutputDapperRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/WmsJitOutput/WmsJitOutputDapperRepository.cs index 834060a1..0f2de9ad 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/WmsJitOutput/WmsJitOutputDapperRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountJob/WmsJitOutput/WmsJitOutputDapperRepository.cs @@ -1,20 +1,13 @@ -using Dapper; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Dapper; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Repositories.Dapper; using Volo.Abp.EntityFrameworkCore; using Volo.Abp.Uow; using Win.Sfs.SettleAccount.EntityFrameworkCore; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob { - /// /// 1.大众发票与结算汇总核对表-UPdate /// @@ -25,9 +18,9 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob { } [UnitOfWork(false)] - public virtual bool Execute(string billnum,string date) + public virtual bool Execute(string billnum, string date) { - string sqlString = + string sqlString = "DECLARE\t@return_value int\n" + "EXEC\t@return_value = [dbo].[p_wms_output_jit1]\n" + "@billnum = N'{0}',\n" + @@ -35,13 +28,11 @@ namespace Win.Sfs.SettleAccount.Repository.SettleAccountJob "@date = N'{1}'\n" + "SELECT\t'Return Value' = @return_value\n"; - string _sql = string.Format(sqlString, billnum,date); + string _sql = string.Format(sqlString, billnum, date); - var _query = DbConnection.ExecuteScalar(_sql,null,null,1200,System.Data.CommandType.Text); + var _query = DbConnection.ExecuteScalar(_sql, null, null, 1200, System.Data.CommandType.Text); return true; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountNormalEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountNormalEfCoreRepository.cs index 89bdc23c..882bd0d9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountNormalEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/SettleAccountNormalEfCoreRepository.cs @@ -1,10 +1,8 @@ -using Microsoft.EntityFrameworkCore; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; using System.Threading; using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.Domain.Entities; using Volo.Abp.EntityFrameworkCore; @@ -31,21 +29,19 @@ namespace Win.Sfs.SettleAccount.Repository { var query = includeDetails ? this.WithDetails() : this.GetQueryable(); - - return await query.ToListAsync(cancellationToken: cancellationToken); + return await query.ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } public virtual async Task GetCountAsync(TKey branchId, CancellationToken cancellationToken = default) { - return await this.LongCountAsync(GetCancellationToken(cancellationToken)); + return await this.LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } - public virtual async Task GetCountByFilterAsync(List filters, CancellationToken cancellationToken = default) { - return await this.GetQueryable() + return await GetQueryable() .WhereIf(filters?.Count != 0, filters.ToLambda()) - .LongCountAsync(GetCancellationToken(cancellationToken)); + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual async Task> GetListByFilterAsync(List filters, string sorting = null, @@ -63,7 +59,7 @@ namespace Win.Sfs.SettleAccount.Repository entities = GetSortingQueryable(entities, sorting); - return await entities.PageBy(skipCount, maxResultCount).ToListAsync(GetCancellationToken(cancellationToken)); + return await entities.PageBy(skipCount, maxResultCount).ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/UnInterfaceEfCoreRepository.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/UnInterfaceEfCoreRepository.cs index 17f97d8c..66a429f9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/UnInterfaceEfCoreRepository.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/UnInterfaceEfCoreRepository.cs @@ -1,8 +1,7 @@ -using System; +using System; using System.Collections.Generic; using System.Data; using System.Data.Common; -using System.Data.SqlClient; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -13,23 +12,19 @@ using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; using Win.Sfs.SettleAccount.EntityFrameworkCore; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DomainBase; using Win.Sfs.Shared.Filter; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Repository { public class UnInterfaceEfCoreRepository : - EfCoreRepository, + EfCoreRepository, ITransientDependency - where TEntity : class,IEntity + where TEntity : class, IEntity { private readonly IDbContextProvider _dbContextProvider; - - public UnInterfaceEfCoreRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) { @@ -42,7 +37,7 @@ namespace Win.Sfs.SettleAccount.Repository } - public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) + public DbCommand CreateCommand(string commandText, CommandType commandType, params DbParameter[] parameters) { var command = DbContext.Database.GetDbConnection().CreateCommand(); @@ -58,40 +53,40 @@ namespace Win.Sfs.SettleAccount.Repository return command; } - public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) + public async Task EnsureConnectionOpenAsync(CancellationToken cancellationToken = default) { var connection = DbContext.Database.GetDbConnection(); if (connection.State != ConnectionState.Open) { - await connection.OpenAsync(cancellationToken); + await connection.OpenAsync(cancellationToken).ConfigureAwait(false); } } - public virtual async Task> GetAllAsync( bool includeDetails = false, + public virtual async Task> GetAllAsync(bool includeDetails = false, CancellationToken cancellationToken = default) { var query = includeDetails ? this.WithDetails() : this.GetQueryable(); //query = query.Where(p => p.BranchId.Equals(branchId)); - return await query.ToListAsync(cancellationToken: cancellationToken); + return await query.ToListAsync(cancellationToken: cancellationToken).ConfigureAwait(false); } - public virtual async Task GetCountAsync( CancellationToken cancellationToken = default) + public virtual async Task GetCountAsync(CancellationToken cancellationToken = default) { - return await this.GetQueryable() + return await GetQueryable() //.Where(p => p.BranchId.Equals(branchId)) - .LongCountAsync(GetCancellationToken(cancellationToken)); + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } - public virtual async Task GetCountByFilterAsync( List filters, + public virtual async Task GetCountByFilterAsync(List filters, CancellationToken cancellationToken = default) { - return await this.GetQueryable() + return await GetQueryable() //.Where(p => p.BranchId.Equals(branchId)) .WhereIf(filters?.Count != 0, filters.ToLambda()) - .LongCountAsync(GetCancellationToken(cancellationToken)); + .LongCountAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } public virtual async Task> GetListByFilterAsync(List filters, @@ -100,17 +95,16 @@ namespace Win.Sfs.SettleAccount.Repository CancellationToken cancellationToken = default) { var query = includeDetails ? this.WithDetails() : this.GetQueryable(); - // query = query.Where(p => p.BranchId.Equals(branchId)); + // query = query.Where(p => p.BranchId.Equals(branchId)); var entities = query.WhereIf(filters?.Count != 0, filters.ToLambda()); //2021-07-02 设置sorting首字母大小,因设置了驼峰规则,不匹配“ var memberProp = typeof(T).GetProperty(propertyName);”反射 - if(!string.IsNullOrEmpty(sorting)) + if (!string.IsNullOrEmpty(sorting)) { - sorting = sorting.Substring(0, 1).ToUpper() + sorting.Substring(1); + sorting = string.Concat(sorting.Substring(0, 1).ToUpper(), sorting.AsSpan(1)); } entities = GetSortingQueryable(entities, sorting); return await entities.PageBy(skipCount, maxResultCount) - .ToListAsync(GetCancellationToken(cancellationToken)); - + .ToListAsync(GetCancellationToken(cancellationToken)).ConfigureAwait(false); } @@ -123,13 +117,9 @@ namespace Win.Sfs.SettleAccount.Repository else { - - - var sortParams = sorting?.Split(' '); var sortName = sortParams[0]; - Type t = typeof(TEntity); var _first = t.GetProperties().Where(p => p.Name.ToUpper() == sortName.ToUpper()).FirstOrDefault(); if (_first != null) @@ -137,9 +127,6 @@ namespace Win.Sfs.SettleAccount.Repository sortName = _first.Name; } - - - bool isDesc; if (sortParams.Length > 1) { @@ -159,5 +146,4 @@ namespace Win.Sfs.SettleAccount.Repository } - -} \ No newline at end of file +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WmsOutputInterfaceDapperRepoisitory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WmsOutputInterfaceDapperRepoisitory.cs index 48e4837c..21818a50 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WmsOutputInterfaceDapperRepoisitory.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/Repository/WmsOutputInterfaceDapperRepoisitory.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.SettleAccount.Repository { public class WmsOutputInterfaceDapperRepoisitory diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs index f2cac305..8c3d5fcd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.EntityFrameworkCore/SettleAccountDbContextFactory.cs @@ -3,17 +3,18 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Design; using Microsoft.Extensions.Configuration; -namespace Win.Sfs.SettleAccount; - -public class SettleAccountDbContextFactory : IDesignTimeDbContextFactory +namespace Win.Sfs.SettleAccount { - public SettleAccountDbContext CreateDbContext(string[] args) + public class SettleAccountDbContextFactory : IDesignTimeDbContextFactory { - var config = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build(); - var connectionString = config.GetConnectionString("SettleAccountService"); - var optionsBuilder = new DbContextOptionsBuilder(); - optionsBuilder.UseSqlServer(connectionString); + public SettleAccountDbContext CreateDbContext(string[] args) + { + var config = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json").Build(); + var connectionString = config.GetConnectionString("SettleAccountService"); + var optionsBuilder = new DbContextOptionsBuilder(); + optionsBuilder.UseSqlServer(connectionString); - return new SettleAccountDbContext(optionsBuilder.Options); + return new SettleAccountDbContext(optionsBuilder.Options); + } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi.Client/SettleAccountHttpApiClientModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi.Client/SettleAccountHttpApiClientModule.cs index 5b15b9eb..d72acce2 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi.Client/SettleAccountHttpApiClientModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi.Client/SettleAccountHttpApiClientModule.cs @@ -1,4 +1,4 @@ -using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs index 33990d59..156bf3f5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/BlobFileController.cs @@ -1,14 +1,7 @@ -using Magicodes.ExporterAndImporter.Core.Extension; +using System.Threading.Tasks; 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; @@ -16,7 +9,7 @@ namespace Win.Sfs.SettleAccount { [Area("SettleAccount")] [Route("api/settleaccount/getblobfile")] - public class BlobFileController:SettleAccountController + public class BlobFileController : SettleAccountController { private readonly IExcelImportAppService _excelImportService; public IExcelImporter Importer = new ExcelImporter();//导入Excel @@ -33,7 +26,7 @@ namespace Win.Sfs.SettleAccount [Route("download/{fileName}")] public async Task DownloadAsync(string fileName) { - var fileDto = await _excelImportService.GetBlobAsync(new GetExcelImportRequestDto { Name = fileName }); + var fileDto = await _excelImportService.GetBlobAsync(new GetExcelImportRequestDto { Name = fileName }).ConfigureAwait(false); return File(fileDto.Content, "application/octet-stream", fileDto.Name); } @@ -47,7 +40,7 @@ namespace Win.Sfs.SettleAccount public async Task SaveHQKBExcelImportTemplate() { string fileName = "红旗一轿手工出库单导入模板.xlsx"; - var result = await Importer.GenerateTemplateBytes(); + var result = await Importer.GenerateTemplateBytes().ConfigureAwait(false); result.ShouldNotBeNull(); result.Length.ShouldBeGreaterThan(0); await _excelImportService.SaveBlobAsync( @@ -56,11 +49,10 @@ namespace Win.Sfs.SettleAccount Name = fileName, Content = result } - ); + ).ConfigureAwait(false); return fileName; } - /// /// 一次性销售出库单导入模板 /// @@ -70,7 +62,7 @@ namespace Win.Sfs.SettleAccount public async Task SaveOneTimeExcelImportTemplate() { string fileName = "一次性寄售销售出库单导入模板.xlsx"; - var result = await Importer.GenerateTemplateBytes(); + var result = await Importer.GenerateTemplateBytes().ConfigureAwait(false); result.ShouldNotBeNull(); result.Length.ShouldBeGreaterThan(0); await _excelImportService.SaveBlobAsync( @@ -79,7 +71,7 @@ namespace Win.Sfs.SettleAccount Name = fileName, Content = result } - ); + ).ConfigureAwait(false); return fileName; } @@ -92,7 +84,7 @@ namespace Win.Sfs.SettleAccount public async Task SaveVWBJNoCodeExcelTemplate() { string fileName = "大众备件无单号出库单导入模板.xlsx"; - var result = await Importer.GenerateTemplateBytes(); + var result = await Importer.GenerateTemplateBytes().ConfigureAwait(false); result.ShouldNotBeNull(); result.Length.ShouldBeGreaterThan(0); await _excelImportService.SaveBlobAsync( @@ -101,11 +93,9 @@ namespace Win.Sfs.SettleAccount Name = fileName, Content = result } - ); + ).ConfigureAwait(false); return fileName; } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountController.cs b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountController.cs index e7b81cf6..ad593277 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountController.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountController.cs @@ -1,4 +1,4 @@ -using SettleAccount.Localization; +using SettleAccount.Localization; using Volo.Abp.AspNetCore.Mvc; namespace Win.Sfs.SettleAccount diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountHttpApiModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountHttpApiModule.cs index 52685932..52637d6b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountHttpApiModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/SettleAccountHttpApiModule.cs @@ -1,9 +1,9 @@ -using Localization.Resources.AbpUi; +using Localization.Resources.AbpUi; +using Microsoft.Extensions.DependencyInjection; using SettleAccount.Localization; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Localization; using Volo.Abp.Modularity; -using Microsoft.Extensions.DependencyInjection; namespace Win.Sfs.SettleAccount { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipBTExportController.cs b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipBTExportController.cs index d3cf33e9..09d7f1ca 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipBTExportController.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipBTExportController.cs @@ -1,9 +1,5 @@ -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.ImportExcelCommon; @@ -28,7 +24,7 @@ namespace Win.Sfs.SettleAccount [Route("download/{fileName}")] public async Task DownloadAsync(string fileName) { - var fileDto = await _excelImportService.GetBlobAsync(new GetExcelImportRequestDto { Name = fileName }); + var fileDto = await _excelImportService.GetBlobAsync(new GetExcelImportRequestDto { Name = fileName }).ConfigureAwait(false); return File(fileDto.Content, "application/octet-stream", fileDto.Name); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipExportController.cs b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipExportController.cs index e716d4e1..6c633a80 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipExportController.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.HttpApi/ZipExportController.cs @@ -1,14 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Win.Sfs.BaseData.ImportExcelCommon; using Win.Sfs.SettleAccount.ImportExcelCommon; namespace Win.Sfs.SettleAccount -{ +{ [Area("SettleAccount")] [Route("api/settleaccount/getblobzipfile")] @@ -29,7 +25,7 @@ namespace Win.Sfs.SettleAccount [Route("download/{fileName}")] public async Task DownloadAsync(string fileName) { - var fileDto = await _excelImportService.GetBlobAsync(new GetExcelImportRequestDto { Name = fileName }); + var fileDto = await _excelImportService.GetBlobAsync(new GetExcelImportRequestDto { Name = fileName }).ConfigureAwait(false); return File(fileDto.Content, "application/octet-stream", fileDto.Name); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ExportJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ExportJob.cs index 8e93dddb..0fc8f43c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ExportJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ExportJob.cs @@ -1,39 +1,29 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.Dispatcher; using TaskJob.EventArgs; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.FISes; namespace TaskJob.BackgroundJob { public class ExportJob : BackgroundJob, ITransientDependency { private readonly ExportJobDispatcher _service; - + public ExportJob(ExportJobDispatcher service) { _service = service; - } public override void Execute(ExportTaskArgs args) { if (args != null) { - + _service.ExportJob(args); } } - } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ImportJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ImportJob.cs index e230c04d..b0a6b497 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ImportJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/ImportJob.cs @@ -1,13 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.Dispatcher; using TaskJob.EventArgs; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Entities.TaskJobs; namespace TaskJob.BackgroundJob { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/NotifyJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/NotifyJob.cs index 4a4f4012..c22ca77b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/NotifyJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/BackgroundJob/NotifyJob.cs @@ -1,26 +1,17 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.Dispatcher; using TaskJob.EventArgs; using Volo.Abp.BackgroundJobs; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Entities; -using Win.Sfs.SettleAccount.Entities.TaskJobs; -using Win.Sfs.SettleAccount.FISes; namespace TaskJob.BackgroundJob { public class NotifyJob : BackgroundJob, ITransientDependency { private readonly NotifyJobDispatcher _service; - + public NotifyJob(NotifyJobDispatcher service) { _service = service; - } public override void Execute(NotifyTaskArgs args) @@ -31,10 +22,8 @@ namespace TaskJob.BackgroundJob _service.NotifyJob(args); } - } - } - + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Dispatcher/JobDispatcher.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Dispatcher/JobDispatcher.cs index 89f9f0bb..a95f23da 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Dispatcher/JobDispatcher.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Dispatcher/JobDispatcher.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; @@ -17,19 +13,15 @@ namespace TaskJob.Dispatcher private IImportJob _importService; - private readonly Func _importServiceAccessor; - - - public ImportJobDispatcher( Func importServiceAccessor - + ) { _importServiceAccessor = importServiceAccessor; - + } /// /// 分配导入给对应服务 @@ -39,12 +31,10 @@ namespace TaskJob.Dispatcher public Task ImportJob(ImportTaskArgs args) { _importService = _importServiceAccessor(args.ServiceName); - _importService.ImportFile(args.Id, args.FileName, args.FileName,args.InputConditions); + _importService.ImportFile(args.Id, args.FileName, args.FileName, args.InputConditions); return Task.CompletedTask; } - - } public class ExportJobDispatcher : ITransientDependency @@ -56,7 +46,7 @@ namespace TaskJob.Dispatcher ) { _exportServiceAccessor = exportServiceAccessor; - } + } public Task ExportJob(ExportTaskArgs args) { _exportService = _exportServiceAccessor(args.ServiceName); @@ -65,7 +55,6 @@ namespace TaskJob.Dispatcher return Task.CompletedTask; } - } public class NotifyJobDispatcher : ITransientDependency @@ -84,8 +73,6 @@ namespace TaskJob.Dispatcher _emailSender = emailSender; } - - public Task NotifyJob(NotifyTaskArgs args) { //_emailSender.SendAsync() @@ -97,5 +84,4 @@ namespace TaskJob.Dispatcher } } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Domain/OutputError.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Domain/OutputError.cs index 975f402a..8311b324 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Domain/OutputError.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Domain/OutputError.cs @@ -1,17 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.BlobStoring; namespace SettleAccount.Job.Domain { - - [BlobContainerName("output-errors")] - public class OutPutErrorContainer - { - } - + [BlobContainerName("output-errors")] + public class OutPutErrorContainer + { + + } + } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ExportTaskArgs.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ExportTaskArgs.cs index 73129648..6eeef659 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ExportTaskArgs.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ExportTaskArgs.cs @@ -1,19 +1,7 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.SettleAccount.Entities; - namespace TaskJob.EventArgs { - public class ExportTaskArgs: TaskArgs + public class ExportTaskArgs : TaskArgs { - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ImportTaskArgs.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ImportTaskArgs.cs index 58dc1b94..5af6596b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ImportTaskArgs.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/ImportTaskArgs.cs @@ -1,16 +1,7 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.SettleAccount.Entities; - namespace TaskJob.EventArgs { - public class ImportTaskArgs:TaskArgs + public class ImportTaskArgs : TaskArgs { - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/NotifyTaskArgs.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/NotifyTaskArgs.cs index fa8da26d..38e79ded 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/NotifyTaskArgs.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/NotifyTaskArgs.cs @@ -1,16 +1,7 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.SettleAccount.Entities; - namespace TaskJob.EventArgs { - public class NotifyTaskArgs:TaskArgs + public class NotifyTaskArgs : TaskArgs { - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/TaskArgs.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/TaskArgs.cs index 6e72be11..e169cc19 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/TaskArgs.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/EventArgs/TaskArgs.cs @@ -1,10 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Win.Sfs.SettleAccount.Entities; namespace TaskJob.EventArgs { @@ -14,20 +10,16 @@ namespace TaskJob.EventArgs public TaskArgs() { } - [Display(Name = "ID")] [StringLength(50)] [Required] public Guid Id { set; get; } - - [Display(Name = "任务ID")] [StringLength(50)] [Required] public string TaskId { set; get; } - [Display(Name = "任务名称")] [StringLength(50)] [Required] @@ -38,7 +30,6 @@ namespace TaskJob.EventArgs [Required] public string ActionName { set; get; } - //[Required] //[Display(Name = "任务状态")] //public TaskState State { set; get; } @@ -60,25 +51,20 @@ namespace TaskJob.EventArgs [Required] public List FileName { set; get; } - [Display(Name = "上传文件")] [Required] public List DownFileName { set; get; } - /// /// /// 上传文件名称(链接) /// public List RealFileName { set; get; } - /// /// 下载文件名称(链接) /// - - /// /// 真实下载文件名称(链接) /// @@ -93,9 +79,7 @@ namespace TaskJob.EventArgs [Required] public string ServiceName { set; get; } - - - public List InputConditions { set;get;} + public List InputConditions { set; get; } } @@ -103,12 +87,12 @@ namespace TaskJob.EventArgs public class CustomCondition { public string Name { set; get; } - public string Value { + public string Value + { + + set; get; - set; get; - } } - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IExportJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IExportJob.cs index ef8e2aba..26995d44 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IExportJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IExportJob.cs @@ -1,15 +1,12 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using Volo.Abp.DependencyInjection; namespace TaskJob.Interfaces { - public interface IExportJob: ITransientDependency + public interface IExportJob : ITransientDependency { - string ExportFile(Guid id,List exportName,List property); + string ExportFile(Guid id, List exportName, List property); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IImportJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IImportJob.cs index b961d6f3..0c26a035 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IImportJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/IImportJob.cs @@ -1,14 +1,11 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using Volo.Abp.DependencyInjection; namespace TaskJob.Interfaces { - public interface IImportJob: ITransientDependency + public interface IImportJob : ITransientDependency { /// /// 导入文件 @@ -17,6 +14,6 @@ namespace TaskJob.Interfaces /// /// /// - string ImportFile(Guid taskid,List fileName,List realfileName,List customConditions); + string ImportFile(Guid taskid, List fileName, List realfileName, List customConditions); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/INotifyJob.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/INotifyJob.cs index 43244a45..a8865f3d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/INotifyJob.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Interfaces/INotifyJob.cs @@ -1,14 +1,11 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using Volo.Abp.DependencyInjection; namespace TaskJob.Interfaces { - public interface INotifyJob: ITransientDependency + public interface INotifyJob : ITransientDependency { /// /// 发送通知 @@ -17,7 +14,7 @@ namespace TaskJob.Interfaces /// 上传文件名 /// 上传真实保存文件名 /// - string SendNotify(Guid id,List fileName,List realfileName,List customConditions); - + string SendNotify(Guid id, List fileName, List realfileName, List customConditions); + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Base/SecRelationShipImportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Base/SecRelationShipImportService.cs index a466b07a..b6ac6e45 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Base/SecRelationShipImportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Base/SecRelationShipImportService.cs @@ -1,35 +1,21 @@ -using EFCore.BulkExtensions; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using NPOI.HSSF.UserModel; -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.Data; using System.IO; using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; +using NPOI.HSSF.UserModel; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using SettleAccount.Job.Services; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Volo.Abp.Emailing; using Volo.Abp.EventBus.Distributed; -using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Entities.MaterialRelationships; -using Win.Sfs.SettleAccount.Entities.SettleAccounts; -using Win.Sfs.SettleAccount.Entities.SettlementParts; using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.MaterialRelationships; using Win.Sfs.SettleAccount.Repository.Code; using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.MaterialRelationships; -using WY.NewJit.MsgBaseData; -using WY.NewJit.MsgTransmission.TianHe; namespace TaskJob.Services { @@ -76,7 +62,6 @@ namespace TaskJob.Services var customerCode = customConditions.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; var Site = customConditions.Where(p => p.Name == "Site").FirstOrDefault().Value; - List checkList = new List(); if (string.IsNullOrEmpty(version)) { @@ -101,7 +86,6 @@ namespace TaskJob.Services if (isInvoke == true) { - } } if (checkList.Count > 0) @@ -111,454 +95,138 @@ namespace TaskJob.Services return id.ToString(); } - private List ImportPriceList(DataSet ds, string version, string customerCode, string model) + //var list = _settlePakRepository.GetDetail(version, customerCode); + //var _group1 = _ls.Where(p => p.Version == version).GroupBy(p => p.ErpSparePartCode).Select(p => new { Price = p.Sum(p => p.Price), Qty = p.Sum(p => p.PerCarNum), ErpSparePartCode = p.Key }); + //var _group2 = list.Where(p => p.Version == version).GroupBy(p => p.ErpSparePartCode).Select(p => new { Price = p.Sum(p => p.Price), Qty = p.Sum(p => p.PerCarNum), ErpSparePartCode = p.Key }); + //var _templist = from itm1 in _group1 join itm2 in _group2 on new { itm1.ErpSparePartCode } equals new { itm2.ErpSparePartCode } where itm1.Qty != itm2.Qty || itm1.Price != itm2.Price select itm1; + //var _delete = from r1 in _ls + // join r2 in list on new { r1.SettlementPartCode, r1.ErpSparePartCode, r1.Version } equals new { r2.SettlementPartCode, r2.ErpSparePartCode, r2.Version } + // into temp + // from t in temp.DefaultIfEmpty() + // where t == null + // select r1; + //List _ls1 = new List(); + //foreach (var itm in _templist) + //{ + // _ls1.Add(itm.ErpSparePartCode); + //} + //var _deleteErp = _delete.Select(p => p.ErpSparePartCode).ToList(); + //foreach (var itm in _deleteErp) + //{ + // _ls1.Add(itm); + //} + //var erplist = _ls1.Distinct().ToList(); + //_settlePakRepository.DelDetailByErpPartCode(version, erplist); + //var _add = _ls.Where(p => erplist.Contains(p.ErpSparePartCode) && p.Version == version); + //var _addList = _add.ToList(); + + /// 读取excel + /// 默认第一行为表头 + /// + /// excel文档绝对路径 + /// 内容行偏移量,第一行为表头,内容行从第二行开始则为1 + /// + public DataSet Import(string strFileName, int rowIndex) { - var projectList = _codesettingRepository.GetList("工厂车型"); - var factory = string.Empty; - var f = projectList.FirstOrDefault(p => p.Value == model); - if (f != null) + //DataTable dt = new DataTable(); + DataSet _ds = new DataSet(); + List _sheetNames = new List(); + IWorkbook hssfworkbook; + using (FileStream file = new FileStream(strFileName, FileMode.Open, FileAccess.Read)) { - factory = f.Description; + hssfworkbook = WorkbookFactory.Create(file); } - List errorList = new List(); - List partList = new List(); - foreach (DataTable table in ds.Tables) + int x = hssfworkbook.NumberOfSheets; ; + List sheetNames = new List(); + for (int i = 0; i < x; i++) { - - - if (table.Columns.Count > 11 && table.Columns[11].ColumnName == "辆份价格") - { - int i = 0; - List settleCodeList = new List(); - foreach (DataColumn column in table.Columns) - { - if (i > 11) - { - settleCodeList.Add(column.ColumnName); - } - i++; - } - - var _materialCodeKey = table.Columns[12].ColumnName.Trim(); - Dictionary _dic = new Dictionary(); - - if (table.Columns.Contains("零 件 号")) - { - foreach (DataRow row in table.Rows) - { - if (row["零 件 号"] != null && row["零 件 号"].ToString().Trim() == "结算件价格-FIS") - { - foreach (var settleCode in settleCodeList) - { - _dic.Add(settleCode, decimal.Parse(row[settleCode].ToString())); - } - } - } - } - else - { - errorList.Add(table.TableName + " [零 件 号]列不存在!"); - } - - if (_dic.Count == 0) - { - errorList.Add(table.TableName + " [结算件价格-FIS]行不存在!"); - } - - if (_dic.Count > 0) - { - - //int number2 = 0; - foreach (DataRow row in table.Rows) - { - foreach (var settleCode in settleCodeList) - { - if (row[settleCode] != null && !string.IsNullOrEmpty(row[settleCode].ToString())) - { - - var part = new SettlementPart(Guid.NewGuid(), Guid.NewGuid(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), customerCode, factory, model, version, settleCode.ToUpper(), string.Empty, _dic[settleCode], string.Empty); - partList.Add(part); - } - } - } - } - - } + _sheetNames.Add(hssfworkbook.GetSheetName(i)); } - if (errorList.Count == 0) + foreach (var itm in _sheetNames) { - _spartRepository.Insert(partList); - _spartVersionRepository.Insert(version, customerCode, customerCode); - } - return errorList; - } - - - - + ISheet sheet = hssfworkbook.GetSheet(itm); + IRow headRow = sheet.GetRow(rowIndex); - private List ImportRelationship(DataSet ds, string version, string customerCode, string model) - { - List errorList = new List(); - List _ls = new List(); - foreach (DataTable table in ds.Tables) - { - try + if (headRow != null) { - if (!table.Columns.Contains("零 件 号") || !table.Columns.Contains("供应商代码") - || !table.Columns.Contains("产品类") - || !table.Columns.Contains("每车数量") - || !table.Columns.Contains("单价") - || !table.Columns.Contains("零件类型") - ) - { - errorList.Add(table.TableName + ":零 件 号、供应商代码、产品类、没车数量、单价 、零件类型不存在!"); - } - if (table.Columns.Count > 11 && table.Columns[11].ColumnName == "辆份价格") + bool isAnlysis = false; + int colCount = headRow.LastCellNum; + if (colCount > 11) { - int i = 0; - List settleCodeList = new List(); - foreach (DataColumn column in table.Columns) + if (headRow.Cells[11] != null && headRow.Cells[11].StringCellValue.Trim() == "辆份价格") { - if (i > 11) - { - settleCodeList.Add(column.ColumnName); - } - i++; - } - if (i == 0) - { - errorList.Add(table.TableName + " [辆份价格]字段不存在!"); - } - int begin = 0; - int end = 0; - int number = 0; - if (table.Columns.Contains("零 件 号")) - { - foreach (DataRow row in table.Rows) - { - if (row["零 件 号"] != null && row["零 件 号"].ToString() == "每件总成含结算价金额") - { - begin = number; - } - if (row["零 件 号"] != null && row["零 件 号"].ToString().Contains("制表")) - { - end = number; - } - number++; - } - if (begin == 0) - { - errorList.Add(String.Format(table.TableName + " 零 件 号列:[每件总成含结算价金额]行不存在!", table.TableName)); - } - if (end == 0) - { - errorList.Add(table.TableName + "零 件 号列:[制表]行不存在!"); - } - } - else - { - errorList.Add(table.TableName + " [零 件 号]列不存在!"); - } - var _materialCodeKey = table.Columns[12].ColumnName.Trim(); - Dictionary _dic = new Dictionary(); - foreach (DataRow row in table.Rows) - { - if (row["零 件 号"] != null && row["零 件 号"].ToString().Trim() == "每件总成含结算价数量") - { - foreach (var settleCode in settleCodeList) - { - _dic.Add(settleCode, decimal.Parse(row[settleCode].ToString())); - } - } - } - if (_dic.Count == 0) - { - errorList.Add(table.TableName + " 零 件 号列:[每件总成含结算价数量]行不存在!"); - } - - int number2 = 0; - foreach (DataRow row in table.Rows) - { - if (number2 > begin && number2 < end) - { - int key = 0; - foreach (var settleCode in settleCodeList) - { - if (row[settleCode] != null && !string.IsNullOrEmpty(row[settleCode].ToString())) - { - var _relaitionship = new MaterialRelationshipDetail(Guid.NewGuid(), Guid.NewGuid(), version, customerCode, row["零 件 号"].ToString().Trim().ToUpper(), row["零件名称"].ToString().Trim(), model, settleCode.ToUpper(), settleCode.ToUpper(), string.Empty, _dic[settleCode]); - if (key == 0) - { - _relaitionship.UpdateRemark(settleCode); - } - _ls.Add(_relaitionship); - } - key++; - } - } - number2++; + isAnlysis = true; } } + if (isAnlysis == true) + { + _ds.Tables.Add(GetDataTable(hssfworkbook, sheet, 4)); + } } - catch (Exception e) - { - errorList.Add(e.Message); - } - } - var list = _reldetailRepository.GetDetail(version, customerCode); - //if (customerCode == "R0001")//二配结算员导入时 - //{ - // var _addFis = from r1 in _ls - // join r2 in list on new { r1.SettleMaterialCode, r1.ErpMaterialCode, r1.Qty, r1.Version } equals new { r2.SettleMaterialCode, r2.ErpMaterialCode, r2.Qty, r2.Version } - // into temp - // from t in temp.DefaultIfEmpty() - // where t == null - // select r1; - // var _addFisList = _addFis.ToList(); - - // var _lst = _addFisList.Select(p => p.ErpMaterialCode).Distinct().ToList(); - // var eto = new AssemblySyncEto() - // { - // OperationType = AssemblySyncOperationTypeEnum.Add, - // AssemblyCfgList = new List() - // }; - // foreach (var itm in _lst) - // { - // var _first = _addFisList.FirstOrDefault(p => p.ErpMaterialCode == itm); - // if (_first != null) - // { - // var erp = new CreateUpdateAssemblyCfgErpDto() - // { - // ErpAssemblyCode = _first.ErpMaterialCode, - // ErpAssemblyName = _first.MaterialDesc, - // Details = new List() - // }; - // var subCodeList = _ls.Where(p => p.ErpMaterialCode == itm).ToList(); - // if (subCodeList.Count > 0) - // { - // foreach (var part in subCodeList) - // { - // var sub = new CreateUpdateAssemblyCfgPartDto() - // { - // PartCode = part.SettleMaterialCode, - // PartNum = part.Qty, - // IsKey = string.IsNullOrEmpty(part.Remark) ? false : true - - // }; - // erp.Details.Add(sub); - // } - // } - // eto.AssemblyCfgList.Add(erp); - // } - // } - // _distributedEventBus.PublishAsync( - // eto - // ); - //} - var _group1 = _ls.Where(p => p.Version == version).GroupBy(p => p.ErpMaterialCode).Select(p => new { Qty = p.Sum(p => p.Qty), ErpMaterialCode = p.Key }); - var _group2 = list.Where(p => p.Version == version).GroupBy(p => p.ErpMaterialCode).Select(p => new { Qty = p.Sum(p => p.Qty), ErpMaterialCode = p.Key }); - var _templist = from itm1 in _group1 join itm2 in _group2 on new { itm1.ErpMaterialCode } equals new { itm2.ErpMaterialCode } where itm1.Qty != itm2.Qty select itm1; - - var _delete = from r1 in _ls - join r2 in list on new { r1.SettleMaterialCode, r1.ErpMaterialCode, r1.Version } equals new { r2.SettleMaterialCode, r2.ErpMaterialCode, r2.Version } - into temp - from t in temp.DefaultIfEmpty() - where t == null - select r1; - - List _ls1 = new List(); - foreach (var itm in _templist) - { - _ls1.Add(itm.ErpMaterialCode); - - } - - var _deleteErp = _delete.Select(p => p.ErpMaterialCode).ToList(); - foreach (var itm in _deleteErp) - { - _ls1.Add(itm); - } - - var erplist = _ls1.Distinct().ToList(); - - - _reldetailRepository.DelDetailByErpPartCode(version, erplist); - - var _add = _ls.Where(p => erplist.Contains(p.ErpMaterialCode) && p.Version == version); - - - var _addList = _add.ToList(); - - - foreach (var itm in erplist) - { - var parendId = Guid.NewGuid(); - var ary = _addList.Where(p => p.ErpMaterialCode == itm); - foreach (var re in ary) - { - re.AppraisalCategory = parendId.ToString(); - } - - } - if (_addList.Count() > 0 && errorList.Count == 0) - { - _reldetailRepository.Insert(_add.ToList()); - _relversionRepository.Insert(version, customerCode, customerCode); } - return errorList; + return _ds; } - //var list = _settlePakRepository.GetDetail(version, customerCode); - //var _group1 = _ls.Where(p => p.Version == version).GroupBy(p => p.ErpSparePartCode).Select(p => new { Price = p.Sum(p => p.Price), Qty = p.Sum(p => p.PerCarNum), ErpSparePartCode = p.Key }); - //var _group2 = list.Where(p => p.Version == version).GroupBy(p => p.ErpSparePartCode).Select(p => new { Price = p.Sum(p => p.Price), Qty = p.Sum(p => p.PerCarNum), ErpSparePartCode = p.Key }); - //var _templist = from itm1 in _group1 join itm2 in _group2 on new { itm1.ErpSparePartCode } equals new { itm2.ErpSparePartCode } where itm1.Qty != itm2.Qty || itm1.Price != itm2.Price select itm1; - //var _delete = from r1 in _ls - // join r2 in list on new { r1.SettlementPartCode, r1.ErpSparePartCode, r1.Version } equals new { r2.SettlementPartCode, r2.ErpSparePartCode, r2.Version } - // into temp - // from t in temp.DefaultIfEmpty() - // where t == null - // select r1; - //List _ls1 = new List(); - //foreach (var itm in _templist) - //{ - // _ls1.Add(itm.ErpSparePartCode); - //} - //var _deleteErp = _delete.Select(p => p.ErpSparePartCode).ToList(); - //foreach (var itm in _deleteErp) - //{ - // _ls1.Add(itm); - //} - //var erplist = _ls1.Distinct().ToList(); - //_settlePakRepository.DelDetailByErpPartCode(version, erplist); - //var _add = _ls.Where(p => erplist.Contains(p.ErpSparePartCode) && p.Version == version); - //var _addList = _add.ToList(); - - /// 读取excel - /// 默认第一行为表头 - /// - /// excel文档绝对路径 - /// 内容行偏移量,第一行为表头,内容行从第二行开始则为1 - /// - public DataSet Import(string strFileName, int rowIndex) + public DataTable GetDataTable(IWorkbook hssfworkbook, ISheet sheet, int rowIndex) + { + var dt = new DataTable(); + dt.TableName = sheet.SheetName; + IRow headRow = sheet.GetRow(rowIndex); + if (headRow != null) { - //DataTable dt = new DataTable(); - DataSet _ds = new DataSet(); - List _sheetNames = new List(); - IWorkbook hssfworkbook; - using (FileStream file = new FileStream(strFileName, FileMode.Open, FileAccess.Read)) - { - hssfworkbook = WorkbookFactory.Create(file); - } - int x = hssfworkbook.NumberOfSheets; ; - List sheetNames = new List(); - for (int i = 0; i < x; i++) - { - _sheetNames.Add(hssfworkbook.GetSheetName(i)); - } - foreach (var itm in _sheetNames) + int colCount = headRow.LastCellNum; + if (colCount > 11) { - ISheet sheet = hssfworkbook.GetSheet(itm); - IRow headRow = sheet.GetRow(rowIndex); - - if (headRow != null) + for (int i = 0; i < colCount; i++) { - bool isAnlysis = false; - int colCount = headRow.LastCellNum; - if (colCount > 11) - { - if (headRow.Cells[11] != null && headRow.Cells[11].StringCellValue.Trim() == "辆份价格") - { - isAnlysis = true; - } - } - if (isAnlysis == true) - { - _ds.Tables.Add(GetDataTable(hssfworkbook, sheet, 4)); - } + dt.Columns.Add(headRow.Cells[i].StringCellValue.Trim()); } - } - return _ds; - - } - public DataTable GetDataTable(IWorkbook hssfworkbook, ISheet sheet, int rowIndex) - { - var dt = new DataTable(); - dt.TableName = sheet.SheetName; - IRow headRow = sheet.GetRow(rowIndex); - if (headRow != null) + else { - int colCount = headRow.LastCellNum; - if (colCount > 11) - { - for (int i = 0; i < colCount; i++) - { - dt.Columns.Add(headRow.Cells[i].StringCellValue.Trim()); - } - } - else + for (int i = 0; i < colCount; i++) { - for (int i = 0; i < colCount; i++) - { - dt.Columns.Add("Grid_" + i.ToString()); - } + dt.Columns.Add("Grid_" + i.ToString()); } } + } - for (int i = (sheet.FirstRowNum + rowIndex); i <= sheet.LastRowNum; i++) + for (int i = (sheet.FirstRowNum + rowIndex); i <= sheet.LastRowNum; i++) + { + IRow row = sheet.GetRow(i); + bool emptyRow = true; + object[] itemArray = null; + if (row != null && row.LastCellNum >= 0) { - IRow row = sheet.GetRow(i); - bool emptyRow = true; - object[] itemArray = null; - if (row != null && row.LastCellNum >= 0) + itemArray = new object[row.LastCellNum]; + try { - itemArray = new object[row.LastCellNum]; - try + for (int j = row.FirstCellNum; j < row.LastCellNum; j++) { - for (int j = row.FirstCellNum; j < row.LastCellNum; j++) + if (row.GetCell(j) != null) { - if (row.GetCell(j) != null) + switch (row.GetCell(j).CellType) { - switch (row.GetCell(j).CellType) - { - case CellType.Numeric: - if (HSSFDateUtil.IsCellDateFormatted(row.GetCell(j)))//日期类型 - { - itemArray[j] = row.GetCell(j).DateCellValue.ToString("yyyy-MM-dd"); - } - else//其他数字类型 - { - itemArray[j] = row.GetCell(j).NumericCellValue; - } - break; - case CellType.Blank: - itemArray[j] = string.Empty; - break; - case CellType.Formula: //获取公式执行后的值,速度较慢 - if (hssfworkbook is XSSFWorkbook) - { - try - { - XSSFFormulaEvaluator eva = new XSSFFormulaEvaluator(hssfworkbook); - if (eva.Evaluate(row.GetCell(j)).CellType == CellType.Numeric) - { - itemArray[j] = eva.Evaluate(row.GetCell(j)).NumberValue; - } - else - { - itemArray[j] = eva.Evaluate(row.GetCell(j)).StringValue; - } - } - catch (Exception e) - { - var b = j; - } - } - else + case CellType.Numeric: + if (HSSFDateUtil.IsCellDateFormatted(row.GetCell(j)))//日期类型 + { + itemArray[j] = row.GetCell(j).DateCellValue.ToString("yyyy-MM-dd"); + } + else//其他数字类型 + { + itemArray[j] = row.GetCell(j).NumericCellValue; + } + break; + case CellType.Blank: + itemArray[j] = string.Empty; + break; + case CellType.Formula: //获取公式执行后的值,速度较慢 + if (hssfworkbook is XSSFWorkbook) + { + try { - HSSFFormulaEvaluator eva = new HSSFFormulaEvaluator(hssfworkbook); + XSSFFormulaEvaluator eva = new XSSFFormulaEvaluator(hssfworkbook); if (eva.Evaluate(row.GetCell(j)).CellType == CellType.Numeric) { itemArray[j] = eva.Evaluate(row.GetCell(j)).NumberValue; @@ -568,43 +236,55 @@ namespace TaskJob.Services itemArray[j] = eva.Evaluate(row.GetCell(j)).StringValue; } } - break; - default: - itemArray[j] = row.GetCell(j).StringCellValue; - break; - } - if (itemArray[j] != null && !string.IsNullOrEmpty(itemArray[j].ToString().Trim())) - { - emptyRow = false; - } + catch (Exception e) + { + var b = j; + } + } + else + { + HSSFFormulaEvaluator eva = new HSSFFormulaEvaluator(hssfworkbook); + if (eva.Evaluate(row.GetCell(j)).CellType == CellType.Numeric) + { + itemArray[j] = eva.Evaluate(row.GetCell(j)).NumberValue; + } + else + { + itemArray[j] = eva.Evaluate(row.GetCell(j)).StringValue; + } + } + break; + default: + itemArray[j] = row.GetCell(j).StringCellValue; + break; + } + if (itemArray[j] != null && !string.IsNullOrEmpty(itemArray[j].ToString().Trim())) + { + emptyRow = false; } } } - catch (Exception e) - { - var a = i; - - - } } - if (!emptyRow) + catch (Exception e) { - if (itemArray.Count() > dt.Columns.Count) - { - var _ls = itemArray.ToList(); - _ls.RemoveRange(dt.Columns.Count, itemArray.Count() - dt.Columns.Count); - itemArray = _ls.ToArray(); - } - - dt.Rows.Add(itemArray); } } - return dt; - } - + if (!emptyRow) + { + if (itemArray.Length > dt.Columns.Count) + { + var _ls = itemArray.ToList(); + _ls.RemoveRange(dt.Columns.Count, itemArray.Length - dt.Columns.Count); + itemArray = _ls.ToArray(); + } + dt.Rows.Add(itemArray); + } + } + return dt; } - } +} + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Fis/FisImportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Fis/FisImportService.cs index 76ec1bc7..cc6447c9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Fis/FisImportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Fis/FisImportService.cs @@ -1,13 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using TaskJob.EventArgs; -using TaskJob.Interfaces; -using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Repository.SettleAccount; - namespace TaskJob.Services { //public class FisImportService : ITransientDependency, IImportJob @@ -20,7 +10,6 @@ namespace TaskJob.Services // _versionRepository = versionRepository; // } - // public string ImportFile(string taskid, List fileName, List realfileName, List customConditions) // { // throw new NotImplementedException(); @@ -28,5 +17,3 @@ namespace TaskJob.Services //} } - - diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs index b75a3fb1..a87322bf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs @@ -1,10 +1,7 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; -using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using Volo.Abp; using Volo.Abp.DependencyInjection; using Win.Sfs.SettleAccount; @@ -17,10 +14,10 @@ namespace SettleAccount.Job.Services { public InputService() { - + } - public List Input(string filePath,List p_list=null,List errlist=null) where T : class, new() + public List Input(string filePath, List p_list = null, List errlist = null) where T : class, new() { if (errlist == null) @@ -29,13 +26,13 @@ namespace SettleAccount.Job.Services } var ImportList = new List(); ExcelImporter _importer = new ExcelImporter(); - var import =_importer.Import(filePath).Result; + var import = _importer.Import(filePath).Result; if (import.Exception != null) { if (import.Exception.Message.ToString() == "导入文件不存在!") { - - errlist.Add(new ErrorExportDto() { Message= "文件容器配置的路径错误,请检查!" }); + + errlist.Add(new ErrorExportDto() { Message = "文件容器配置的路径错误,请检查!" }); //throw new BusinessException("8989", "文件容器配置的路径错误,请检查!"); } else @@ -88,7 +85,7 @@ namespace SettleAccount.Job.Services //returnResult.errMessage = "SccessData"; } } - + return ImportList; } public List InputExtend(string filePath, List p_list = null) where T : class, new() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Invoices/InvoiceImportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Invoices/InvoiceImportService.cs index 02eefe92..46755722 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Invoices/InvoiceImportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Invoices/InvoiceImportService.cs @@ -1,18 +1,13 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using SettleAccount.Job.Services; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; using Win.Sfs.SettleAccount.Entities.Invoices; -using Win.Sfs.SettleAccount.Entities.SettleAccounts; - using Win.Sfs.SettleAccount.Repository.SettleAccount; namespace TaskJob.Services @@ -24,7 +19,6 @@ namespace TaskJob.Services private readonly InputService _inputService; private readonly OutputService _outputService; - public InvoiceImportService( InvoiceRepository repository, InvoiceVersionRepository versionRepository, @@ -58,7 +52,6 @@ namespace TaskJob.Services // errorList.Add("客户代码不能为空!"); //} - foreach (var itm in fileName) { @@ -66,16 +59,15 @@ namespace TaskJob.Services List _setls = new List(); List _errorList = new List(); var _id = Guid.NewGuid(); - var dtoList = _inputService.Input(filePath); - foreach (var dto in dtoList) - { - var _invoice = new Invoice(Guid.NewGuid(),DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(),version,dto.Factory,dto.MaterialCode, dto.MaterialDesc, dto.Qty, dto.Amt); - _setls.Add(_invoice); - } - _repository.Insert(_setls); - _versionRepository.Insert(version, customerCode, customerCode); - - + var dtoList = _inputService.Input(filePath); + foreach (var dto in dtoList) + { + var _invoice = new Invoice(Guid.NewGuid(), DateTime.Now.Year.ToString(), DateTime.Now.Month.ToString(), version, dto.Factory, dto.MaterialCode, dto.MaterialDesc, dto.Qty, dto.Amt); + _setls.Add(_invoice); + } + _repository.Insert(_setls); + _versionRepository.Insert(version, customerCode, customerCode); + } return taskid.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs index bd6cfe36..fcd3cfaf 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/OutputService.cs @@ -1,14 +1,8 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Microsoft.CSharp; -using SettleAccount.Job.Domain; -using Shouldly; using System; -using System.CodeDom.Compiler; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; @@ -17,10 +11,6 @@ using Win.Sfs.SettleAccount.Repository.SettleAccountJob; namespace SettleAccount.Job.Services { - - - - public class OutputService : ITransientDependency { private readonly IBlobContainer _fileContainer; @@ -39,12 +29,12 @@ namespace SettleAccount.Job.Services /// 任務ID /// 文件名稱 /// 錯誤信息列表 - public void ExportError(Guid Id,string fileName,List errorlist) where T : class, new() + public void ExportError(Guid Id, string fileName, List errorlist) where T : class, new() { IExporter _exporter = new ExcelExporter();//导出Excel - var result = _exporter.ExportAsByteArray(errorlist); + var result = _exporter.ExportAsByteArray(errorlist); result.ShouldNotBeNull(); - _fileContainer.SaveAsync(fileName, result.Result,true); + _fileContainer.SaveAsync(fileName, result.Result, true); var _task = new Win.Sfs.SettleAccount.Entities.TaskJob() { Error = fileName }; _taskjobRepository.UpdateTaskJob(Id, _task); //保存导出文件到服务器存成二进制 @@ -58,29 +48,16 @@ namespace SettleAccount.Job.Services var _task = new Win.Sfs.SettleAccount.Entities.TaskJob() { DownFileName = fileName }; _taskjobRepository.UpdateTaskJob(Id, _task); - - - - - - - - - //保存导出文件到服务器存成二进制 + //保存导出文件到服务器存成二进制 } - public void Export(Guid Id, string fileName,Dictionary> p_dic) where T : class, new() + public void Export(Guid Id, string fileName, Dictionary> p_dic) where T : class, new() { - - foreach (var itm in p_dic) { //.Append(p_list, "sheet1") } - - - //ExcelExporter _exporter = new ExcelExporter();//导出Excel //var result = _exporter //.Append(p_list, "sheet1") @@ -88,8 +65,6 @@ namespace SettleAccount.Job.Services //.Append(p_list1) //.ExportAppendDataAsByteArray(); - - //result.ShouldNotBeNull(); //_fileContainer.SaveAsync(fileName, result.Result, true); var _task = new Win.Sfs.SettleAccount.Entities.TaskJob() { DownFileName = fileName }; @@ -97,8 +72,5 @@ namespace SettleAccount.Job.Services //保存导出文件到服务器存成二进制 } - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/PD_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/PD_SERVICE.cs index 8a56846a..d34b0186 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/PD_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/PD_SERVICE.cs @@ -1,41 +1,23 @@ using System; using System.Collections.Generic; -using System.Data.Common; -using System.IO; using System.Linq; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading.Tasks; -using EFCore.BulkExtensions; -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Microsoft.Extensions.DependencyInjection; -using NPOI.OpenXmlFormats.Spreadsheet; -using SettleAccount.Domain.BQ; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Repositories; using Volo.Abp.Uow; using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Entities.BQ.Managers; -using Win.Sfs.SettleAccount.Entities.SettleAccounts; -using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.Repository.SettleAccount; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; -using Win.Sfs.Shared.RepositoryBase; namespace SettleAccount.Job.Services { public class PD_SERVICE : ITransientDependency, IExportJob { private readonly PendingDeductionDapperRepository _dapper; - //private readonly BBAC_PD_MNG _pdmng; + //private readonly BBAC_PD_MNG _pdmng; - IServiceProvider _serviceProvider; + readonly IServiceProvider _serviceProvider; public PD_SERVICE( PendingDeductionDapperRepository dapper, //BBAC_PD_MNG pdmng, @@ -44,7 +26,7 @@ namespace SettleAccount.Job.Services ) { _serviceProvider = serviceProvider; - + _dapper = dapper; //_pdmng=pdmng; } @@ -58,14 +40,12 @@ namespace SettleAccount.Job.Services /// public string ExportFile(Guid id, List exportName, List customConditions) { - - var invgroup = customConditions.Where(p => p.Name == "InvGroupNum").FirstOrDefault().Value;//获取发票分 var ls = _dapper.GetInvoiceList(invgroup); - if (ls != null && ls.Count>0) + if (ls != null && ls.Count > 0) { - var first=ls.FirstOrDefault(); + var first = ls.FirstOrDefault(); if (first.BusinessType == EnumBusinessType.JisHBPO) { var pd = _dapper.GenerationPendingDeductionHBPO(invgroup); @@ -102,7 +82,7 @@ namespace SettleAccount.Job.Services { } - + } else { @@ -126,6 +106,5 @@ namespace SettleAccount.Job.Services return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FISUnSettleAccountDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FISUnSettleAccountDiffExportService.cs index a6e1d711..33dca918 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FISUnSettleAccountDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FISUnSettleAccountDiffExportService.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisOutputService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisOutputService.cs index c8a60241..3f28b02e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisOutputService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisOutputService.cs @@ -1,16 +1,12 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; using Volo.Abp.Uow; using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; namespace SettleAccount.Job.Services { @@ -34,14 +30,14 @@ namespace SettleAccount.Job.Services _outputService = outputService; _repository = repository; _versionRepository = versionRepository; - _dapperRepository=dapperRepository; + _dapperRepository = dapperRepository; } [UnitOfWork(false)] public string ExportFile(Guid id, List exportName, List p_list) { var billnum = p_list.Where(p => p.Name == "BillNum").FirstOrDefault().Value; var date = p_list.Where(p => p.Name == "Date").FirstOrDefault().Value; - var _ls= _dapperRepository.Execute(billnum,date); + var _ls = _dapperRepository.Execute(billnum, date); return id.ToString(); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs index de28ddc2..4381c7c1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/FisUpdateExportService.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -15,11 +12,10 @@ namespace SettleAccount.Job.Services.Report { private readonly FisUpdateDapperRepository _dapperRepository; - public FisUpdateExportService( FisUpdateDapperRepository dapperRepository - + ) { _dapperRepository = dapperRepository; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs index 20b0c33d..0b5c9962 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSettledDetailDiffExportService.cs @@ -1,14 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services @@ -18,7 +13,7 @@ namespace SettleAccount.Job.Services /// public class HQFSettledDetailDiffExportService : ITransientDependency, IExportJob { - + private readonly HQFSettledDetailDapperRepository _dapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository; @@ -35,8 +30,8 @@ namespace SettleAccount.Job.Services { _inputService = inputService; _outputService = outputService; - _erpdapperRepository= erpdapperRepository; - _dapperRepository =dapperRepository; + _erpdapperRepository = erpdapperRepository; + _dapperRepository = dapperRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -65,7 +60,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.订货看板编号)).ToList(); } @@ -73,7 +68,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(warehouseDesc)) { var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList(); } @@ -81,7 +76,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(acceptNo)) { var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList(); } @@ -89,7 +84,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -97,7 +92,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.发货零件号)).ToList(); } @@ -105,7 +100,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs index 166889fe..c4bb9909 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFSharePartSettledDetailDiffExportService.cs @@ -1,14 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services @@ -18,7 +13,7 @@ namespace SettleAccount.Job.Services /// public class HQFSharePartSettledDetailDiffExportService : ITransientDependency, IExportJob { - + private readonly HQFSettledDetailDapperRepository _dapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository; @@ -35,9 +30,9 @@ namespace SettleAccount.Job.Services { _inputService = inputService; _outputService = outputService; - _erpdapperRepository= erpdapperRepository; - - _dapperRepository =dapperRepository; + _erpdapperRepository = erpdapperRepository; + + _dapperRepository = dapperRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -52,7 +47,7 @@ namespace SettleAccount.Job.Services 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 _ls=_dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup); + var _ls = _dapperRepository.GetSharePartSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup); //var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup); //var _lst=_dapperRepository.GetDiffQtyList(version); @@ -68,17 +63,16 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.结算物料号)).ToList(); } } - - - if (!string.IsNullOrEmpty(warehouseDesc)) + + if (!string.IsNullOrEmpty(warehouseDesc)) { var _groupList = warehouseDesc.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList(); } @@ -95,7 +89,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -103,7 +97,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.结算物料号)).ToList(); } @@ -111,7 +105,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFShippingExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFShippingExportService.cs index e6c33faa..166f7e0c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFShippingExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFShippingExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -42,7 +40,6 @@ namespace SettleAccount.Job.Services.Report var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; var _ls = _dapperRepository.GetHQFShippingReportList(version, begin, end); - _outputService.Export(id, _filename, _ls); return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs index 08b6cd7d..2b1f1ffb 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQFactoryUnSettledDetailDiffExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -57,15 +55,12 @@ namespace SettleAccount.Job.Services.Report 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,iscontionversion); + var _ls = _dapperRepository.GetSettleToFactoryDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion); //红旗主机厂未结比对红旗系统未对 var _ls_reversal = _dapperRepository.GetHQFactoryDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion); - //if (!string.IsNullOrEmpty(kanban)) //{ // var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); @@ -95,7 +90,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -103,7 +98,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.客户物料号)).ToList(); } @@ -112,15 +107,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } } - - - ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "红旗系统未对比对红旗主机厂未结") .SeparateBySheet() @@ -129,9 +121,6 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - - return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs index 998cecb6..7c401490 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSettledDetailDiffExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -72,7 +70,6 @@ namespace SettleAccount.Job.Services.Report //反向对比,有发货无结算,单独拿出去,财务要求 //var _reversels = _dapperRepository.GetReverseSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup); - //var _lst = _dapperRepository.GetDiffQtyList(version); //foreach (var itm in _lst) //{ @@ -88,7 +85,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.订货看板编号)).ToList(); } @@ -111,12 +108,11 @@ namespace SettleAccount.Job.Services.Report // } //} - //物料组车型 if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -125,7 +121,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.订货零件号)).ToList(); } @@ -134,7 +130,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } @@ -151,7 +147,6 @@ namespace SettleAccount.Job.Services.Report select itm; _ls = query.ToList(); - //_outputService.Export(id, _filename, _ls); ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "红旗工厂核对明细") @@ -163,9 +158,6 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - - return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs index df47b411..f95b85a6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHSharePartSettledDetailDiffExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -23,8 +21,6 @@ namespace SettleAccount.Job.Services.Report private readonly OutputService _outputService; private readonly InputService _inputService; - - private readonly IBlobContainer _fileContainer; public HQHSharePartSettledDetailDiffExportService( @@ -79,13 +75,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + 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(); @@ -107,7 +102,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -116,7 +111,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.结算物料号)).ToList(); } @@ -124,14 +119,13 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } } //_outputService.Export(id, _filename, _ls); - ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "红旗工厂备件明细") .SeparateBySheet() @@ -139,8 +133,6 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHShippingExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHShippingExportService.cs index c1247ac2..4ae59f97 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHShippingExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHShippingExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -48,7 +46,6 @@ namespace SettleAccount.Job.Services.Report var warehouseDesc = p_list.Where(p => p.Name == "WarehouseDesc").FirstOrDefault().Value; var _ls = _dapperRepository.GetHQHShippingReportList(version, materialCode, begin, end, materialGroup); - _outputService.Export(id, _filename, _ls); return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs index 27884e94..2adef65c 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQHUnSettledDetailDiffExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -62,8 +60,6 @@ namespace SettleAccount.Job.Services.Report 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, iscontionversion); @@ -72,12 +68,11 @@ namespace SettleAccount.Job.Services.Report //有发货有结算,且发货数量大于结算数量的数据汇总 //var _ls_innerjoin = _dapperRepository.GetInnerJoinSettledDetailDiffReportList(version, materialCode, begin, end, materialGroup, iscontionversion); - if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } @@ -94,7 +89,6 @@ namespace SettleAccount.Job.Services.Report select itm; _ls = query.ToList(); - ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "红旗看板未结明细") //.SeparateBySheet() @@ -105,9 +99,6 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - - return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs index e2267048..711ca0c7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSettledDetailDiffExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -64,17 +62,16 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + 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) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList(); } @@ -83,7 +80,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(acceptNo)) { var _groupList = acceptNo.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.结算验收单号)).ToList(); } @@ -91,7 +88,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -99,7 +96,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.发货零件号)).ToList(); } @@ -107,7 +104,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSharePartSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSharePartSettledDetailDiffExportService.cs index ba91cf18..790aee11 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSharePartSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMSharePartSettledDetailDiffExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -62,17 +60,16 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + 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) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.收货仓库描述)).ToList(); } @@ -89,7 +86,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组)).ToList(); } @@ -97,7 +94,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.结算物料号)).ToList(); } @@ -105,7 +102,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMShippingExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMShippingExportService.cs index 6e87486a..32e84cf0 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMShippingExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/HQMShippingExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -42,7 +40,6 @@ namespace SettleAccount.Job.Services.Report var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; var _ls = _dapperRepository.GetHQFShippingReportList(version, begin, end); - _outputService.Export(id, _filename, _ls); return id.ToString(); } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoicePriceListDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoicePriceListDiffExportService.cs index 6bb0b260..d9cc8421 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoicePriceListDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoicePriceListDiffExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -36,7 +34,6 @@ namespace SettleAccount.Job.Services.Report var _id = Guid.NewGuid(); return _first; - } } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs index 2fc90975..733b4120 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDetailDiffExportService.cs @@ -1,16 +1,12 @@ using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services @@ -20,7 +16,7 @@ namespace SettleAccount.Job.Services /// public class InvoiceSettledDetailDiffExportService : ITransientDependency, IExportJob { - + private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository; private readonly ErpPartDapperRepository _erpdapperRepository; private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; @@ -37,11 +33,11 @@ namespace SettleAccount.Job.Services { _inputService = inputService; _outputService = outputService; - _erpdapperRepository= erpdapperRepository; + _erpdapperRepository = erpdapperRepository; //_repository = repository; //_versionRepository = versionRepository; - _dapperRepository =dapperRepository; - _errorListRepository=errorListRepository; + _dapperRepository = dapperRepository; + _errorListRepository = errorListRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -59,31 +55,22 @@ namespace SettleAccount.Job.Services var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; var _ls = _dapperRepository.GetInvoiceSettledDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup); - var _checkList = _erpdapperRepository.GetErrorBillList(); var q = from itm in _ls - join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } + join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 - from tm1 in temp1.DefaultIfEmpty() - where tm1 == null - select itm; + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; _ls = q.ToList(); - - - - - var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }) .Select(p => p.FirstOrDefault()).ToList(); - var rangeList = _erpdapperRepository.GetSapList(_list, version, true); - - //// var erpPriceList= _erpdapperRepository.GetErpPartCodePriceList(version); var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version); @@ -93,11 +80,9 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC .GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }) .Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price = p.Sum(itm => itm.InvoiceAmt) }).ToList(); - - var rangList = from itm1 in rangeList - join itm2 in erpPriceList - on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } + join itm2 in erpPriceList + on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals new { itm2.ParentSapMaterialCode, itm2.KENNCode, itm2.ChassisNumber } into temp1 from tm1 in temp1.DefaultIfEmpty() @@ -130,9 +115,6 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC rangeList = rangList.ToList(); - - - foreach (var itm in diffList) { var _first = _ls.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode); @@ -145,7 +127,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC foreach (var itm in _ls) { - itm.InvoiceAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice,2); + itm.InvoiceAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice, 2); itm.DiffPrice = itm.Price - itm.InvoicePrice; } _ls.AddRange(rangeList); @@ -160,11 +142,10 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC // } //} - if (!string.IsNullOrEmpty(materialGroup)) { - var _groupList= materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if(_groupList.Count()>0) + var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -172,7 +153,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split("\n").ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -180,7 +161,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split("\n").ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -188,7 +169,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -196,22 +177,17 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - - //.Select(p => p.FirstOrDefault()); _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList(); } - - - _outputService.Export(id, _filename, _ls.ToList()); return id.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs index 4a1b7d07..39ae0172 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/InvoiceSettledDiffExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -32,33 +30,31 @@ namespace SettleAccount.Job.Services _outputService = outputService; _repository = repository; _versionRepository = versionRepository; - _dapperRepository=dapperRepository; + _dapperRepository = dapperRepository; } public string ExportFile(Guid id, List exportName, List p_list) { var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value; - + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; //var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; - var matialCode= p_list.Where(p => p.Name == "MatialCode").FirstOrDefault().Value; + var matialCode = p_list.Where(p => p.Name == "MatialCode").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; var _first = exportName.FirstOrDefault(); - var _ls= _dapperRepository.GetInvoiceSettledDiffReportList(version,year,"set_settle",matialCode); + var _ls = _dapperRepository.GetInvoiceSettledDiffReportList(version, year, "set_settle", matialCode); - var _id= Guid.NewGuid(); + var _id = Guid.NewGuid(); List _list = new List(); List _lsExport = new List(); - - if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -66,40 +62,38 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(matialCode)) { var _groupList = matialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } } - foreach (var itm in _ls) { - //_list.Add(new InvoiceSettledDiff(Guid.NewGuid(), _id, itm.MaterialCode, itm.InvoiceQty, itm.SettleQty)); - _lsExport.Add(new InvoiceSettledDiffExportDto() + //_list.Add(new InvoiceSettledDiff(Guid.NewGuid(), _id, itm.MaterialCode, itm.InvoiceQty, itm.SettleQty)); + _lsExport.Add(new InvoiceSettledDiffExportDto() { - Version =itm. Version , - MaterialCode =itm. MaterialCode , - InvoiceQty =itm. InvoiceQty , - InvoiceAmt =itm. InvoiceAmt , - InvoicePrice =itm. InvoicePrice , - SettleQty =itm. SettleQty , - CP7ScrapQty =itm. CP7ScrapQty , - ClaimQty =itm. ClaimQty , - DiffQty =itm.InvoiceQty-itm.SettleQty-itm.CP7ScrapQty-itm.ClaimQty,//开票数量-结算数量-CP7报废数量-索赔数量 - SalePrice =itm. SalePrice , - DiffPrice =itm. DiffPrice , - SapMaterialCode =itm.SapMaterialCode , - MaterialDesc=itm.MaterialDesc, - SapMaterialGroup=itm.SapMaterialGroup, + Version = itm.Version, + MaterialCode = itm.MaterialCode, + InvoiceQty = itm.InvoiceQty, + InvoiceAmt = itm.InvoiceAmt, + InvoicePrice = itm.InvoicePrice, + SettleQty = itm.SettleQty, + CP7ScrapQty = itm.CP7ScrapQty, + ClaimQty = itm.ClaimQty, + DiffQty = itm.InvoiceQty - itm.SettleQty - itm.CP7ScrapQty - itm.ClaimQty,//开票数量-结算数量-CP7报废数量-索赔数量 + SalePrice = itm.SalePrice, + DiffPrice = itm.DiffPrice, + SapMaterialCode = itm.SapMaterialCode, + MaterialDesc = itm.MaterialDesc, + SapMaterialGroup = itm.SapMaterialGroup, Factory = itm.Factory, - }); + }); } - _lsExport=_lsExport.OrderBy(p => p.SapMaterialGroup).ToList(); - _outputService.Export(id,_first, _lsExport); + _lsExport = _lsExport.OrderBy(p => p.SapMaterialGroup).ToList(); + _outputService.Export(id, _first, _lsExport); - return id.ToString(); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs index f447a674..bfc054c1 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisBBACSeEdiCompareExportService.cs @@ -1,10 +1,8 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Linq; using System.Linq.Dynamic.Core; using Microsoft.AspNetCore.SignalR; -using Microsoft.OpenApi.Extensions; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; using Shouldly; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs index 40741a08..2216b3e5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/JisHBPOSeEdiCompareExportService.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using System.Linq; using Microsoft.AspNetCore.SignalR; -using Microsoft.OpenApi.Extensions; using SettleAccount.Domain.BQ; using SettleAccount.Job.SignalR; using Shouldly; @@ -33,7 +31,7 @@ namespace SettleAccount.Job.Services.Report public JisHBPOSeEdiCompareExportService( IHubContext hubContext, IBlobContainer fileContainer, - SettleAccountDbContext settleAccountDbContext):base(settleAccountDbContext, hubContext) + SettleAccountDbContext settleAccountDbContext) : base(settleAccountDbContext, hubContext) { _fileContainer = fileContainer; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs index 83ca0512..b2e88d30 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/KanBanUnSettledExport.cs @@ -1,17 +1,13 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -20,7 +16,7 @@ namespace SettleAccount.Job.Services.Report { private readonly OutputService _outputService; - KanbanUnSettledDapperRepository _dapper; + readonly KanbanUnSettledDapperRepository _dapper; private readonly IBlobContainer _fileContainer; private readonly ErpPartDapperRepository _erpdapperRepository; @@ -50,7 +46,6 @@ namespace SettleAccount.Job.Services.Report var sapCode = p_list.Where(p => p.Name == "SAPCode").FirstOrDefault().Value; var iscontionversion = p_list.Where(p => p.Name == "IsContainVersion").FirstOrDefault().Value; - var _ls = _dapper.GetKanbanReportList(version, begin, end, iscontionversion); //财务香凝要求:交货数量-退货数量=结算数量 这样的不体现在未结中 @@ -75,7 +70,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapCode)).ToList(); } @@ -84,7 +79,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); } @@ -92,13 +87,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } } - //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 var _checkList = _erpdapperRepository.GetErrorBillList(); @@ -110,7 +104,6 @@ namespace SettleAccount.Job.Services.Report select itm; _ls = query.ToList(); - //if (!string.IsNullOrEmpty(materialCode)) //{ // var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); @@ -130,8 +123,6 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - return id.ToString(); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PriceQtyDifferenceExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PriceQtyDifferenceExportService.cs index d74d797a..831b1654 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PriceQtyDifferenceExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/PriceQtyDifferenceExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -22,14 +20,13 @@ namespace SettleAccount.Job.Services.Report _outputService = outputService; } - public string ExportFile(Guid id, List exportName, List p_list) { var _first = exportName.FirstOrDefault(); var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; var _list = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), customerCode, version); - + _outputService.Export(id, _first, _list); return id.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SecMatchBaseExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SecMatchBaseExportService.cs index 0c290ed8..ac5f5e68 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SecMatchBaseExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SecMatchBaseExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -14,7 +12,6 @@ namespace SettleAccount.Job.Services.Report public class SecMatchBaseExportService : ITransientDependency, IExportJob { - private readonly SecMatchBaseDapperReportRepository _dapper; private readonly OutputService _outputService; @@ -24,16 +21,13 @@ namespace SettleAccount.Job.Services.Report _outputService = outputService; } - public string ExportFile(Guid id, List exportName, List p_list) { var _first = exportName.FirstOrDefault(); var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; - // var model = p_list.Where(p => p.Name == "Model").FirstOrDefault().Value; - var _list = _dapper.GetReportList(version,string.Empty); - + // var model = p_list.Where(p => p.Name == "Model").FirstOrDefault().Value; + var _list = _dapper.GetReportList(version, string.Empty); - _outputService.Export(id, _first, _list); return id.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs index 0e05314b..b7a7fab3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleDoorPanelExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -32,7 +30,6 @@ namespace SettleAccount.Job.Services.Report OutputService outputService, InputService inputService - ) { _unSettledapperRepository = unSettledapperRepository; @@ -81,9 +78,7 @@ namespace SettleAccount.Job.Services.Report } var erpPriceList = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }) - .Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price =Math.Round( p.Sum(itm => itm.InvoiceAmt),2) }).ToList(); - - + .Select(p => new { ParentSapMaterialCode = p.Key.ParentSapMaterialCode, ChassisNumber = p.Key.ChassisNumber, KENNCode = p.Key.KENNCode, Price = Math.Round(p.Sum(itm => itm.InvoiceAmt), 2) }).ToList(); var rangList = from itm1 in rangeList join itm2 in erpPriceList on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals new { itm2.ParentSapMaterialCode, itm2.KENNCode, itm2.ChassisNumber } @@ -121,7 +116,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -129,7 +124,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split("\n").ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -137,7 +132,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split("\n").ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -145,7 +140,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -153,24 +148,22 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - - //.Select(p => p.FirstOrDefault()); _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList(); } - var report1List = _ls.Where(p=>p.DiffPrice!=0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode }) - .Select(t => new SettleDoorPanelExport{ MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList(); + var report1List = _ls.Where(p => p.DiffPrice != 0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode }) + .Select(t => new SettleDoorPanelExport { MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList(); //var report2List = report1List.GroupBy(p => new {p.MaterialGroup }).Select(p=>new SettleDoorPanelSumExport { MaterialGroup= p.Key.MaterialGroup, InvoiceDiffPrice=p.Sum(itm=>itm.InvoiceDiffPrice), Version= version }); - var report2List= _ls.Where(p => p.DiffPrice != 0).Select(p=> new { p.MaterialGroup,DiffAmt=p.DiffPrice*p.Qty }).GroupBy(p=>new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); ; + var report2List = _ls.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); ; ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(report1List.ToList(), "按物料价格差异明细表") .SeparateBySheet() @@ -184,9 +177,5 @@ namespace SettleAccount.Job.Services.Report return id.ToString(); } - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleFisDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleFisDiffExportService.cs index c64085bd..debc57be 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleFisDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleFisDiffExportService.cs @@ -1,15 +1,9 @@ -using NPOI.SS.UserModel; -using NPOI.XSSF.UserModel; using System; using System.Collections.Generic; -using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Repository.Report; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -19,165 +13,41 @@ namespace SettleAccount.Job.Services.Report /// public class SettleFisDiffExportService : ITransientDependency, IExportJob { - + private readonly SettleFisDiffDetailDapperRepository _dapper; private readonly OutputService _outputService; - - - public SettleFisDiffExportService(SettleFisDiffDetailDapperRepository dapper, OutputService outputService) { _dapper = dapper; _outputService = outputService; } - public string ExportFile(Guid id, List exportName, List p_list) { var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; - var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; + var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; var end = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; - var _list= _dapper.GetReportList(version, materialCode, begin,end); + var _list = _dapper.GetReportList(version, materialCode, begin, end); - var _ls= _list.GroupBy(p => new { p.MaterialCode,p.SapCode }).Select(p =>new SettleFisDiffSum + var _ls = _list.GroupBy(p => new { p.MaterialCode, p.SapCode }).Select(p => new SettleFisDiffSum { - MaterialCode= p.Key.MaterialCode, - SapCode= p.Key.SapCode, - DiffPrice=p.Sum(p=>p.DiffPrice), - DiffQty=p.Sum(p=>p.DiffQty), - Qty=p.Sum(p=>p.Qty), - SettleQty=p.Sum(p=>p.SettleQty), - Price=p.Sum(p=>p.Price) + MaterialCode = p.Key.MaterialCode, + SapCode = p.Key.SapCode, + DiffPrice = p.Sum(p => p.DiffPrice), + DiffQty = p.Sum(p => p.DiffQty), + Qty = p.Sum(p => p.Qty), + SettleQty = p.Sum(p => p.SettleQty), + Price = p.Sum(p => p.Price) }); - //_outputService.Export(id, string.Format("大众准时化结算数量差异比对表_{0}.xlsx", Guid.NewGuid().ToString()),_list.ToList(),_ls.ToList()); - _outputService.Export(id, string.Format("大众准时化结算数量合计_{0}.xlsx", Guid.NewGuid().ToString()), _ls.ToList()); + //_outputService.Export(id, string.Format("大众准时化结算数量差异比对表_{0}.xlsx", Guid.NewGuid().ToString()),_list.ToList(),_ls.ToList()); + _outputService.Export(id, string.Format("大众准时化结算数量合计_{0}.xlsx", Guid.NewGuid().ToString()), _ls.ToList()); - _outputService.Export(id,string.Format("大众准时化结算数量差异比对表_{0}.xlsx", Guid.NewGuid().ToString()), _list); + _outputService.Export(id, string.Format("大众准时化结算数量差异比对表_{0}.xlsx", Guid.NewGuid().ToString()), _list); return id.ToString(); } - - /// - /// 将数个Excel文件中的第一个工作表合并至一个Excel文件中 - /// - /// 需要合并的数个Excel文件路径 - /// 合并成的一个Excel文件路径 - private void MergeExcels(string[] excelFilePaths, string desFilePath) - { - - - XSSFWorkbook mergeWorkBook = new XSSFWorkbook(); - for (int i = 0; i < excelFilePaths.Length; i++) - { - if (File.Exists(excelFilePaths[i])) - { - using (FileStream fs = new FileStream(excelFilePaths[i], FileMode.Open, FileAccess.Read, FileShare.Write)) - { - XSSFWorkbook tmpWorkBook = new XSSFWorkbook(fs); - XSSFSheet tmpSheet = tmpWorkBook.GetSheetAt(0) as XSSFSheet; - if (excelFilePaths[i].Contains("当月结算表")) - { - IRow row = null; - for (int j = 2; j < tmpSheet.PhysicalNumberOfRows && tmpSheet.GetRow(j) != null; j++)/*j=1 从索引的第一行开始过滤掉表头*/ - { - row = tmpSheet.GetRow(j); - try - { - if (!string.IsNullOrWhiteSpace(row.GetCell(1).ToString()))/*验证数值非空*/ - { - //cell.CSS("color:red;font-weight:bold;font-size:11;font-name:宋体;border-type:thin;") - /*修改样式关键代码*/ - ICellStyle style = tmpWorkBook.CreateCellStyle(); - style.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.Orange.Index; - style.FillPattern = FillPattern.SolidForeground; - style.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.Orange.Index; - - style.BorderTop = BorderStyle.Thin;//上 - style.BorderBottom = BorderStyle.Thin;//下 - style.BorderLeft = BorderStyle.Thin;//左 - style.BorderRight = BorderStyle.Thin;//右 - style.VerticalAlignment = VerticalAlignment.Center; - style.Alignment = HorizontalAlignment.Center; - - IFont font = tmpWorkBook.CreateFont(); - font.FontHeightInPoints = 10; // 字体大小 直接对应Excel中的字体大小 - font.FontName = "宋体"; //跟Excel中的字体值一样,直接写对应的名称即可 - font.IsBold = true;//加粗 - style.SetFont(font); - /*修改指定单元格样式 如果要修改行样式则需要将row.Cells.Count循环出来,挨个设置!*/ - for (int g = 0; g < row.Cells.Count; g++) - { - row.Cells[g].CellStyle = style; - } - row.RowStyle = style; - - if (row.GetCell(1).ToString() == "核算表不存在") - { - ICellStyle style1 = tmpWorkBook.CreateCellStyle(); - style1.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.Yellow.Index; - style1.FillPattern = FillPattern.SolidForeground; - style1.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.Yellow.Index; - - style1.BorderTop = BorderStyle.Thin;//上 - style1.BorderBottom = BorderStyle.Thin;//下 - style1.BorderLeft = BorderStyle.Thin;//左 - style1.BorderRight = BorderStyle.Thin;//右 - style1.VerticalAlignment = VerticalAlignment.Center; - style1.Alignment = HorizontalAlignment.Center; - IFont font1 = tmpWorkBook.CreateFont(); - font1.FontHeightInPoints = 10; // 字体大小 直接对应Excel中的字体大小 - font1.FontName = "宋体"; //跟Excel中的字体值一样,直接写对应的名称即可 - font1.IsBold = true;//加粗 - font1.Color = NPOI.HSSF.Util.HSSFColor.White.Index; - style1.SetFont(font); - //style.fon - //HSSFFont font = workbookAll.CreateFont(); - //font.FontHeightInPoints = 9; // 字体大小 直接对应Excel中的字体大小 - //font.FontName = "宋体"; //跟Excel中的字体值一样,直接写对应的名称即可 - //font.Boldweight = HSSFFont.BOLDWEIGHT_BOLD;//加粗 - //style.SetFont(font); - - - /*修改指定单元格样式 如果要修改行样式则需要将row.Cells.Count循环出来,挨个设置!*/ - for (int g = 0; g < row.Cells.Count; g++) - { - row.Cells[g].CellStyle = style1; - } - row.RowStyle = style1; - - } - /*重新修改文件指定单元格样式*/ - } - } - catch - { } - } - } - tmpSheet.CopyTo(mergeWorkBook, Path.GetFileNameWithoutExtension(excelFilePaths[i]), true, true); - } - } - /* 考虑数据量,此处可以限制最多可以合并工作表的数量 */ - //if (mergeWorkBook.NumberOfSheets >= 200) - //{ - // break; - //} - } - if (mergeWorkBook.NumberOfSheets != 0) - { - FileStream fsDesFile = new FileStream(desFilePath, FileMode.OpenOrCreate, FileAccess.Write); - mergeWorkBook.Write(fsDesFile); - fsDesFile.Close(); - mergeWorkBook.Close(); - } - else - { - mergeWorkBook.Close(); - } - } - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs index f79bef52..fceb946b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithCodeExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -33,14 +31,12 @@ namespace SettleAccount.Job.Services.Report //_errorListRepository = errorListRepository; } - public string ExportFile(Guid id, List exportName, List p_list) { var _filename = exportName.FirstOrDefault(); var sapMaterialCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; - var customerPartCode = p_list.Where(p => p.Name == "CustomerPartCode").FirstOrDefault().Value; var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "EstimateTypeDesc").FirstOrDefault().Value; @@ -48,7 +44,6 @@ namespace SettleAccount.Job.Services.Report var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value; var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; - var _list = _dapper.GetSettleKBWithCodeReportList(kanban, version, sapMaterialCode, customerPartCode, materialGroup, beginTime, endTime); var diffList = _dapper.GetVWKanBanInvoiceDiff(version); if (diffList != null) @@ -68,7 +63,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.EstimateTypeDesc)).ToList(); } @@ -77,7 +72,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapMaterialCode)) { var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -94,32 +89,30 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(customerPartCode)) { var _groupList = customerPartCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); } } - if (!string.IsNullOrEmpty(kanban)) { var _groupList = kanban.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.Kanban)).ToList(); } } - //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 var _checkList = _erpdapperRepository.GetErrorBillList(); var query = from itm in _list join itm1 in _checkList on new { ChassisNumber = itm.Kanban, MaterialCode = itm.CustomerPartCode, WmsBillNum = itm.WMSDeliveryNote } equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 - from tm1 in temp1.DefaultIfEmpty() - where tm1 == null - select itm; + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; _list = query.ToList(); _outputService.Export(id, _filename, _list.ToList()); @@ -127,6 +120,5 @@ namespace SettleAccount.Job.Services.Report return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithOutCodeExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithOutCodeExportService.cs index d4e459e6..4b96453b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithOutCodeExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleKBWithOutCodeExportService.cs @@ -1,8 +1,6 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; @@ -17,7 +15,7 @@ namespace SettleAccount.Job.Services.Report private readonly ErpPartDapperRepository _erpdapperRepository; public SettleKBWithOutCodeExportService( - KanbanUnSettledDapperRepository dapper, + KanbanUnSettledDapperRepository dapper, OutputService outputService, ErpPartDapperRepository erpdapperRepository ) @@ -27,14 +25,12 @@ namespace SettleAccount.Job.Services.Report _erpdapperRepository = erpdapperRepository; } - public string ExportFile(Guid id, List exportName, List p_list) { var _filename = exportName.FirstOrDefault(); var sapMaterialCode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; - var customerPartCode = p_list.Where(p => p.Name == "CustomerPartCode").FirstOrDefault().Value; var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "EstimateTypeDesc").FirstOrDefault().Value; @@ -42,11 +38,8 @@ namespace SettleAccount.Job.Services.Report var beginTime = p_list.Where(p => p.Name == "BegingTime").FirstOrDefault().Value; var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; - var _list = _dapper.GetNoKanbanSettleDetail(version); - - //var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version); //if (diffList != null) //{ @@ -61,16 +54,16 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialGroup)).ToList(); } } - + if (!string.IsNullOrEmpty(sapMaterialCode)) { var _groupList = sapMaterialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -79,7 +72,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(customerPartCode)) { var _groupList = customerPartCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -103,14 +96,10 @@ namespace SettleAccount.Job.Services.Report // } //} - - - - _outputService.Export(id,_filename , _list); + _outputService.Export(id, _filename, _list); return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs index 75efd346..ec188ca7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePart90ExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -30,7 +28,6 @@ namespace SettleAccount.Job.Services.Report _fileContainer = fileContainer; } - public string ExportFile(Guid id, List exportName, List p_list) { var fileName = exportName.FirstOrDefault(); @@ -69,7 +66,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } @@ -87,15 +84,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(purchaseOrderNo)) { var _groupList = purchaseOrderNo.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.采购订单号)).ToList(); } } - - - ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "大众备件数据调整输出") .SeparateBySheet() @@ -104,14 +98,10 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(fileName, result.Result, true); - - //_outputService.Export(id, fileName, _ls); - return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs index 96368048..5753745d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleSparePartExportService.cs @@ -1,17 +1,13 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -19,12 +15,9 @@ namespace SettleAccount.Job.Services.Report public class SettleSparePartExportService : ITransientDependency, IExportJob { private readonly SettleSparePartDapperReportRepository _dapper; - private readonly OutputService _outputService; private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; - - private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; public string ExportFile(Guid id, List exportName, List p_list) { var fileName = exportName.FirstOrDefault(); @@ -45,7 +38,6 @@ namespace SettleAccount.Job.Services.Report //反向对比,即大众备件未结(有单号),包含有发货有结算并且发货数量大于结算数量的数据也整合到未结中 //var _reversels_withcode = _dapper.GetReverseWithCodeSettleSparePartReportList(purchaseOrderNo, version, sapCode, matialCode, beginTime, endTime); - //var stockList = _wmsDapper.GetSalesStock(); ////针对无单号备件,求和汇总显示 @@ -92,13 +84,10 @@ namespace SettleAccount.Job.Services.Report // tm1 == null ? 0 : tm1.Qty // ); - - - if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } @@ -114,16 +103,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(purchaseOrderNo)) { var _groupList = purchaseOrderNo.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.采购订单号)).ToList(); } } - - - - // _outputService.Export(id, fileName, _ls); //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 var _checkList = _erpdapperRepository.GetErrorBillList(); @@ -136,7 +121,6 @@ namespace SettleAccount.Job.Services.Report select itm; _ls = query.ToList(); - ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_ls.ToList(), "大众备件明细数据") .SeparateBySheet() @@ -151,10 +135,8 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(fileName, result.Result, true); - return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs index 1dbeabdf..23d5116d 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettleUnSparePartExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -25,7 +23,6 @@ namespace SettleAccount.Job.Services.Report private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; - public SettleUnSparePartExportService(SettleSparePartDapperReportRepository dapper, ISettleAccountBranchEfCoreRepository errorListRepository, ErpPartDapperRepository erpdapperRepository, OutputService outputService @@ -40,7 +37,6 @@ namespace SettleAccount.Job.Services.Report _errorListRepository = errorListRepository; } - public string ExportFile(Guid id, List exportName, List p_list) { var fileName = exportName.FirstOrDefault(); @@ -52,7 +48,6 @@ namespace SettleAccount.Job.Services.Report var endTime = p_list.Where(p => p.Name == "EndTime").FirstOrDefault().Value; //var iscontionversion = p_list.Where(p => p.Name == "IsContainVersion").FirstOrDefault().Value; - //反向对比,即大众备件未结(有单号),包含有发货有结算并且发货数量大于结算数量的数据也整合到未结中 var _reversels_withcode = _dapper.GetReverseWithCodeSettleSparePartReportList_unsettle(purchaseOrderNo, version, sapCode, matialCode, beginTime, endTime); @@ -66,7 +61,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _reversels_withcode = _reversels_withcode.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } @@ -82,7 +77,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(purchaseOrderNo)) { var _groupList = purchaseOrderNo.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _reversels_withcode = _reversels_withcode.Where(p => _groupList.Contains(p.采购订单号)).ToList(); } @@ -101,18 +96,16 @@ namespace SettleAccount.Job.Services.Report ExcelExporter _exporter = new ExcelExporter();//导出Excel var result = _exporter.Append(_reversels_withcode.ToList(), "大众备件未结明细") - // .SeparateBySheet() - //.Append(queryStockList_nocode.ToList(), "大众备件无单号汇总") + // .SeparateBySheet() + //.Append(queryStockList_nocode.ToList(), "大众备件无单号汇总") // .SeparateBySheet() //.Append(queryStockList.ToList(), "零件汇总比对寄售库存") .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(fileName, result.Result, true); - return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettledPartAndErpPartPriceDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettledPartAndErpPartPriceDiffExportService.cs index 1b8618a5..1559f6ae 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettledPartAndErpPartPriceDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SettledPartAndErpPartPriceDiffExportService.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -14,7 +12,7 @@ using Win.Sfs.SettleAccount.Repository.Report; namespace SettleAccount.Job.Services.Report { - public class SettledPartAndErpPartPriceDiffExportService: ITransientDependency, IExportJob + public class SettledPartAndErpPartPriceDiffExportService : ITransientDependency, IExportJob { private readonly SettledPartAndErpPartPriceDiffRepository _dapper; @@ -31,7 +29,6 @@ namespace SettleAccount.Job.Services.Report _fileContainer = fileContainer; } - public string ExportFile(Guid id, List exportName, List p_list) { //var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value; @@ -44,15 +41,11 @@ namespace SettleAccount.Job.Services.Report var result = _exporter .SeparateBySheet() .SeparateBySheet() - + .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - - - //_outputService.Export(id,string.Format("Bom定价对比_{0}.xlsx",Guid.NewGuid().ToString()), _list); return id.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs index 1a97aec5..382adbdd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SharePartUnSettledExport.cs @@ -1,10 +1,8 @@ -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -18,7 +16,7 @@ namespace SettleAccount.Job.Services.Report { private readonly OutputService _outputService; - SharePartUnSettledDapperRepository _dapper; + readonly SharePartUnSettledDapperRepository _dapper; private readonly IBlobContainer _fileContainer; public SharePartUnSettledExport(SharePartUnSettledDapperRepository dapper, OutputService outputService, @@ -46,20 +44,20 @@ namespace SettleAccount.Job.Services.Report var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - var _ls = _dapper.GetOrderSharePartReportList(version, begin,end); + var _ls = _dapper.GetOrderSharePartReportList(version, begin, end); var _lst = _dapper.GetNoOrderSharePartReportList(version, begin, end); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterilGroup)).ToList(); } - } + } if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -67,7 +65,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SAPCode)).ToList(); } @@ -75,7 +73,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _lst = _lst.Where(p => _groupList.Contains(p.MaterilGroup)).ToList(); } @@ -83,7 +81,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _lst = _lst.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -91,7 +89,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _lst = _lst.Where(p => _groupList.Contains(p.SAPCode)).ToList(); } @@ -104,8 +102,6 @@ namespace SettleAccount.Job.Services.Report result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); - - return id.ToString(); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs index 1450bfc3..e6d97369 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/SyncFisService.cs @@ -1,24 +1,16 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; 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; -using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report { - public class SyncFisService : ITransientDependency, IExportJob { @@ -56,19 +48,14 @@ namespace SettleAccount.Job.Services.Report { return id.ToString(); - } - - - - [UnitOfWork(false)] public List GetFisSum(Guid id, List exportName, List p_list) { var _first = exportName.FirstOrDefault(); var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; - + var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; //var sapcode = p_list.Where(p => p.Name == "SapMaterialCode").FirstOrDefault().Value; @@ -79,7 +66,7 @@ namespace SettleAccount.Job.Services.Report //var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value; //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value; - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; @@ -98,12 +85,10 @@ namespace SettleAccount.Job.Services.Report _list.AddRange(_lst); _list = _list.Where(p => p.SapMaterialCode == p.ParentSapMaterialCode).ToList(); - - if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -135,12 +120,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materailCode)) { var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - var _fislist =_list.GroupBy(p => new { p.SapMaterialCode, p.MaterialDesc, p.MaterialGroup, p.MaterialCode }) + var _fislist = _list.GroupBy(p => new { p.SapMaterialCode, p.MaterialDesc, p.MaterialGroup, p.MaterialCode }) .Select(p => new UnSettledSum { 库位 = "PLJS", @@ -174,9 +159,6 @@ namespace SettleAccount.Job.Services.Report //var iscontionversion = p_list.Where(p => p.Name == "IsContainVersion").FirstOrDefault().Value; var iscontionversion = "1";//不分版本,全查 - - - //var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; //var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; //var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; @@ -187,13 +169,12 @@ namespace SettleAccount.Job.Services.Report //var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value; //var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; //var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; var _ls = _kanbanDapper.GetKanbanReportList(version, begin, datetime, iscontionversion); - //if (!string.IsNullOrEmpty(sapCode)) //{ // var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); @@ -206,7 +187,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materailCode)) { var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); } @@ -214,7 +195,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -231,7 +212,6 @@ namespace SettleAccount.Job.Services.Report select itm; _ls = query.ToList(); - //DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode }) .Select(p => new UnSettledSum @@ -246,12 +226,9 @@ namespace SettleAccount.Job.Services.Report }).ToList(); - - return kanbanList; } - /// /// 红旗看板未结明细 /// @@ -275,7 +252,7 @@ namespace SettleAccount.Job.Services.Report var iscontionversion = "1";//不分区间,全查 //有发货无结算,单独拿出去,财务要求 - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; @@ -283,7 +260,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } @@ -303,8 +280,8 @@ namespace SettleAccount.Job.Services.Report var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p.零件中文名称, p.物料组, p.客户物料号 }) .Select(p => new UnSettledSum { - 库位="PLJS", - 版本=version, + 库位 = "PLJS", + 版本 = version, 物料号 = p.Key.Sap编码, //客户物料 = p.Key.客户物料号, 物料描述 = p.Key.零件中文名称, @@ -333,7 +310,7 @@ namespace SettleAccount.Job.Services.Report var beginTime = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value; var endTime = p_list.Where(p => p.Name == "End").FirstOrDefault().Value; - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; @@ -342,13 +319,12 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } } - //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 var _checkList = _erpdapperRepository.GetErrorBillList(); @@ -361,8 +337,6 @@ namespace SettleAccount.Job.Services.Report _ls = query.ToList(); - - //说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p.物料描述, p.物料代码 }) .Select(p => new UnSettledSum @@ -373,12 +347,12 @@ namespace SettleAccount.Job.Services.Report //客户物料 = p.Key.物料代码, 物料描述 = p.Key.物料描述, 物料组车型 = string.Empty, - SAS未结明细汇总 = p.Sum(p =>Convert.ToDecimal(p.实际发货数量)).ToString() + SAS未结明细汇总 = p.Sum(p => Convert.ToDecimal(p.实际发货数量)).ToString() }).ToList(); return kanbanList; } - } } +} diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs index cba5f713..7875a2e4 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnInvoiceSettledDetailDiffExportService.cs @@ -1,21 +1,15 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount; -using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services @@ -24,7 +18,7 @@ namespace SettleAccount.Job.Services public class UnInvoiceSettledDetailSum { [ExporterHeader(DisplayName = "物料组车型")] - public string MaterialGroup { set; get;} + public string MaterialGroup { set; get; } [ExporterHeader(DisplayName = "SAP编码")] public string SapMaterailCode { set; get; } [ExporterHeader(DisplayName = "零件号")] @@ -45,12 +39,11 @@ namespace SettleAccount.Job.Services /// public class UnInvoiceSettledDetailDiffExportService : ITransientDependency, IExportJob { - + private readonly UnInvoiceSettledDetailDiffDapperRepository _dapperRepository; private readonly InvoiceSettledDetailDiffDapperRepository _dapperRepository1; private readonly UnSettledDetailDapperRepository _dapperRepository2; - private readonly ErpPartDapperRepository _erpdapperRepository; private readonly IBlobContainer _fileContainer; @@ -67,19 +60,19 @@ namespace SettleAccount.Job.Services InputService inputService, UnSettledDetailDapperRepository dapperRepository2 - //ISettleAccountBranchEfCoreRepository errorListRepository + //ISettleAccountBranchEfCoreRepository errorListRepository ) { _fileContainer = fileContainer; _inputService = inputService; _outputService = outputService; - _erpdapperRepository= erpdapperRepository; + _erpdapperRepository = erpdapperRepository; //_repository = repository; //_versionRepository = versionRepository; - _dapperRepository =dapperRepository; + _dapperRepository = dapperRepository; _dapperRepository1 = dapperRepository1; _dapperRepository2 = dapperRepository2; - // _errorListRepository = errorListRepository; + // _errorListRepository = errorListRepository; } public string ExportFile(Guid id, List exportName, List p_list) @@ -97,23 +90,20 @@ namespace SettleAccount.Job.Services var _filename = exportName.FirstOrDefault(); // customConditionList.Add(new CustomCondition() { Name = "MaterialGroup", Value = string.IsNullOrEmpty(materialGroup) ? string.Empty : materialGroup }); - - var _ls = _dapperRepository.GetDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber,materialGroup); + var _ls = _dapperRepository.GetDetailDiffReportList(version, materialCode, begin, end, cp7begin, cp7end, kenncode, chassisNumber, materialGroup); var diffList = _erpdapperRepository.GetSettleInvoiceDiff(version); foreach (var itm in _ls) { - itm.InvoiceAmt =Math.Round( itm.InvoiceQty * itm.InvoicePrice,2); + itm.InvoiceAmt = Math.Round(itm.InvoiceQty * itm.InvoicePrice, 2); itm.DiffPrice = itm.Price - itm.InvoicePrice; itm.DiffSettleFisQty = itm.SettledQty; } - _ls=_ls.OrderBy(p => p.ChassisNumber).ThenBy(p=>p.KENNCode).ThenBy(p=>p.SapMaterialCode).ToList(); - - + _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList(); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -121,7 +111,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -129,7 +119,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -137,7 +127,7 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -145,13 +135,12 @@ namespace SettleAccount.Job.Services if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } } - var _checkList = _erpdapperRepository.GetErrorBillList(); var query = from itm in _ls @@ -161,46 +150,39 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms where tm1 == null select itm; + _ls = query.ToList(); - _ls=query.ToList(); - - - - var _lsSum=_ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup,p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum + var _lsSum = _ls.GroupBy(p => new { p.MaterialCode, p.SapMaterialCode, p.MaterialGroup, p.InvoicePrice }).Select(p => new UnInvoiceSettledDetailSum { MaterialCode = p.Key.MaterialCode, SapMaterailCode = p.Key.SapMaterialCode, MaterialGroup = p.Key.MaterialGroup, SettleQty = p.Sum(itm => itm.SettledQty), - FisQty=0, - DiffQty=- p.Sum(itm => itm.SettledQty), - Price=p.Key.InvoicePrice, - DiffAmt= p.Sum(itm => itm.SettledQty)* p.Key.InvoicePrice + FisQty = 0, + DiffQty = -p.Sum(itm => itm.SettledQty), + Price = p.Key.InvoicePrice, + DiffAmt = p.Sum(itm => itm.SettledQty) * p.Key.InvoicePrice }).ToList(); - var _sumTotal= new UnInvoiceSettledDetailSum() { + var _sumTotal = new UnInvoiceSettledDetailSum() + { SettleQty = _lsSum.Sum(p => p.SettleQty), DiffQty = _lsSum.Sum(p => p.DiffQty), Price = _lsSum.Sum(p => p.Price), - DiffAmt=_lsSum.Sum(p=>p.DiffAmt) - + DiffAmt = _lsSum.Sum(p => p.DiffAmt) }; _lsSum.Add(_sumTotal); - - - var _ls1=DiffPrice(id,exportName,p_list); + var _ls1 = DiffPrice(id, exportName, p_list); var report1List = _ls1.Where(p => p.DiffPrice != 0).GroupBy(p => new { p.MaterialGroup, p.MaterialCode, p.MaterialDesc, p.Price, p.InvoicePrice, p.DiffPrice, p.SapMaterialCode }) .Select(t => new SettleDoorPanelExport { MaterialGroup = t.FirstOrDefault().MaterialGroup, MaterialCode = t.FirstOrDefault().MaterialCode, MaterialDesc = t.FirstOrDefault().MaterialDesc, Price = t.FirstOrDefault().Price, InvoicePrice = t.FirstOrDefault().InvoicePrice, InvoiceDiffPrice = t.FirstOrDefault().DiffPrice, SAPCode = t.FirstOrDefault().SapMaterialCode }).ToList(); - - var report2List = _ls1.Where(p => p.DiffPrice != 0).Select(p => new { p.MaterialGroup, DiffAmt = p.DiffPrice * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); - var list1= LSettleSum(id, exportName, p_list); + var list1 = LSettleSum(id, exportName, p_list); var report1 = report2List.ToList(); @@ -221,7 +203,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms .Append(report1List, "按物料价格差异明细表") .SeparateBySheet() .Append(report1, "差异汇总验证表") - .ExportAppendDataAsByteArray(); + .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_filename, result.Result, true); @@ -283,7 +265,6 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms }; rangeList = rangList.ToList(); - foreach (var itm in diffList) { var _first = _ls.FirstOrDefault(p => p.MaterialCode == itm.MaterialCode); @@ -300,15 +281,14 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms itm.DiffPrice = itm.Price - itm.InvoicePrice; } - _ls.AddRange(rangeList); - _ls=_ls.Where(p => p.ParentSapMaterialCode == p.SapMaterialCode).ToList(); + _ls = _ls.Where(p => p.ParentSapMaterialCode == p.SapMaterialCode).ToList(); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -316,7 +296,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split("\n").ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -324,7 +304,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split("\n").ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -332,7 +312,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -340,13 +320,12 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - //var _checkList = _errorListRepository.ToList(); //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 var _checkList = _erpdapperRepository.GetErrorBillList(); @@ -358,12 +337,8 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms where tm1 == null select itm; - _ls = query.ToList(); - - - //.Select(p => p.FirstOrDefault()); _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.KENNCode).ThenBy(p => p.SapMaterialCode).ToList(); @@ -385,22 +360,21 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value; //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value; - begin = version.Substring(0, 4) + "-" + version.Substring(version.Length - 2) + "-01 00:00:00"; - var _beginstr = version.Substring(0, 4) + "-" + version.Substring(version.Length - 2) + "-01"; + begin = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(version.Length - 2), "-01 00:00:00"); + var _beginstr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(version.Length - 2), "-01"); var _end = DateTime.Parse(_beginstr).AddMonths(1).AddDays(-1); - end=_end.ToString("yyyy-MM-dd")+" 23:59:59"; + end = _end.ToString("yyyy-MM-dd") + " 23:59:59"; - var _list = _dapperRepository2.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, "", version,"", materialGroup, sapCode); + var _list = _dapperRepository2.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, "", version, "", materialGroup, sapCode); var _ls = _list.Where(p => p.Flag == "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); - + if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -408,7 +382,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -416,7 +390,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -424,7 +398,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -441,19 +415,13 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms where tm1 == null select itm; - _list = query.ToList(); - - - - _list = _list.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ThenBy(p => p.Flag).ToList(); - var report2List = _ls.Where(p=>p.UnSettleVersion==version).Select(p => new { p.MaterialGroup, DiffAmt = p.Price * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); + var report2List = _ls.Where(p => p.UnSettleVersion == version).Select(p => new { p.MaterialGroup, DiffAmt = p.Price * p.Qty }).GroupBy(p => new { p.MaterialGroup }).Select(p => new SettleDoorPanelSumExport { MaterialGroup = p.Key.MaterialGroup, InvoiceDiffPrice = p.Sum(itm => itm.DiffAmt), Version = version }); return report2List.ToList(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs index 79dd2355..ede0ebf5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettleDiffExportService.cs @@ -1,11 +1,9 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; @@ -20,9 +18,7 @@ namespace SettleAccount.Job.Services.Report { public class SumSettleDiffList { - // 物料组车型 SAP编码 零件号 结算数量 M100数量 差异总数 开票单价 差异金额 - - + // 物料组车型 SAP编码 零件号 结算数量 M100数量 差异总数 开票单价 差异金额 [ExporterHeader(DisplayName = "SAP编码")] public string SapMaterialCode { set; get; } @@ -42,9 +38,6 @@ namespace SettleAccount.Job.Services.Report public decimal DiffAmt { set; get; } } - - - public class UnSettleDiffExportService : ITransientDependency, IExportJob { private readonly UnSettledDetailDapperRepository _dapper2; @@ -53,7 +46,7 @@ namespace SettleAccount.Job.Services.Report private readonly ErpPartDapperRepository _erpdapperRepository; private readonly UnSettledDetailDapperRepository _dapper1; private readonly IBlobContainer _fileContainer; - // private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; + // private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; public UnSettleDiffExportService(UnSettleDiffDapperRepository dapper, OutputService outputService, UnSettledDetailDapperRepository dapper1, ErpPartDapperRepository erpdapperRepository, @@ -68,12 +61,12 @@ namespace SettleAccount.Job.Services.Report _dapper1 = dapper1; _fileContainer = fileContainer; _dapper2 = dapper2; - // _errorListRepository = errorListRepository; + // _errorListRepository = errorListRepository; } public string ExportFile(Guid id, List exportName, List p_list) { - + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; @@ -85,23 +78,19 @@ namespace SettleAccount.Job.Services.Report var _first = exportName.FirstOrDefault(); var _ls = new List(); - _ls = _dapper.GetDiffReport1(0,begin,end, materialCode,kenncode,chassisNumber,version); + _ls = _dapper.GetDiffReport1(0, begin, end, materialCode, kenncode, chassisNumber, version); var _checkList = _erpdapperRepository.GetErrorBillList(); var q = from itm in _ls - join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } + join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 - from tm1 in temp1.DefaultIfEmpty() - where tm1 == null - select itm; + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; _ls = q.ToList(); - - - - //foreach (var itm in _ls) //{ // if (itm.KENNCode.Length > 8) @@ -112,16 +101,13 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC // } //} - - var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode && !string.IsNullOrEmpty(p.ParentSapMaterialCode)).Where(p => !p.ParentSapMaterialCode.Contains(",")).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }) + var _list = _ls.Where(p => p.ParentSapMaterialCode != p.SapMaterialCode && !string.IsNullOrEmpty(p.ParentSapMaterialCode)).Where(p => !p.ParentSapMaterialCode.Contains(',')).GroupBy(p => new { p.ParentSapMaterialCode, p.ChassisNumber, p.KENNCode }) .Select(p => p.FirstOrDefault()).ToList(); - var _compareLs=_list.Where(p => p.DiffQty == 0).Select(p=> new { p.ChassisNumber,p.KENNCode,p.ParentSapMaterialCode }); - + var _compareLs = _list.Where(p => p.DiffQty == 0).Select(p => new { p.ChassisNumber, p.KENNCode, p.ParentSapMaterialCode }); var rangeList = _erpdapperRepository.GetSapList(_list, version, false); - var query = from itm1 in rangeList join itm2 in _compareLs on new { itm1.ParentSapMaterialCode, itm1.KENNCode, itm1.ChassisNumber } equals @@ -144,21 +130,19 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC Price = itm1.Price, Amt = itm1.Amt, Qty = 1, - UNSettleQty = tm1!=null ? 1 : 0, - DiffQty = tm1!=null ? 0 : -1, - DiffAmt = tm1!=null ? 0 : Math.Round(itm1.Qty * itm1.Price) + UNSettleQty = tm1 != null ? 1 : 0, + DiffQty = tm1 != null ? 0 : -1, + DiffAmt = tm1 != null ? 0 : Math.Round(itm1.Qty * itm1.Price) }; rangeList = query.ToList(); - - _ls.AddRange(rangeList); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -166,7 +150,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -174,7 +158,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -182,7 +166,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -190,7 +174,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialCode)).ToList(); } @@ -200,51 +184,44 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC List _lsExport = new List(); - - _ls = _ls.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ToList(); - - - - var _lsSum= _ls.GroupBy(p => new { p.SapMaterialCode, p.MaterialCode, p.MaterialDesc, p.MaterialGroup }) - .Select(p => - new SumSettleDiffList - { - SapMaterialCode = p.Key.SapMaterialCode, - MaterialCode = p.Key.MaterialCode, - MaterialDesc = p.Key.MaterialDesc, - MaterialGroup = p.Key.MaterialGroup, - Qty = p.Sum(p => p.Qty), - UnSettleQty = p.Sum(p => p.UNSettleQty), - DiffQty = p.Sum(p => p.DiffQty), - DiffAmt=p.Sum(p=>p.DiffAmt) - }) ; - - var _ls1= ExportList(p_list); - - var _lsSum1= _ls1.GroupBy(p => new { p.SapMaterialCode, p.MaterialCode, p.MaterialDesc, p.MaterialGroup }) - .Select(p => - new SumSettleDiffList - { - SapMaterialCode = p.Key.SapMaterialCode, - MaterialCode = p.Key.MaterialCode, - MaterialDesc = p.Key.MaterialDesc, - MaterialGroup = p.Key.MaterialGroup, - Qty = p.Sum(p => p.Qty), - UnSettleQty = p.Sum(p => p.UnSettleQty), - DiffQty = p.Sum(p => p.DiffQty), - DiffAmt = p.Sum(p => p.DiffAMT) - }); - - - - if (_ls1.Count() > 900000) + var _lsSum = _ls.GroupBy(p => new { p.SapMaterialCode, p.MaterialCode, p.MaterialDesc, p.MaterialGroup }) + .Select(p => + new SumSettleDiffList + { + SapMaterialCode = p.Key.SapMaterialCode, + MaterialCode = p.Key.MaterialCode, + MaterialDesc = p.Key.MaterialDesc, + MaterialGroup = p.Key.MaterialGroup, + Qty = p.Sum(p => p.Qty), + UnSettleQty = p.Sum(p => p.UNSettleQty), + DiffQty = p.Sum(p => p.DiffQty), + DiffAmt = p.Sum(p => p.DiffAmt) + }); + + var _ls1 = ExportList(p_list); + + var _lsSum1 = _ls1.GroupBy(p => new { p.SapMaterialCode, p.MaterialCode, p.MaterialDesc, p.MaterialGroup }) + .Select(p => + new SumSettleDiffList + { + SapMaterialCode = p.Key.SapMaterialCode, + MaterialCode = p.Key.MaterialCode, + MaterialDesc = p.Key.MaterialDesc, + MaterialGroup = p.Key.MaterialGroup, + Qty = p.Sum(p => p.Qty), + UnSettleQty = p.Sum(p => p.UnSettleQty), + DiffQty = p.Sum(p => p.DiffQty), + DiffAmt = p.Sum(p => p.DiffAMT) + }); + + if (_ls1.Count > 900000) { - if (_ls1.Count() > 2700000) + if (_ls1.Count > 2700000) { var _lsSheet1 = _ls1.Skip(0 * 900000).Take(900000); - var _lsSheet2 = _ls1.Skip(1* 900000).Take(900000); + var _lsSheet2 = _ls1.Skip(1 * 900000).Take(900000); var _lsSheet3 = _ls1.Skip(2 * 900000).Take(900000); var _lsSheet4 = _ls1.Skip(3 * 900000).Take(900000); ExcelExporter _exporter = new ExcelExporter();//导出Excel @@ -268,7 +245,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC } else { - if (_ls1.Count() > 18000000) + if (_ls1.Count > 18000000) { var _lsSheet1 = _ls1.Skip(0 * 900000).Take(900000); var _lsSheet2 = _ls1.Skip(1 * 900000).Take(900000); @@ -301,14 +278,13 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC .SeparateBySheet() .Append(_lsSheet2.ToList(), "系统未结对比R3大众未结(第2页)") .SeparateBySheet() - .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") + .Append(_lsSum.ToList(), "大众R3未结对比结算系统差异汇总") .SeparateBySheet() - .Append(_lsSum1.ToList(), "结算系统对比大众R3未结差异汇总") + .Append(_lsSum1.ToList(), "结算系统对比大众R3未结差异汇总") .ExportAppendDataAsByteArray(); result.ShouldNotBeNull(); _fileContainer.SaveAsync(_first, result.Result, true); - } } } @@ -329,13 +305,12 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC } - return id.ToString(); } - public List ExportList( List p_list) + public List ExportList(List p_list) { - + var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; var begin = p_list.Where(p => p.Name == "BeginTime").FirstOrDefault().Value; @@ -348,19 +323,17 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value; var _list = _dapper1.GetDiffReport1(DateTime.Now.Year.ToString(), begin, end, string.Empty, version, materialCode, materialGroup, sapCode); - - var _checkList = _erpdapperRepository.GetErrorBillList(); - var q= from itm in _list - join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } + var q = from itm in _list + join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 - from tm1 in temp1.DefaultIfEmpty() - where tm1 == null - select itm; + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; _list = q.ToList(); - var _ls = _list.Where(p => p.Flag != "L" ).Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).Where(p => !p.ParentSapMaterialCode.Contains(",")).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).Where(p => !p.ParentSapMaterialCode.Contains(',')).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); var _compareLs = _ls.Where(p => p.DiffQty == 0).Select(p => new { p.ChassisNumber, p.KENNCode, p.ParentSapMaterialCode }); var rangeList = _erpdapperRepository.GetSapList(_ls, version, false); var query = from itm1 in rangeList @@ -392,12 +365,11 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC rangeList = query.ToList(); - _list.AddRange(rangeList); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -405,7 +377,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -413,7 +385,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -421,17 +393,14 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } _list = _list.OrderBy(p => p.ChassisNumber).ThenBy(p => p.SapMaterialCode).ThenBy(p => p.Flag).ToList(); - - return _list; - } public List LJ(Guid id, List exportName, List p_list) @@ -448,11 +417,9 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value; //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value; - var _list = _dapper2.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version, materailCode, materialGroup, sapcode); var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode) .GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }) @@ -470,7 +437,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -478,7 +445,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -486,7 +453,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -494,7 +461,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -502,7 +469,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(materailCode)) { var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -514,10 +481,5 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC } - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledExportService.cs index 3d5d1fea..71750ebe 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledExportService.cs @@ -1,19 +1,15 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Entities.FISes; using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; -using Win.Sfs.Shared.Enums.SettleAccount; namespace SettleAccount.Job.Services.Report { - public class UnSettledExportService:ITransientDependency, IExportJob + public class UnSettledExportService : ITransientDependency, IExportJob { private readonly UnSettledDapperReportRepository _dapper; private readonly OutputService _outputService; @@ -24,14 +20,6 @@ namespace SettleAccount.Job.Services.Report _outputService = outputService; } - - - - - - - - public string ExportFile(Guid id, List exportName, List p_list) { var year = p_list.Where(p => p.Name == "Year").FirstOrDefault().Value; @@ -46,15 +34,11 @@ namespace SettleAccount.Job.Services.Report _ls = _dapper.GetUnSettledReportList(state, version, year, beginTime, endTime); var _id = Guid.NewGuid(); - - - List _lsExport = new List(); foreach (var itm in _ls) { - - var dto= new FISExportDto() + var dto = new FISExportDto() { ChassisNumber = itm.ChassisNumber, ChassisNumber2 = itm.ChassisNumber2, @@ -70,7 +54,7 @@ namespace SettleAccount.Job.Services.Report //State = itm.State, Qty = itm.Qty, Version = itm.Version, - + }; switch (itm.SettleState) @@ -86,16 +70,11 @@ namespace SettleAccount.Job.Services.Report break; } - - - - _lsExport.Add(dto); } _outputService.Export(id, _first, _lsExport); return id.ToString(); } - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs index b2ae4c81..d65abb62 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnSettledSumService.cs @@ -1,19 +1,12 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; 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; -using Win.Sfs.SettleAccount.Errors; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report @@ -24,27 +17,27 @@ namespace SettleAccount.Job.Services.Report public string 版本 { set; get; } [ExporterHeader(DisplayName = "库位 ")] - public string 库位 {set;get;} + public string 库位 { set; get; } [ExporterHeader(DisplayName = "物料组编码 ")] - public string 物料组编码 {set;get;} + public string 物料组编码 { set; get; } [ExporterHeader(DisplayName = "物料组车型")] - public string 物料组车型 {set;get;} + public string 物料组车型 { set; get; } [ExporterHeader(DisplayName = "物料号")] - public string 物料号 {set;get;} + public string 物料号 { set; get; } [ExporterHeader(DisplayName = "物料描述")] - public string 物料描述 {set;get;} + public string 物料描述 { set; get; } //[ExporterHeader(DisplayName = "客户物料")] //public string 客户物料 {set;get;} [ExporterHeader(DisplayName = "WMS期初库存")] - public string WMS期初库存 {set;get;} + public string WMS期初库存 { set; get; } [ExporterHeader(DisplayName = "本月增加")] - public string 本月增加 {set;get;} + public string 本月增加 { set; get; } [ExporterHeader(DisplayName = "本月减少")] - public string 本月减少 {set;get;} + public string 本月减少 { set; get; } [ExporterHeader(DisplayName = "WMS期末库存")] - public string WMS期末库存 {set;get;} + public string WMS期末库存 { set; get; } [ExporterHeader(DisplayName = "SAS未结明细汇总")] - public string SAS未结明细汇总 {set;get;} + public string SAS未结明细汇总 { set; get; } [ExporterHeader(DisplayName = "差异")] public string 差异 { set; get; } } @@ -67,7 +60,7 @@ namespace SettleAccount.Job.Services.Report ErpPartDapperRepository erpDapper, SettleSparePartDapperReportRepository sparepartdapper, IBlobContainer fileContainer - + ) { _hqkanbanDapper = hqkanbanDapper; @@ -77,32 +70,32 @@ namespace SettleAccount.Job.Services.Report _erpDapper = erpDapper; _sparepartdapper = sparepartdapper; _fileContainer = fileContainer; - + } [UnitOfWork(false)] public List GetFisSum(Guid id, List exportName, List p_list) { var _first = exportName.FirstOrDefault(); var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; - + var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; - + var begin = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value; var end = p_list.Where(p => p.Name == "End").FirstOrDefault().Value; - - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; var _list = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), begin, datetime, "", version, materailCode, materialGroup, ""); var _checkList = _erpDapper.GetErrorBillList(); var q = from itm in _list - join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } + join itm1 in _checkList on new { ChassisNumber = itm.ChassisNumber, MaterialCode = itm.MaterialCode, WmsBillNum = itm.WmsBillNum } equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, WmsBillNum = itm1.WmsBillNum } into temp1 - from tm1 in temp1.DefaultIfEmpty() - where tm1 == null - select itm; + from tm1 in temp1.DefaultIfEmpty() + where tm1 == null + select itm; _list = q.ToList(); var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); @@ -119,12 +112,10 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms _list.AddRange(_lst); _list = _list.Where(p => p.SapMaterialCode == p.ParentSapMaterialCode).ToList(); - - if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -156,18 +147,13 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(materailCode)) { var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - - - - - - var _fislist =_list.GroupBy(p => new { p.SapMaterialCode, p.MaterialDesc, p.MaterialGroup, p.MaterialCode }) + var _fislist = _list.GroupBy(p => new { p.SapMaterialCode, p.MaterialDesc, p.MaterialGroup, p.MaterialCode }) .Select(p => new UnSettledSum { 库位 = "PLJS", @@ -201,9 +187,6 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms //var iscontionversion = p_list.Where(p => p.Name == "IsContainVersion").FirstOrDefault().Value; var iscontionversion = "1";//不分版本,全查 - - - //var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; //var customerCode = p_list.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; //var materailCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; @@ -214,13 +197,12 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms //var kenncode = p_list.Where(p => p.Name == "KennCode").FirstOrDefault().Value; //var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; //var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; var _ls = _kanbanDapper.GetKanbanReportList(version, begin, datetime, iscontionversion); - //if (!string.IsNullOrEmpty(sapCode)) //{ // var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); @@ -233,7 +215,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(materailCode)) { var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.CustomerPartCode)).ToList(); } @@ -241,7 +223,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -258,7 +240,6 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms select itm; _ls = query.ToList(); - //DiffQty 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SapCode, p.MaterialDesc, p.MaterialGroup, p.CustomerPartCode }) .Select(p => new UnSettledSum @@ -273,12 +254,9 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms }).ToList(); - - return kanbanList; } - /// /// 红旗看板未结明细 /// @@ -302,7 +280,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms var iscontionversion = "1";//不分区间,全查 //有发货无结算,单独拿出去,财务要求 - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; @@ -310,7 +288,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.Sap编码)).ToList(); } @@ -330,8 +308,8 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms var kanbanList = _ls.GroupBy(p => new { p.Sap编码, p.零件中文名称, p.物料组, p.客户物料号 }) .Select(p => new UnSettledSum { - 库位="PLJS", - 版本=version, + 库位 = "PLJS", + 版本 = version, 物料号 = p.Key.Sap编码, //客户物料 = p.Key.客户物料号, 物料描述 = p.Key.零件中文名称, @@ -360,7 +338,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms var beginTime = p_list.Where(p => p.Name == "Begin").FirstOrDefault().Value; var endTime = p_list.Where(p => p.Name == "End").FirstOrDefault().Value; - var datestr = version.Substring(0, 4) + "-" + version.Substring(4, 2) + "-01"; + var datestr = string.Concat(version.AsSpan(0, 4), "-", version.AsSpan(4, 2), "-01"); var date = DateTime.Parse(datestr).AddMonths(1).AddDays(-1); var datetime = date.ToShortDateString() + " 23:59:59 "; @@ -369,13 +347,12 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.SAP编码)).ToList(); } } - //应用屏蔽错误信息功能,将其屏蔽的信息从生成的列表中排除掉,20220629 var _checkList = _erpDapper.GetErrorBillList(); @@ -387,7 +364,6 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms select itm; _ls = query.ToList(); - //说明 为实际发货数量=发货数量-结算数量-退货数量 财务要求 var kanbanList = _ls.GroupBy(p => new { p.SAP编码, p.物料描述, p.物料代码 }) .Select(p => new UnSettledSum @@ -398,17 +374,12 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.MaterialCode, Wms //客户物料 = p.Key.物料代码, 物料描述 = p.Key.物料描述, 物料组车型 = string.Empty, - SAS未结明细汇总 = p.Sum(p =>Convert.ToDecimal(p.实际发货数量)).ToString() + SAS未结明细汇总 = p.Sum(p => Convert.ToDecimal(p.实际发货数量)).ToString() }).ToList(); return kanbanList; } - - - - - } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs index 7d030e20..b74e13cd 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/UnsettledDetailReport.cs @@ -1,17 +1,11 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.UnSettle; -using Win.Sfs.SettleAccount.Errors; -using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto; namespace SettleAccount.Job.Services.Report { @@ -21,20 +15,18 @@ namespace SettleAccount.Job.Services.Report private readonly OutputService _outputService; private readonly ErpPartDapperRepository _erpDapper; - private readonly ISettleAccountBranchEfCoreRepository _errorListRepository; public UnsettledDetailReportService( UnSettledDetailDapperRepository dapper, OutputService outputService, ErpPartDapperRepository erpDapper - + ) { _dapper = dapper; _outputService = outputService; _erpDapper = erpDapper; - - } + } public string ExportFile(Guid id, List exportName, List p_list) { @@ -50,12 +42,10 @@ namespace SettleAccount.Job.Services.Report var chassisNumber = p_list.Where(p => p.Name == "ChassisNumber").FirstOrDefault().Value; var sapCode = p_list.Where(p => p.Name == "SapCode").FirstOrDefault().Value; - //var cp7begin = p_list.Where(p => p.Name == "CP7Begin").FirstOrDefault().Value; //var cp7end = p_list.Where(p => p.Name == "CP7End").FirstOrDefault().Value; - - var _list = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version,materailCode,materialGroup,sapcode); + var _list = _dapper.GetDiffReport(DateTime.Now.Year.ToString(), begin, end, customerCode, version, materailCode, materialGroup, sapcode); var _checkList = _erpDapper.GetErrorBillList(); @@ -66,17 +56,15 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC where tm1 == null select itm; - _list = query.ToList(); - - + _list = query.ToList(); - var _ls = _list.Where(p => p.Flag != "L" ).Where(p=>p.ParentSapMaterialCode!=p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); - var _lst= _erpDapper.GetSapList(_ls, version, false); + var _ls = _list.Where(p => p.Flag != "L").Where(p => p.ParentSapMaterialCode != p.SapMaterialCode).GroupBy(p => new { p.KENNCode, p.ChassisNumber, p.ParentSapMaterialCode }).Select(p => p.FirstOrDefault()).ToList(); + var _lst = _erpDapper.GetSapList(_ls, version, false); _lst.ForEach(p => { - + p.Qty = 1; - p.DiffAMT =Math.Round( p.Qty * p.Price,2); + p.DiffAMT = Math.Round(p.Qty * p.Price, 2); p.DiffQty = 1; } ); @@ -84,7 +72,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.MaterialGroup)).ToList(); } @@ -92,7 +80,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(kenncode)) { var _groupList = kenncode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.KENNCode)).ToList(); } @@ -100,7 +88,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(chassisNumber)) { var _groupList = chassisNumber.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.ChassisNumber)).ToList(); } @@ -108,7 +96,7 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(sapCode)) { var _groupList = sapCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } @@ -116,16 +104,12 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC if (!string.IsNullOrEmpty(materailCode)) { var _groupList = materailCode.Split(new char[] { '\n' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _list = _list.Where(p => _groupList.Contains(p.SapMaterialCode)).ToList(); } } - - - - // var removeList= _dapper.GetRemoveDetail(); // var _query= from itm in _list @@ -135,8 +119,6 @@ equals new { ChassisNumber = itm1.BillNum, MaterialCode = itm1.CustomerMaterialC // where tm1 == null // select itm; - - _list = _list.OrderBy(p => p.SapMaterialCode).ThenBy(p => p.ChassisNumber).ThenBy(p => p.Flag).ToList(); _outputService.Export(id, _first, _list); return id.ToString(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs index c9edbeda..bd50d2ff 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/WmsOutputSumExportService.cs @@ -1,19 +1,13 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Shouldly; using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Excel; +using Shouldly; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.BlobStoring; using Volo.Abp.DependencyInjection; using Win.Sfs.BaseData.ImportExcelCommon; -using Win.Sfs.SettleAccount.Reports.InvoiceSettledDiffs; -using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; namespace SettleAccount.Job.Services.Report { @@ -35,7 +29,6 @@ namespace SettleAccount.Job.Services.Report // [ImporterHeader(Name = "金额")] // public decimal Amt { set; get; } - //} public class WmsOutputSumExportService : ITransientDependency, IExportJob @@ -58,21 +51,20 @@ namespace SettleAccount.Job.Services.Report _fileContainer = fileContainer; } - public string ExportFile(Guid id, List exportName, List p_list) { var version = p_list.Where(p => p.Name == "Version").FirstOrDefault().Value; var materialCode = p_list.Where(p => p.Name == "MaterialCode").FirstOrDefault().Value; - var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; + var materialGroup = p_list.Where(p => p.Name == "MaterialGroup").FirstOrDefault().Value; var state = p_list.Where(p => p.Name == "State").FirstOrDefault().Value; - var _ls= _dapperRepository.GetWmsSumReportList(version, state); + var _ls = _dapperRepository.GetWmsSumReportList(version, state); var _lst = _dapperRepository.GetWmsSumExtendList(version); if (!string.IsNullOrEmpty(materialGroup)) { var _groupList = materialGroup.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料组车型)).ToList(); } @@ -80,7 +72,7 @@ namespace SettleAccount.Job.Services.Report if (!string.IsNullOrEmpty(materialCode)) { var _groupList = materialCode.Split(new char[] { ',' }).Distinct().ToList(); - if (_groupList.Count() > 0) + if (_groupList.Count > 0) { _ls = _ls.Where(p => _groupList.Contains(p.物料号)).ToList(); } @@ -100,6 +92,4 @@ namespace SettleAccount.Job.Services.Report } - - } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/fisUnsettledDiffReport.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/fisUnsettledDiffReport.cs index 0372bf68..9856d063 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/fisUnsettledDiffReport.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/Report/fisUnsettledDiffReport.cs @@ -1,12 +1,9 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.FISes; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report; using Win.Sfs.SettleAccount.Repository.SettleAccountJob.Report.ExportDto; @@ -23,7 +20,6 @@ namespace SettleAccount.Job.Services.Report _outputService = outputService; } - public string ExportFile(Guid id, List exportName, List p_list) { var _first = exportName.FirstOrDefault(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs index 6c4d0bc1..70178fdc 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/SettleAccount/SettleAccountImportService.cs @@ -1,24 +1,17 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using Microsoft.EntityFrameworkCore; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; using System.Text.RegularExpressions; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using SettleAccount.Job.Services; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Emailing; -using Win.Sfs.SettleAccount; using Win.Sfs.SettleAccount.Entities.SettleAccounts; using Win.Sfs.SettleAccount.ExportReports; using Win.Sfs.SettleAccount.Repository.SettleAccount; -using Win.Sfs.SettleAccount.Repository.SettleAccountJob; namespace TaskJob.Services { @@ -50,7 +43,7 @@ namespace TaskJob.Services var customerCode = customConditions.Where(p => p.Name == "CustomerCode").FirstOrDefault().Value; var year = customConditions.Where(p => p.Name == "Year").FirstOrDefault().Value; var period = customConditions.Where(p => p.Name == "Period").FirstOrDefault().Value; - var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value; + var factory = customConditions.Where(p => p.Name == "Factory").FirstOrDefault().Value; List _setls = new List(); var _id = Guid.NewGuid(); foreach (var itm in fileName) @@ -59,21 +52,21 @@ namespace TaskJob.Services { var filePath = fileSavePath + itm;//获取到导入的excel var exten = Path.GetExtension(fileSavePath); - + var errorlist = new List(); - var dtoList = _inputService.Input(filePath, null, errorlist); - foreach (var dto in dtoList) + var dtoList = _inputService.Input(filePath, null, errorlist); + foreach (var dto in dtoList) + { + if (dto.KENNCode.Length == 6) { - if (dto.KENNCode.Length == 6) - { - dto.KENNCode = "0" + dto.KENNCode; - } - var _settleaccount = new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(), dto.SettleYear, dto.KENNCode, - dto.ChassisNumber, dto.Model, dto.CP5A, dto.CP7, - Regex.Replace(dto.MaterialCode, @"\s", ""), dto.Qty, dto.SettlementID, dto.SettlementSupplier, - DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now, Guid.NewGuid()); - _setls.Add(_settleaccount); + dto.KENNCode = "0" + dto.KENNCode; } + var _settleaccount = new Win.Sfs.SettleAccount.Entities.SettleAccounts.SettleAccount(Guid.NewGuid(), Guid.NewGuid(), dto.SettleYear, dto.KENNCode, + dto.ChassisNumber, dto.Model, dto.CP5A, dto.CP7, + Regex.Replace(dto.MaterialCode, @"\s", ""), dto.Qty, dto.SettlementID, dto.SettlementSupplier, + DateTime.Now.Month.ToString(), dto.SettleYear, _id, version, DateTime.Now, Guid.NewGuid()); + _setls.Add(_settleaccount); + } //} #region //var errorFileName = "错误文件.xlsx"; @@ -83,7 +76,7 @@ namespace TaskJob.Services } catch (Exception e) { - throw e; + throw; } } @@ -93,7 +86,7 @@ namespace TaskJob.Services //_repository.GetDbContext().Database.ExecuteSqlRaw( // "EXEC sp_settle_fis_update" // ); - + return id.ToString(); } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/UnSettleAccount/UnSettleAccountImportService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/UnSettleAccount/UnSettleAccountImportService.cs index 82244810..54a2c0c3 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/UnSettleAccount/UnSettleAccountImportService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/UnSettleAccount/UnSettleAccountImportService.cs @@ -1,18 +1,14 @@ -using Magicodes.ExporterAndImporter.Core; -using Magicodes.ExporterAndImporter.Excel; -using SettleAccount.Job.Services; using System; using System.Collections.Generic; using System.IO; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; +using SettleAccount.Job.Services; using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.DependencyInjection; -using Win.Sfs.SettleAccount.Entities.SettleAccounts; using Win.Sfs.SettleAccount.ExportReports; -using Win.Sfs.SettleAccount.Repository.SettleAccount; namespace TaskJob.Services { @@ -59,9 +55,6 @@ namespace TaskJob.Services var errorlist = new List(); - - - #region //var errorFileName = "错误文件.xlsx"; //checkList.Add(new ErrorExportDto(version, customerCode, string.Empty, string.Empty, string.Empty, string.Empty, string.Format("ERP物料号{0}底盘号 {1}有重复", "11111111111", "22222222222"), string.Empty)); @@ -71,7 +64,7 @@ namespace TaskJob.Services } catch (Exception e) { - throw e; + throw; } } return id.ToString(); @@ -97,7 +90,7 @@ namespace TaskJob.Services // List _precodeList = new List();// // using (TextReader textReader = new StreamReader(filePath)) // { - + // int i = 0; // while (true) // { @@ -163,11 +156,9 @@ namespace TaskJob.Services // where g.Count() > 1 // select g; - // _repository.Insert(_setls); // _versionRepository.Insert(version, customerCode, customerCode); - - + // } // catch (Exception e) // { diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs index 55dffce8..416ea7c7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobAutoMapperProfile.cs @@ -20,7 +20,7 @@ namespace SettleAccount.Job { //CreateMap() // .ForMember(x => x.ReplaceLU, y => y.MapFrom(y => y.ReplaceLU)); - + } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs index 036236ff..7c5097f9 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccountJobModule.cs @@ -1,23 +1,15 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; -using Volo.Abp.Application; -//using Volo.Abp.Http.Client.IdentityModel; -using Volo.Abp.Identity; -//using Volo.Abp.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp.Dapper; -using TaskJob.Services; using System; - -using TaskJob.Interfaces; -using SettleAccount.Job.Services; -using Volo.Abp.BlobStoring; -using SettleAccount.Job.Domain; -using Volo.Abp.BlobStoring.FileSystem; -using System.IO; using Hangfire; +//using Volo.Abp.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; +using SettleAccount.Job.Services; using SettleAccount.Job.Services.Report; +using TaskJob.Interfaces; +using TaskJob.Services; +using Volo.Abp.AutoMapper; +using Volo.Abp.Dapper; +//using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; //using Win.Abp.Snowflakes; namespace Win.Sfs.SettleAccount @@ -37,7 +29,7 @@ namespace Win.Sfs.SettleAccount public override void ConfigureServices(ServiceConfigurationContext context) { ConfigureAutoMapper(); - GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute{ Attempts = 0}); + GlobalJobFilters.Filters.Add(new AutomaticRetryAttribute { Attempts = 0 }); context.Services.AddTransient(); context.Services.AddTransient(); @@ -46,7 +38,7 @@ namespace Win.Sfs.SettleAccount context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); - + context.Services.AddTransient(); context.Services.AddTransient(); context.Services.AddTransient(); @@ -56,7 +48,6 @@ namespace Win.Sfs.SettleAccount context.Services.AddTransient(); //量差和价差分析报表 context.Services.AddTransient(); - context.Services.AddTransient(implementationFactory => { @@ -105,9 +96,6 @@ namespace Win.Sfs.SettleAccount // return implementationFactory.GetService(); // } - - - // if (key.Equals(typeof(InvoiceSettledDiffExportService).FullName)) // { // return implementationFactory.GetService(); @@ -132,7 +120,7 @@ namespace Win.Sfs.SettleAccount // { // return implementationFactory.GetService(); // } - + // if (key.Equals(typeof(SettleFisDiffExportService).FullName)) // { // return implementationFactory.GetService(); @@ -253,20 +241,14 @@ namespace Win.Sfs.SettleAccount // return implementationFactory.GetService(); // } - - - // else // { // throw new ArgumentException($"Not Support key:{key}"); // } - - // }; return accesor; //}); - //Configure(options => //{ // options.Containers.Configure(container => @@ -280,7 +262,7 @@ namespace Win.Sfs.SettleAccount // } // fileSystem.BasePath = filestreampath; // }); - + // }); //}); diff --git a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeGeneratorModule.cs b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeGeneratorModule.cs index 4f1b3cfe..eabcc1e9 100644 --- a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeGeneratorModule.cs +++ b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeGeneratorModule.cs @@ -1,11 +1,10 @@ -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Win.Abp.Snowflakes { - public class AbpSnowflakeGeneratorModule:AbpModule + public class AbpSnowflakeGeneratorModule : AbpModule { } - } diff --git a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeIdGeneratorOptions.cs b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeIdGeneratorOptions.cs index 05147e85..01ca4b60 100644 --- a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeIdGeneratorOptions.cs +++ b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/AbpSnowflakeIdGeneratorOptions.cs @@ -1,4 +1,4 @@ -namespace Win.Abp.Snowflakes +namespace Win.Abp.Snowflakes { public class AbpSnowflakeIdGeneratorOptions { @@ -8,7 +8,6 @@ // 工作机器ID(0~31) public long? DefaultWorkerId { get; set; } - public long GetDefaultDatacenterId() { return DefaultDatacenterId ?? 0L; @@ -19,4 +18,4 @@ return DefaultWorkerId ?? 0L; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/ISnowflakeIdGenerator.cs b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/ISnowflakeIdGenerator.cs index a515fdb5..ab155d7b 100644 --- a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/ISnowflakeIdGenerator.cs +++ b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/ISnowflakeIdGenerator.cs @@ -1,4 +1,4 @@ -namespace Win.Abp.Snowflakes +namespace Win.Abp.Snowflakes { public interface ISnowflakeIdGenerator { @@ -12,4 +12,4 @@ // long Create(long datacenterId, long workerId); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/SnowflakeIdGenerator.cs b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/SnowflakeIdGenerator.cs index 8da3f3e9..26da1df9 100644 --- a/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/SnowflakeIdGenerator.cs +++ b/code/src/Shared/Win.Abp.Snowflakes/Win/Abp/Snowflakes/SnowflakeIdGenerator.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text; using Microsoft.Extensions.Options; using Volo.Abp.DependencyInjection; @@ -33,7 +33,6 @@ namespace Win.Abp.Snowflakes // 机器ID向左移12位 private const int WorkerIdShift = SequenceBits; - // 时间截向左移22位(5+5+12) private const int TimestampLeftShift = SequenceBits + WorkerIdBits + DatacenterIdBits; @@ -52,10 +51,9 @@ namespace Win.Abp.Snowflakes // 上次生成ID的时间截 private long LastTimestamp { get; set; } - public AbpSnowflakeIdGeneratorOptions Options { get; } - - protected SnowflakeIdGenerator(){} + + protected SnowflakeIdGenerator() { } public SnowflakeIdGenerator(IOptions options) { @@ -77,7 +75,7 @@ namespace Win.Abp.Snowflakes public long Create(long datacenterId, long workerId) { - + if (datacenterId > MaxDatacenterId || datacenterId < 0) { throw new Exception($"datacenter Id can't be greater than {MaxDatacenterId} or less than 0"); @@ -178,4 +176,4 @@ namespace Win.Abp.Snowflakes return (long)(DateTime.UtcNow - Jan1st1970).TotalMilliseconds; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IBranchBaseDataAppService.cs b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IBranchBaseDataAppService.cs index efc5943f..d68cfc21 100644 --- a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IBranchBaseDataAppService.cs +++ b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IBranchBaseDataAppService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Uow; @@ -10,7 +10,7 @@ namespace Win.Sfs.Shared.ApplicationBase /// /// /// - public interface IBranchBaseDataAppService:IUnitOfWorkEnabled + public interface IBranchBaseDataAppService : IUnitOfWorkEnabled { // Task GetFromRepositoryAsync(TKey id); /// @@ -34,4 +34,4 @@ namespace Win.Sfs.Shared.ApplicationBase // Task DeleteByFilterAsync(string filter); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailAppService.cs b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailAppService.cs index b0c95cbb..f0635434 100644 --- a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailAppService.cs +++ b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailAppService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Uow; @@ -28,4 +28,4 @@ namespace Win.Sfs.Shared.ApplicationBase Task DeleteDetailsAsync(TKey key, List detailKeys); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailEntityAppService.cs b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailEntityAppService.cs index 9e9a7104..5200d296 100644 --- a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailEntityAppService.cs +++ b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IHasDetailEntityAppService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Uow; @@ -27,4 +27,4 @@ namespace Win.Sfs.Shared.ApplicationBase //Task DeleteDetailsAsync(TKey key, List detailKeys); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IImportAppService.cs b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IImportAppService.cs index 9ea55943..3906e969 100644 --- a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IImportAppService.cs +++ b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IImportAppService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Uow; @@ -20,4 +20,4 @@ namespace Win.Sfs.Shared.ApplicationBase /// 是否导入成功 Task ImportAsync(List entities); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IInventoryAppService.cs b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IInventoryAppService.cs index 42738b80..3628dd99 100644 --- a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IInventoryAppService.cs +++ b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/IInventoryAppService.cs @@ -1,6 +1,5 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; using Volo.Abp.Uow; namespace Win.Sfs.Shared.ApplicationBase @@ -12,7 +11,7 @@ namespace Win.Sfs.Shared.ApplicationBase /// public interface IInventoryAppService : IUnitOfWorkEnabled { - + /// /// 获取实体总数 /// @@ -31,7 +30,7 @@ namespace Win.Sfs.Shared.ApplicationBase /// IDs /// 是否执行成功 Task DeleteListAsync(List keys); - + // Task DeleteByFilterAsync(string filter); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/INormalBaseDataAppService.cs b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/INormalBaseDataAppService.cs index c89a2397..4e64625e 100644 --- a/code/src/Shared/Win.Sfs.Shared/ApplicationBase/INormalBaseDataAppService.cs +++ b/code/src/Shared/Win.Sfs.Shared/ApplicationBase/INormalBaseDataAppService.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Uow; @@ -31,7 +31,7 @@ namespace Win.Sfs.Shared.ApplicationBase /// IDs /// 是否执行成功 Task DeleteListAsync(List keys); - + // Task DeleteByFilterAsync(string filter); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheServiceBase.cs b/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheServiceBase.cs index 6074e53c..d9529d72 100644 --- a/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheServiceBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheServiceBase.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Text; using System.Threading.Tasks; -using Microsoft.Extensions.Caching.Distributed; using Volo.Abp; using Volo.Abp.Caching; using Volo.Abp.DependencyInjection; @@ -23,14 +22,14 @@ namespace Win.Sfs.Shared.CacheBase public virtual async Task GetPropertyValueAsync(Func> factory, string propertyName) { - return await GetPropertyValueAsync(factory, new List { propertyName }); + return await GetPropertyValueAsync(factory, new List { propertyName }).ConfigureAwait(false); } public virtual async Task GetPropertyValueAsync(Func> factory, IEnumerable propertyNames, char separator = ',') { try { - var entity = await factory.Invoke(); + var entity = await factory.Invoke().ConfigureAwait(false); var sb = new StringBuilder(); foreach (var propertyName in propertyNames) { @@ -46,7 +45,7 @@ namespace Win.Sfs.Shared.CacheBase sb.Append(propertyValue + separator.ToString()); } - return sb.ToString().TrimEnd(separator); + return sb.ToString().TrimEnd(separator); } catch (EntityNotFoundException) { @@ -56,4 +55,4 @@ namespace Win.Sfs.Shared.CacheBase } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheStrategyConst.cs b/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheStrategyConst.cs index f7fca6a8..5e3e8dc0 100644 --- a/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheStrategyConst.cs +++ b/code/src/Shared/Win.Sfs.Shared/CacheBase/CacheStrategyConst.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.CacheBase +namespace Win.Sfs.Shared.CacheBase { /// /// 缓存过期时间策略 @@ -60,4 +60,4 @@ /// public const int NEVER = -1; } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/CacheBase/CachingExtensions.cs b/code/src/Shared/Win.Sfs.Shared/CacheBase/CachingExtensions.cs index 6a804057..1a974d9e 100644 --- a/code/src/Shared/Win.Sfs.Shared/CacheBase/CachingExtensions.cs +++ b/code/src/Shared/Win.Sfs.Shared/CacheBase/CachingExtensions.cs @@ -34,11 +34,11 @@ namespace Win.Sfs.Shared.CacheBase { TCacheItem cacheItem; - var result = await cache.GetAsync(key); + var result = await cache.GetAsync(key).ConfigureAwait(false); if (result == null) { - cacheItem = await factory.Invoke(); - await cache.SetAsync(key, cacheItem, minutes); + cacheItem = await factory.Invoke().ConfigureAwait(false); + await cache.SetAsync(key, cacheItem, minutes).ConfigureAwait(false); } else { @@ -71,7 +71,7 @@ namespace Win.Sfs.Shared.CacheBase public static async Task> GetManyAsync( this IDistributedCache cache, IEnumerable keys) where TCacheItem : class { - var cacheItems = await cache.GetManyAsync(keys, null, true); + var cacheItems = await cache.GetManyAsync(keys, null, true).ConfigureAwait(false); return cacheItems.Select(p => p.Value); } @@ -79,32 +79,25 @@ namespace Win.Sfs.Shared.CacheBase this IDistributedCache cache, string key, TCacheItem cacheItem, int minutes) where TCacheItem : class { var options = CreateDistributedCacheEntryOptions(minutes); - await cache.SetAsync(key, cacheItem, options, null, true); + await cache.SetAsync(key, cacheItem, options, null, true).ConfigureAwait(false); } public static async Task SetManyAsync( this IDistributedCache cache, IEnumerable> cacheItems, int minutes) where TCacheItem : class { var options = CreateDistributedCacheEntryOptions(minutes); - await cache.SetManyAsync(cacheItems, options); + await cache.SetManyAsync(cacheItems, options).ConfigureAwait(false); } public static async Task DeleteAsync( this IDistributedCache cache, string key) where TCacheItem : class { - var result = await cache.GetAsync(key); + var result = await cache.GetAsync(key).ConfigureAwait(false); if (result != null) { - await cache.RemoveAsync(key); + await cache.RemoveAsync(key).ConfigureAwait(false); } } - - - private static string GetKey(Type type, string key) - { - return $"{type.Name}:{key}"; - } - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Constant/CommonConsts.cs b/code/src/Shared/Win.Sfs.Shared/Constant/CommonConsts.cs index c823058d..cc4f9cce 100644 --- a/code/src/Shared/Win.Sfs.Shared/Constant/CommonConsts.cs +++ b/code/src/Shared/Win.Sfs.Shared/Constant/CommonConsts.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; namespace Win.Sfs.Shared.Constant { diff --git a/code/src/Shared/Win.Sfs.Shared/Constant/MultiTenancyConsts.cs b/code/src/Shared/Win.Sfs.Shared/Constant/MultiTenancyConsts.cs index f4d9e775..9369b21b 100644 --- a/code/src/Shared/Win.Sfs.Shared/Constant/MultiTenancyConsts.cs +++ b/code/src/Shared/Win.Sfs.Shared/Constant/MultiTenancyConsts.cs @@ -1,7 +1,7 @@ -namespace Win.Sfs.Shared.Constant +namespace Win.Sfs.Shared.Constant { public static class MultiTenancyConsts { public const bool IsEnabled = false; } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/CurrentBranch/A.cs b/code/src/Shared/Win.Sfs.Shared/CurrentBranch/A.cs index c9d213cb..50b1d3fc 100644 --- a/code/src/Shared/Win.Sfs.Shared/CurrentBranch/A.cs +++ b/code/src/Shared/Win.Sfs.Shared/CurrentBranch/A.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Win.Sfs.Shared.CurrentBranch { @@ -9,4 +9,4 @@ namespace Win.Sfs.Shared.CurrentBranch return (T)Convert.ChangeType(obj, typeof(T)); } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/CurrentBranch/BranchManager.cs b/code/src/Shared/Win.Sfs.Shared/CurrentBranch/BranchManager.cs index b6c8522f..84d62ae6 100644 --- a/code/src/Shared/Win.Sfs.Shared/CurrentBranch/BranchManager.cs +++ b/code/src/Shared/Win.Sfs.Shared/CurrentBranch/BranchManager.cs @@ -1,10 +1,10 @@ -using System; +using System; using Microsoft.AspNetCore.Http; using Win.Utils; namespace Win.Sfs.Shared.CurrentBranch { - public class BranchManager: IBranchManager + public class BranchManager : IBranchManager { private readonly IHttpContextAccessor _httpContextAccessor; @@ -21,7 +21,10 @@ namespace Win.Sfs.Shared.CurrentBranch var strBranchId = context?.Request.Headers[BranchHeaderConsts.HeaderName]; if (string.IsNullOrEmpty(strBranchId)) + { return Guid.NewGuid(); + } + var branchId = Guid.Parse(strBranchId); return branchId; } @@ -37,4 +40,4 @@ namespace Win.Sfs.Shared.CurrentBranch // return t; // } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/CurrentBranch/IBranchManager.cs b/code/src/Shared/Win.Sfs.Shared/CurrentBranch/IBranchManager.cs index 21d7579d..7616057c 100644 --- a/code/src/Shared/Win.Sfs.Shared/CurrentBranch/IBranchManager.cs +++ b/code/src/Shared/Win.Sfs.Shared/CurrentBranch/IBranchManager.cs @@ -1,10 +1,10 @@ -using System; +using System; using Volo.Abp.DependencyInjection; namespace Win.Sfs.Shared.CurrentBranch { - public interface IBranchManager :ITransientDependency + public interface IBranchManager : ITransientDependency { Guid GetId(); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/AggregateRootBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/AggregateRootBase.cs index 1c79ade4..9180f509 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/AggregateRootBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/AggregateRootBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using Volo.Abp.Domain.Entities.Auditing; @@ -6,7 +6,7 @@ using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase { public abstract class AggregateRootBase : FullAuditedAggregateRoot, IEnabled, IRemark - // ,IMultiTenant + // ,IMultiTenant { public AggregateRootBase() { @@ -22,4 +22,4 @@ namespace Win.Sfs.Shared.DomainBase // public Guid? TenantId { get; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/AuditedAggregateRootBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/AuditedAggregateRootBase.cs index e2021875..7ca36444 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/AuditedAggregateRootBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/AuditedAggregateRootBase.cs @@ -1,10 +1,9 @@ -using System; using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase { - public abstract class AuditedAggregateRootBase : AuditedAggregateRoot,IBranch, IEnabled, IRemark - + public abstract class AuditedAggregateRootBase : AuditedAggregateRoot, IBranch, IEnabled, IRemark + { protected AuditedAggregateRootBase() { } public AuditedAggregateRootBase(TKey id) : base(id) { } @@ -25,4 +24,4 @@ namespace Win.Sfs.Shared.DomainBase public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchAggregateRootBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchAggregateRootBase.cs index e7e9dd1a..1dd62eca 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchAggregateRootBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchAggregateRootBase.cs @@ -1,8 +1,6 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com -using System; - namespace Win.Sfs.Shared.DomainBase { public abstract class BranchAggregateRootBase : AggregateRootBase, IBranch @@ -17,4 +15,4 @@ namespace Win.Sfs.Shared.DomainBase public TKey BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchEntityBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchEntityBase.cs index 3a0ef83b..86e577d8 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchEntityBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/BranchEntityBase.cs @@ -1,5 +1,3 @@ -using System; - namespace Win.Sfs.Shared.DomainBase { public abstract class BranchEntityBase : EntityBase, IBranch @@ -14,4 +12,4 @@ namespace Win.Sfs.Shared.DomainBase public TKey BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAggregateRootBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAggregateRootBase.cs index 421a32d2..ef0b7806 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAggregateRootBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAggregateRootBase.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase { @@ -7,4 +7,4 @@ namespace Win.Sfs.Shared.DomainBase public bool Enabled { get; set; } = true; public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentBase.cs index d9e7e7b2..8145c81f 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentBase.cs @@ -1,4 +1,3 @@ - using System.Collections.Generic; using Win.Sfs.Shared.Enums; @@ -26,8 +25,7 @@ namespace Win.Sfs.Shared.DomainBase /// public EnumDocumentType DocumentType { get; set; } - public List UpstreamDocuments { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentDetailBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentDetailBase.cs index c5eb09a8..e108d4f8 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentDetailBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedDocumentDetailBase.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.DomainBase +namespace Win.Sfs.Shared.DomainBase { public abstract class CreationAuditedDocumentDetailBase : CreationAuditedEntityBase @@ -14,7 +14,6 @@ /// public string DocumentNumber { get; set; } - /// /// 物品ID /// @@ -25,4 +24,4 @@ /// public string ItemCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedEntityBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedEntityBase.cs index 0cb0c568..6b1ddb03 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedEntityBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/CreationAuditedEntityBase.cs @@ -1,4 +1,3 @@ -using System; using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase @@ -18,4 +17,4 @@ namespace Win.Sfs.Shared.DomainBase /// public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/EntityBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/EntityBase.cs index be6eb270..476c1316 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/EntityBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/EntityBase.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase { @@ -16,4 +16,4 @@ namespace Win.Sfs.Shared.DomainBase public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedAggregateRootBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedAggregateRootBase.cs index 5c35dc5f..64bde2af 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedAggregateRootBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedAggregateRootBase.cs @@ -1,10 +1,9 @@ -using System; using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase { - public abstract class FullAuditedAggregateRootBase : FullAuditedAggregateRoot,IBranch, IEnabled, IRemark - + public abstract class FullAuditedAggregateRootBase : FullAuditedAggregateRoot, IBranch, IEnabled, IRemark + { protected FullAuditedAggregateRootBase() { } public FullAuditedAggregateRootBase(TKey id) : base(id) { } @@ -25,4 +24,4 @@ namespace Win.Sfs.Shared.DomainBase public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentBase.cs index 6fd00522..0755b072 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentBase.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Win.Sfs.Shared.Enums; namespace Win.Sfs.Shared.DomainBase @@ -14,19 +14,17 @@ namespace Win.Sfs.Shared.DomainBase /// public string DocumentNumber { get; set; } - /// /// 单据类型 /// public EnumDocumentType DocumentType { get; set; } - /// /// 状态 /// public EnumDocumentStatus DocumentStatus { get; set; } public List UpstreamDocuments { get; set; } - + } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentDetailBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentDetailBase.cs index a825681c..336cbc61 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentDetailBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedDocumentDetailBase.cs @@ -1,8 +1,8 @@ -using Win.Sfs.Shared.Enums; +using Win.Sfs.Shared.Enums; namespace Win.Sfs.Shared.DomainBase { - public abstract class FullAuditedDocumentDetailBase : FullAuditedEntityBase,IDocumentNumber,IItem + public abstract class FullAuditedDocumentDetailBase : FullAuditedEntityBase, IDocumentNumber, IItem { protected FullAuditedDocumentDetailBase() { } @@ -11,7 +11,7 @@ namespace Win.Sfs.Shared.DomainBase /// /// 行号 /// - public int LineNumber { get; set; } = 0; + public int LineNumber { get; set; } /// /// 单据ID @@ -23,7 +23,6 @@ namespace Win.Sfs.Shared.DomainBase /// public string DocumentNumber { get; set; } - /// /// 明细状态 /// @@ -34,12 +33,10 @@ namespace Win.Sfs.Shared.DomainBase /// public TKey ItemId { get; set; } - - /// /// 物品Code /// public string ItemCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedEntityBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedEntityBase.cs index dd689d43..63457cae 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedEntityBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/FullAuditedEntityBase.cs @@ -1,9 +1,8 @@ -using System; using Volo.Abp.Domain.Entities.Auditing; namespace Win.Sfs.Shared.DomainBase { - public abstract class FullAuditedEntityBase : FullAuditedEntity,IBranch, IEnabled, IRemark + public abstract class FullAuditedEntityBase : FullAuditedEntity, IBranch, IEnabled, IRemark { protected FullAuditedEntityBase() { } public FullAuditedEntityBase(TKey id) : base(id) { } @@ -24,4 +23,4 @@ namespace Win.Sfs.Shared.DomainBase public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/IBaseDataDistributedCache.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/IBaseDataDistributedCache.cs index eec6f69d..469f8edf 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/IBaseDataDistributedCache.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/IBaseDataDistributedCache.cs @@ -1,6 +1,3 @@ -using System; -using System.Threading.Tasks; - namespace Win.Sfs.Shared.DomainBase { // public interface IBaseDataDistributedCache where TEntity:class @@ -11,4 +8,4 @@ namespace Win.Sfs.Shared.DomainBase // Task LoadEntitiesCache(IDistributedCache cache); // // } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/IDocumentNumber.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/IDocumentNumber.cs index 11943788..5b8dc3a1 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/IDocumentNumber.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/IDocumentNumber.cs @@ -1,7 +1,7 @@ -namespace Win.Sfs.Shared.DomainBase +namespace Win.Sfs.Shared.DomainBase { public interface IDocumentNumber { string DocumentNumber { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/IHasDetails.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/IHasDetails.cs index b3204beb..70cd5f72 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/IHasDetails.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/IHasDetails.cs @@ -1,4 +1,3 @@ -using System; using System.Collections.Generic; using JetBrains.Annotations; using Volo.Abp.Guids; @@ -56,4 +55,4 @@ namespace Win.Sfs.Shared.DomainBase /// 明细项实体 TDetailEntity FindDetail(TDetailKey detailKey); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/IItem.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/IItem.cs index aeca365e..3d83e3f0 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/IItem.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/IItem.cs @@ -1,8 +1,8 @@ -namespace Win.Sfs.Shared.DomainBase +namespace Win.Sfs.Shared.DomainBase { public interface IItem { TKey ItemId { get; set; } string ItemCode { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ISerialNumber.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ISerialNumber.cs index e3d0baca..d7e9d445 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ISerialNumber.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ISerialNumber.cs @@ -1,7 +1,7 @@ -namespace Win.Sfs.Shared.DomainBase +namespace Win.Sfs.Shared.DomainBase { public interface ISerialNumber { string SerialNumber { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/IUpstreamDocument.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/IUpstreamDocument.cs index a52f4d8c..86ee49bd 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/IUpstreamDocument.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/IUpstreamDocument.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; namespace Win.Sfs.Shared.DomainBase { @@ -6,8 +6,7 @@ namespace Win.Sfs.Shared.DomainBase { //TKey UpstreamDocumentId { get; set; } - List UpstreamDocuments { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/CurrencyPrice.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/CurrencyPrice.cs index 367230b6..bb1cbc52 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/CurrencyPrice.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/CurrencyPrice.cs @@ -1,13 +1,9 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase { - public class CurrencyPrice:ValueObject + public class CurrencyPrice : ValueObject { public decimal Price { set; get; } public string Currency { set; get; } @@ -20,6 +16,5 @@ namespace Win.Sfs.Shared.DomainBase } - } } diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Employee.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Employee.cs index 5fb25c54..346fa277 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Employee.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Employee.cs @@ -1,13 +1,9 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase { - public class Employee:ValueObject + public class Employee : ValueObject { public string Name { set; get; } public string Phone { set; get; } diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/InventoryInfo.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/InventoryInfo.cs index cf812d86..f155098a 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/InventoryInfo.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/InventoryInfo.cs @@ -1,13 +1,13 @@ -using System; +using System; using System.Collections.Generic; using Volo.Abp.Domain.Values; using Win.Sfs.Shared.Enums; namespace Win.Sfs.Shared.DomainBase { - public class InventoryInfo : ValueObject,IItem + public class InventoryInfo : ValueObject, IItem { - + public Guid Id { get; set; } public Guid LabelId { get; set; } public Guid ItemId { get; set; } @@ -18,8 +18,7 @@ namespace Win.Sfs.Shared.DomainBase public string BasicUomCode { get; set; } public decimal Qty { get; set; } - - public InventoryInfo( Guid labelId, Guid itemId, string itemCode, string lot, string serial, + public InventoryInfo(Guid labelId, Guid itemId, string itemCode, string lot, string serial, string basicUomCode, decimal qty, EnumInventoryStatus inventoryStatus = EnumInventoryStatus.OK) { LabelId = labelId; @@ -45,4 +44,4 @@ namespace Win.Sfs.Shared.DomainBase } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Location.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Location.cs index 26201e14..1f5d8124 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Location.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Location.cs @@ -1,9 +1,4 @@ -using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase @@ -19,10 +14,8 @@ namespace Win.Sfs.Shared.DomainBase // [Display(Name = "仓库Id")] // public Guid WhseId { get; set; } - public string WhseCode { get; set; } - // /// // /// 库区ID // /// @@ -30,7 +23,6 @@ namespace Win.Sfs.Shared.DomainBase // public Guid AreaId { get; set; } public string AreaCode { get; set; } - // /// // /// 库位组ID // /// @@ -47,9 +39,8 @@ namespace Win.Sfs.Shared.DomainBase //public Guid LocId { get; set; } //public string LocCode { get; set; } - protected override IEnumerable GetAtomicValues() - { + { // yield return WhseId; // yield return AreaId; // yield return SlgId; diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Lots.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Lots.cs index 5f8a5c3b..fde0b7db 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Lots.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/Lots.cs @@ -1,8 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase @@ -27,13 +24,11 @@ namespace Win.Sfs.Shared.DomainBase /// public DateTime ProduceDate { set; get; } - ///// ///// 生产周 ///// //public DateTime ProduceWeek { private set; get; } - ///// ///// 到货日期 ///// @@ -44,8 +39,6 @@ namespace Win.Sfs.Shared.DomainBase /// public DateTime ReceiptDate { set; get; } - - protected override IEnumerable GetAtomicValues() { yield return VendBatch; @@ -54,4 +47,4 @@ namespace Win.Sfs.Shared.DomainBase yield return ReceiptDate; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/StockMove.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/StockMove.cs index ef1dc489..b59a32b9 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/StockMove.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/StockMove.cs @@ -1,9 +1,5 @@ -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; using Win.Sfs.Shared.Enums; @@ -40,8 +36,6 @@ namespace Win.Sfs.Shared.DomainBase /// public Location Location { get; set; } - - protected override IEnumerable GetAtomicValues() { yield return InventoryCode; diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TaskQty.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TaskQty.cs index a950f2c3..03726d11 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TaskQty.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TaskQty.cs @@ -1,9 +1,5 @@ -using System; +using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase @@ -13,19 +9,18 @@ namespace Win.Sfs.Shared.DomainBase /// public class TaskQty : ValueObject { - + public string TransNumber { get; set; } - + public decimal Qty { get; set; } - - public DateTime CreateTime { get; set; } + public DateTime CreateTime { get; set; } protected override IEnumerable GetAtomicValues() - { + { yield return TransNumber; yield return Qty; - yield return CreateTime; + yield return CreateTime; } } } diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TransferInfo.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TransferInfo.cs index a2cc87bd..415cfc7f 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TransferInfo.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/TransferInfo.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using Volo.Abp.Domain.Values; using Win.Sfs.Shared.Enums; @@ -24,7 +24,7 @@ namespace Win.Sfs.Shared.DomainBase protected TransferInfo() { } - public TransferInfo(Guid branchId, string locCode,string lot,string serial, decimal qty = 0, + public TransferInfo(Guid branchId, string locCode, string lot, string serial, decimal qty = 0, EnumInventoryStatus inventoryStatus = EnumInventoryStatus.OK, Guid? eqptId = null) { InventoryStatus = inventoryStatus; @@ -36,7 +36,6 @@ namespace Win.Sfs.Shared.DomainBase Serial = serial; } - protected override IEnumerable GetAtomicValues() { yield return InventoryStatus; @@ -48,4 +47,4 @@ namespace Win.Sfs.Shared.DomainBase yield return Serial; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UnitQty.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UnitQty.cs index a61ab732..f6ea867b 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UnitQty.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UnitQty.cs @@ -1,9 +1,5 @@ -using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase @@ -25,9 +21,9 @@ namespace Win.Sfs.Shared.DomainBase public decimal Qty { get; set; } protected override IEnumerable GetAtomicValues() - { + { yield return UomCode; - yield return Qty; + yield return Qty; } } } diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UomBase.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UomBase.cs index 675d53b9..6429eced 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UomBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UomBase.cs @@ -1,22 +1,17 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; namespace Win.Sfs.Shared.DomainBase { - public class UomBase:ValueObject + public class UomBase : ValueObject { public decimal UomConversionValue { set; get; } public string UomCode { set; get; } - protected override IEnumerable GetAtomicValues() - { + { yield return UomConversionValue; - yield return UomCode; + yield return UomCode; } } } diff --git a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UpstreamDocument.cs b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UpstreamDocument.cs index 09d419e0..f989a8bf 100644 --- a/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UpstreamDocument.cs +++ b/code/src/Shared/Win.Sfs.Shared/DomainBase/ValueObjectBase/UpstreamDocument.cs @@ -1,16 +1,12 @@ -using System; +using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Volo.Abp.Domain.Values; using Win.Sfs.Shared.Enums; namespace Win.Sfs.Shared.DomainBase { public class UpstreamDocument : ValueObject - { - + { /// /// 上游单据ID @@ -27,15 +23,11 @@ namespace Win.Sfs.Shared.DomainBase /// public EnumDocumentType UpstreamDocumentType { get; set; } - - /// /// 排序序号 /// public int Seq { get; set; } - - protected override IEnumerable GetAtomicValues() { yield return UpstreamDocumentId; @@ -45,6 +37,5 @@ namespace Win.Sfs.Shared.DomainBase } - } } diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/AuditedEntityDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/AuditedEntityDtoBase.cs index b0002ed6..94edd5cd 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/AuditedEntityDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/AuditedEntityDtoBase.cs @@ -1,9 +1,8 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.Shared.DtoBase { @@ -25,4 +24,4 @@ namespace Win.Sfs.Shared.DtoBase [Display(Name = "备注")] public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/BranchRequestDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/BranchRequestDtoBase.cs index d831029e..e7e2a20f 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/BranchRequestDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/BranchRequestDtoBase.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; +using System; using System.ComponentModel.DataAnnotations; -using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.Shared.DtoBase { @@ -21,5 +18,4 @@ namespace Win.Sfs.Shared.DtoBase public Guid BranchId { get; set; } } - -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/CreateOrUpdateEntityDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/CreateOrUpdateEntityDtoBase.cs index d42dc4e1..ed736e0b 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/CreateOrUpdateEntityDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/CreateOrUpdateEntityDtoBase.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.Shared.DtoBase { @@ -9,6 +9,5 @@ namespace Win.Sfs.Shared.DtoBase public abstract class CreateOrUpdateEntityDtoBase : EntityDto { - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/EntityDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/EntityDtoBase.cs index 5a1f5383..50a15e9d 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/EntityDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/EntityDtoBase.cs @@ -1,6 +1,5 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; -using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.Shared.DtoBase { @@ -22,4 +21,4 @@ namespace Win.Sfs.Shared.DtoBase [Display(Name = "备注")] public string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/ExportDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/ExportDtoBase.cs index 9afa458d..763e5803 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/ExportDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/ExportDtoBase.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.Shared.DtoBase { @@ -6,4 +6,4 @@ namespace Win.Sfs.Shared.DtoBase { } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/ImportDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/ImportDtoBase.cs index f6f758f1..fb340a06 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/ImportDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/ImportDtoBase.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.Shared.DtoBase { @@ -6,4 +6,4 @@ namespace Win.Sfs.Shared.DtoBase { } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/InventoryAuditedEntityDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/InventoryAuditedEntityDtoBase.cs index ecdf24cb..b66aae42 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/InventoryAuditedEntityDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/InventoryAuditedEntityDtoBase.cs @@ -1,4 +1,4 @@ -// 闻荫智慧工厂管理套件 +// 闻荫智慧工厂管理套件 // Copyright (c) 闻荫科技 www.ccwin-in.com using System; @@ -14,7 +14,7 @@ namespace Win.Sfs.Shared.DtoBase /// Full audited entity DTO base /// /// TKey - public abstract class InventoryAuditedEntityDtoBase : AuditedEntityDto, IRemark + public abstract class InventoryAuditedEntityDtoBase : AuditedEntityDto, IRemark { /// /// 备注 @@ -26,7 +26,7 @@ namespace Win.Sfs.Shared.DtoBase /// 看板编号 /// [Display(Name = "看板编号")] - public string KanbanNumber { set; get; } + public string KanbanNumber { set; get; } /// /// 订单编号 @@ -59,13 +59,12 @@ namespace Win.Sfs.Shared.DtoBase /// 发货日期 /// [Display(Name = "发货日期")] - public DateTime ShipDate { set; get; } + public DateTime ShipDate { set; get; } /// /// 发货人 /// [Display(Name = "发货人")] - public string ShipUser { set; get; } - + public string ShipUser { set; get; } /// /// 单据流水号 @@ -73,7 +72,6 @@ namespace Win.Sfs.Shared.DtoBase [Display(Name = "单据流水号")] public string DocumentNumber { get; set; } - /// /// 单据类型 /// @@ -81,7 +79,6 @@ namespace Win.Sfs.Shared.DtoBase [Required(ErrorMessage = "{0}是必填项")] public EnumDocumentType DocumentType { get; set; } - /// /// 状态 /// @@ -95,6 +92,5 @@ namespace Win.Sfs.Shared.DtoBase [Display(Name = "历史单据信息")] public List UpstreamDocumentDataBases { get; set; } - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/ListDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/ListDtoBase.cs index b1a0b46a..6b071992 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/ListDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/ListDtoBase.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Dtos; namespace Win.Sfs.Shared.DtoBase { @@ -9,4 +9,4 @@ namespace Win.Sfs.Shared.DtoBase public abstract class ListDtoBase : EntityDto { } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/RequestDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/RequestDtoBase.cs index daf88c2c..c75ea40a 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/RequestDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/RequestDtoBase.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; @@ -19,5 +19,4 @@ namespace Win.Sfs.Shared.DtoBase public virtual List Filters { get; set; } = new List(); } - -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/DtoBase/SettleAccount/StatisticRequestDtoBase.cs b/code/src/Shared/Win.Sfs.Shared/DtoBase/SettleAccount/StatisticRequestDtoBase.cs index 6ecc225e..0f28e478 100644 --- a/code/src/Shared/Win.Sfs.Shared/DtoBase/SettleAccount/StatisticRequestDtoBase.cs +++ b/code/src/Shared/Win.Sfs.Shared/DtoBase/SettleAccount/StatisticRequestDtoBase.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Win.Sfs.Shared; -using Win.Sfs.Shared.DtoBase; -using Win.Sfs.Shared.Filter; namespace Win.Sfs.Shared.DtoBase.SettleAccount { @@ -24,7 +19,6 @@ namespace Win.Sfs.Shared.DtoBase.SettleAccount [Display(Name = "期间")] public string Period { set; get; } - /// /// 版本 /// @@ -34,7 +28,7 @@ namespace Win.Sfs.Shared.DtoBase.SettleAccount /// /// 客户编码 /// - + [Display(Name = "客户编码")] public string CustomerCode { get; set; } @@ -50,7 +44,6 @@ namespace Win.Sfs.Shared.DtoBase.SettleAccount [Display(Name = "备注")] public string Remark { get; set; } - ///// ///// 是否导出文件 ///// @@ -58,4 +51,4 @@ namespace Win.Sfs.Shared.DtoBase.SettleAccount //public bool IsExport { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumAreaType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumAreaType.cs index df6678ed..8557cc85 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumAreaType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumAreaType.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumAreaType { @@ -93,4 +93,4 @@ EXTERNAL, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumArrivalNoticeCreateType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumArrivalNoticeCreateType.cs index 36351482..d1719369 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumArrivalNoticeCreateType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumArrivalNoticeCreateType.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumArrivalNoticeCreateType { @@ -10,22 +10,22 @@ /// /// 按零件号 /// - ByItem =1, - + ByItem = 1, + ///// ///// 按 ///// //NOK = 2, - + ///// ///// 待定 ///// //HOLD = 3, - + ///// ///// 报废 ///// //SCRAP = 4, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumConditionType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumConditionType.cs index 72aeda89..e8feeaed 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumConditionType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumConditionType.cs @@ -1,21 +1,21 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumConditionType { - ItemCode =10, + ItemCode = 10, ItemType1 = 11, ItemType2 = 12, ItemType3 = 13, - ItemGroup =14, + ItemGroup = 14, SupplierCode = 20, CustomerCode = 30, ProdLineCode = 40, InventoryLot = 90, LocCode, - SameItemAndSameLot=100, - SameItem=200, - NotEmptyLoc =300, + SameItemAndSameLot = 100, + SameItem = 200, + NotEmptyLoc = 300, EmptyLoc = 400, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumDetailStatusType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumDetailStatusType.cs index 17647bab..52b25fa2 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumDetailStatusType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumDetailStatusType.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumDetailStatusType { @@ -27,11 +27,10 @@ /// AllReceipt = 4, - /// /// 完结 /// Finish = 9, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentStatus.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentStatus.cs index 47cdcda8..9184d4fe 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentStatus.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentStatus.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumDocumentStatus { @@ -23,4 +23,4 @@ Cancel = 9, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentType.cs index 1905ed14..123ac7a0 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumDocumentType.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumDocumentType { @@ -20,26 +20,26 @@ /// /// 不合格上架 /// - NPA=4, - + NPA = 4, + /// /// 拣料 /// - PICK=5, + PICK = 5, /// /// 发货 /// - ISS=6, + ISS = 6, /// /// 移库 /// - TR=7, + TR = 7, /// /// 盘点 /// - CYC=8, + CYC = 8, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumFileType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumFileType.cs index 265851e6..4cac67a7 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumFileType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumFileType.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.Shared.Enums { public enum EnumFileType diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumInventoryStatus.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumInventoryStatus.cs index dca6aac7..29201ad5 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumInventoryStatus.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumInventoryStatus.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumInventoryStatus { @@ -10,22 +10,22 @@ /// /// 合格 /// - OK =1, - + OK = 1, + /// /// 不合格 /// NOK = 2, - + /// /// 待定 /// HOLD = 3, - + /// /// 报废 /// SCRAP = 4, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemCategory.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemCategory.cs index 61145826..c2d52ef0 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemCategory.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemCategory.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumItemCategory { @@ -57,4 +57,4 @@ /// ProductLine, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemStatus.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemStatus.cs index b93c6175..a225e536 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemStatus.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumItemStatus.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumItemStatus { @@ -6,15 +6,15 @@ /// 新增 /// New = 0, - + /// /// 有效 /// - Active =1, - + Active = 1, + /// /// 待定 /// - Hold =2, + Hold = 2, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionAction.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionAction.cs index 266be3d9..5924d047 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionAction.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionAction.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumJobOptionAction { @@ -22,4 +22,4 @@ /// ReEnter = 3, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionSetToDefaultUom.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionSetToDefaultUom.cs index c5a90b0c..70fc3235 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionSetToDefaultUom.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobOptionSetToDefaultUom.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumJobOptionSetToDefaultUom { @@ -8,4 +8,4 @@ ToSlgUom, InternalRouteUom, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobStatus.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobStatus.cs index e857887f..8d520248 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobStatus.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobStatus.cs @@ -1,10 +1,10 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumJobStatus { - NEW=0, - ACCEPT=1, - COMPLETED=2, + NEW = 0, + ACCEPT = 1, + COMPLETED = 2, CANCELED = 3, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobType.cs index 73224d62..b96b51f1 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumJobType.cs @@ -1,40 +1,40 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumJobType { /// /// 收货 /// - RECEIPT=1, + RECEIPT = 1, /// /// 质检 /// - INSPECT=2, + INSPECT = 2, /// /// 合格上架 /// - PUTAWAY=3, - + PUTAWAY = 3, + /// /// 拣料 /// - PICKUP=4, + PICKUP = 4, /// /// 发货 /// - ISSUE=5, + ISSUE = 5, /// /// 移库 /// - TRANSFER=6, + TRANSFER = 6, /// /// 盘点 /// - COUNT=7, + COUNT = 7, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumStrategyType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumStrategyType.cs index 38e7152f..029a1b76 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumStrategyType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumStrategyType.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumStrategyType { @@ -27,4 +27,4 @@ /// Wlg, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/EnumUsableStatus.cs b/code/src/Shared/Win.Sfs.Shared/Enums/EnumUsableStatus.cs index 73f473f9..7668281f 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/EnumUsableStatus.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/EnumUsableStatus.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums +namespace Win.Sfs.Shared.Enums { public enum EnumUsableStatus { @@ -11,12 +11,11 @@ /// 冻结 /// FREEZE = 1, - + /// /// 盘点 /// CHECK = 2, - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumCustomerLocationType.cs b/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumCustomerLocationType.cs index ac96a401..9c5d3a94 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumCustomerLocationType.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumCustomerLocationType.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums.SettleAccount +namespace Win.Sfs.Shared.Enums.SettleAccount { /// /// 客户库位的类型 @@ -20,6 +20,5 @@ /// All = 2, - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumMaterialProperty.cs b/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumMaterialProperty.cs index 81cd2533..e88953ac 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumMaterialProperty.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumMaterialProperty.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums.SettleAccount +namespace Win.Sfs.Shared.Enums.SettleAccount { /// /// 物料属性 @@ -13,7 +13,7 @@ /// /// 自制件 /// - 自制件 , + 自制件, /// /// CKD件 @@ -30,4 +30,4 @@ /// 平衡块, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumSettleStatus.cs b/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumSettleStatus.cs index bfca8037..a3b40f52 100644 --- a/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumSettleStatus.cs +++ b/code/src/Shared/Win.Sfs.Shared/Enums/SettleAccount/EnumSettleStatus.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Enums.SettleAccount +namespace Win.Sfs.Shared.Enums.SettleAccount { /// /// 结算状态 @@ -26,4 +26,4 @@ 预批量 = 3, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Etos/EntityDemoEto.cs b/code/src/Shared/Win.Sfs.Shared/Etos/EntityDemoEto.cs index 94bfe8df..f8082607 100644 --- a/code/src/Shared/Win.Sfs.Shared/Etos/EntityDemoEto.cs +++ b/code/src/Shared/Win.Sfs.Shared/Etos/EntityDemoEto.cs @@ -1,18 +1,12 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace Win.Sfs.Shared.Etos { - public class EntityDemoEto + public class EntityDemoEto { public object bill { get; set; } - public List details { get; set; } } diff --git a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeCreateListEto.cs b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeCreateListEto.cs index 79bf80dc..080b9545 100644 --- a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeCreateListEto.cs +++ b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeCreateListEto.cs @@ -1,8 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.Shared.Etos.Purchase { diff --git a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDeleteListEto.cs b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDeleteListEto.cs index 5402f827..8f5c60d9 100644 --- a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDeleteListEto.cs +++ b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDeleteListEto.cs @@ -1,13 +1,9 @@ -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Win.Sfs.Shared.Etos.Purchase { public class AdvanceShippingNoticeDeleteListEto { - public List List { set; get; } + public List List { set; get; } } } diff --git a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDetailEto.cs b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDetailEto.cs index 1b165ccb..708b72c5 100644 --- a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDetailEto.cs +++ b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeDetailEto.cs @@ -1,15 +1,11 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.Shared.Etos.Purchase { public class AdvanceShippingNoticeDetailEto { - + /// /// Kanban单号 /// @@ -28,7 +24,6 @@ namespace Win.Sfs.Shared.Etos.Purchase /// public virtual UomBase Uom { set; get; } - /// /// 标包数 /// @@ -75,13 +70,11 @@ namespace Win.Sfs.Shared.Etos.Purchase /// public virtual string ProjectCode { get; set; } - /// /// 上级单据ID /// public virtual Guid ParentId { get; set; } - /// /// 备注 /// diff --git a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeEto.cs b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeEto.cs index ba1e29c7..01935093 100644 --- a/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeEto.cs +++ b/code/src/Shared/Win.Sfs.Shared/Etos/Purchase/AdvanceShippingNoticeEto.cs @@ -1,16 +1,10 @@ -using JetBrains.Annotations; using System; using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Guids; using Win.Sfs.Shared.DomainBase; namespace Win.Sfs.Shared.Etos.Purchase { - public class AdvanceShippingNoticeEto + public class AdvanceShippingNoticeEto { /// /// 分支ID @@ -46,16 +40,13 @@ namespace Win.Sfs.Shared.Etos.Purchase /// public string ReceiptPortCode { set; get; } - /// /// 备注 /// public string Remark { get; set; } - public virtual ICollection Details { set; get; } - /// /// 计划时间(到货时间)时间窗口开始 /// @@ -68,8 +59,8 @@ namespace Win.Sfs.Shared.Etos.Purchase /// 发货日期 /// public virtual DateTime ShipDate { private set; get; } - - public virtual Employee ShipUser { set; get; } + + public virtual Employee ShipUser { set; get; } /// /// 订单编号 /// @@ -84,7 +75,6 @@ namespace Win.Sfs.Shared.Etos.Purchase /// public string SupplierCode { get; set; } - /// /// 父节点ID /// diff --git a/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterAction.cs b/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterAction.cs index f68cf933..a87e1c9d 100644 --- a/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterAction.cs +++ b/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterAction.cs @@ -1,4 +1,4 @@ -using System.ComponentModel; +using System.ComponentModel; namespace Win.Sfs.Shared.Filter { @@ -60,4 +60,4 @@ namespace Win.Sfs.Shared.Filter /// [Description("不包含于")] NotIn = 9, } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterLogic.cs b/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterLogic.cs index 09f92c22..6db6eba6 100644 --- a/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterLogic.cs +++ b/code/src/Shared/Win.Sfs.Shared/Filter/EnumFilterLogic.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Filter +namespace Win.Sfs.Shared.Filter { /// /// 过滤逻辑 @@ -8,11 +8,11 @@ /// /// 与 /// - And=0, + And = 0, /// /// 或 /// - Or=1 + Or = 1 } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Filter/FilterCondition.cs b/code/src/Shared/Win.Sfs.Shared/Filter/FilterCondition.cs index 6a380d7b..12b1e828 100644 --- a/code/src/Shared/Win.Sfs.Shared/Filter/FilterCondition.cs +++ b/code/src/Shared/Win.Sfs.Shared/Filter/FilterCondition.cs @@ -1,4 +1,4 @@ -namespace Win.Sfs.Shared.Filter +namespace Win.Sfs.Shared.Filter { public class FilterCondition { @@ -36,4 +36,4 @@ /// public string Value { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs b/code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs index 5dd3e149..1222373c 100644 --- a/code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs +++ b/code/src/Shared/Win.Sfs.Shared/Filter/FilterExtensions.cs @@ -64,7 +64,7 @@ namespace Win.Sfs.Shared.Filter throw new Exception($"获取筛选条件异常:{ex.Message}"); } - return condition == null ? p => true : condition; + return condition ?? (p => true); } private static Expression> CreateLambda(FilterCondition filterCondition) @@ -145,7 +145,7 @@ namespace Win.Sfs.Shared.Filter /// private static ConstantExpression CreateConstantExpression(Type propertyType, string value) { - ConstantExpression constant = null; + ConstantExpression constant; try { if (propertyType.IsGenericType && @@ -196,12 +196,6 @@ namespace Win.Sfs.Shared.Filter return Expression.Lambda>(notMethodExpression, parameterExpression); } - private static object GetPropertyValue(Type propertyType, string value) - { - Type lstType = typeof(List<>).MakeGenericType(propertyType); - return JsonSerializer.Deserialize(value, lstType); - } - /// /// 生成guidList.Contains(p=>p.GUId); /// 除String类型,其他类型涉及到类型转换.如GUID diff --git a/code/src/Shared/Win.Sfs.Shared/IBranch.cs b/code/src/Shared/Win.Sfs.Shared/IBranch.cs index 0fdc910d..b6507ea9 100644 --- a/code/src/Shared/Win.Sfs.Shared/IBranch.cs +++ b/code/src/Shared/Win.Sfs.Shared/IBranch.cs @@ -1,9 +1,7 @@ -using System; - namespace Win.Sfs.Shared { public interface IBranch { TKey BranchId { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/IEnabled.cs b/code/src/Shared/Win.Sfs.Shared/IEnabled.cs index 20e7ecbe..126e6dd7 100644 --- a/code/src/Shared/Win.Sfs.Shared/IEnabled.cs +++ b/code/src/Shared/Win.Sfs.Shared/IEnabled.cs @@ -1,7 +1,7 @@ -namespace Win.Sfs.Shared +namespace Win.Sfs.Shared { public interface IEnabled { bool Enabled { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/IRemark.cs b/code/src/Shared/Win.Sfs.Shared/IRemark.cs index 37b6a623..54538207 100644 --- a/code/src/Shared/Win.Sfs.Shared/IRemark.cs +++ b/code/src/Shared/Win.Sfs.Shared/IRemark.cs @@ -1,7 +1,7 @@ -namespace Win.Sfs.Shared +namespace Win.Sfs.Shared { public interface IRemark { string Remark { get; set; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/DbSetExtensions.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/DbSetExtensions.cs index 8b5a75fb..b5b0269f 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/DbSetExtensions.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/DbSetExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; @@ -80,7 +80,7 @@ namespace Win.Sfs.Shared.RepositoryBase if (!keyIgnoreFields.Any()) { var idName = dataType.Name + "Id"; - keyIgnoreFields = dataType.GetProperties().Where(p => p.Name.Equals("Id", StringComparison.OrdinalIgnoreCase) + keyIgnoreFields = dataType.GetProperties().Where(p => p.Name.Equals("Id", StringComparison.OrdinalIgnoreCase) || p.Name.Equals(idName, StringComparison.OrdinalIgnoreCase) ).ToList(); } @@ -113,14 +113,13 @@ namespace Win.Sfs.Shared.RepositoryBase private static Expression ReplaceParameter(Expression oldExpression, ParameterExpression newParameter) { - return oldExpression.NodeType switch { + return oldExpression.NodeType switch + { ExpressionType.MemberAccess => Expression.MakeMemberAccess(newParameter, ((MemberExpression)oldExpression).Member), ExpressionType.New => Expression.New(((NewExpression)oldExpression).Constructor, ((NewExpression)oldExpression).Arguments.Select(a => ReplaceParameter(a, newParameter)).ToArray()), _ => throw new NotSupportedException("不支持的表达式类型:" + oldExpression.NodeType) }; } - - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBaseDataExtentRepository.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBaseDataExtentRepository.cs index b4e01fcd..5e48c08c 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBaseDataExtentRepository.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBaseDataExtentRepository.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -14,4 +14,4 @@ namespace Win.Sfs.Shared.RepositoryBase bool includeDetails = false, CancellationToken cancellationToken = default); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBranchEfCoreRepository.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBranchEfCoreRepository.cs index 42548118..01e9ffc7 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBranchEfCoreRepository.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IBranchEfCoreRepository.cs @@ -1,6 +1,4 @@ -using System; using System.Collections.Generic; -using System.Linq; using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -12,7 +10,7 @@ namespace Win.Sfs.Shared.RepositoryBase public interface IBranchEfCoreRepository : IWinEfCoreRepository , ITransientDependency - where TEntity : class,IBranch, IEntity + where TEntity : class, IBranch, IEntity { Task> GetAllAsync( TKey branchId, @@ -28,7 +26,6 @@ namespace Win.Sfs.Shared.RepositoryBase List filters, CancellationToken cancellationToken = default); - Task> GetListByFilterAsync( TKey branchId, List filters, @@ -39,4 +36,4 @@ namespace Win.Sfs.Shared.RepositoryBase CancellationToken cancellationToken = default); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/INormalEfCoreRepository.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/INormalEfCoreRepository.cs index 68b7635c..03be3c33 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/INormalEfCoreRepository.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/INormalEfCoreRepository.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; @@ -30,4 +30,4 @@ namespace Win.Sfs.Shared.RepositoryBase CancellationToken cancellationToken = default); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IWinEfCoreRepository.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IWinEfCoreRepository.cs index c7ee1754..4144ef27 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IWinEfCoreRepository.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/IWinEfCoreRepository.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Threading; @@ -8,8 +8,8 @@ using Volo.Abp.Domain.Repositories.EntityFrameworkCore; namespace Win.Sfs.Shared.RepositoryBase { - public interface IWinEfCoreRepository - : IEfCoreRepository + public interface IWinEfCoreRepository + : IEfCoreRepository where TEntity : class, IEntity { @@ -23,4 +23,4 @@ namespace Win.Sfs.Shared.RepositoryBase CancellationToken cancellationToken = default); } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/QueryableExtension.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/QueryableExtension.cs index 26f4bd6f..98b03a53 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/QueryableExtension.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/QueryableExtension.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Linq.Expressions; @@ -40,21 +40,22 @@ namespace Win.Sfs.Shared.RepositoryBase string methodName; if (n == 0) + { methodName = orderExpr.Value ? "OrderByInternal" : "OrderByDescendingInternal"; + } else + { methodName = orderExpr.Value ? "ThenByInternal" : "ThenByDescendingInternal"; + } + var method = typeof(QueryableExtension).GetMethod(methodName)?.MakeGenericMethod(typeof(T), memberProp?.PropertyType); tempQuery = method?.Invoke(null, new object[] { tempQuery, memberProp }); n++; } - - return (IOrderedQueryable)tempQuery; } - - public static IOrderedQueryable OrderByInternal(IQueryable query, PropertyInfo memberProperty) {//public return query.OrderBy(_GetLambda(memberProperty)); @@ -75,7 +76,10 @@ namespace Win.Sfs.Shared.RepositoryBase private static Expression> _GetLambda(PropertyInfo memberProperty) { - if (memberProperty.PropertyType != typeof(TProp)) throw new Exception(); + if (memberProperty.PropertyType != typeof(TProp)) + { + throw new Exception(); + } var thisArg = Expression.Parameter(typeof(T)); var lamba = Expression.Lambda>(Expression.Property(thisArg, memberProperty), thisArg); @@ -83,6 +87,5 @@ namespace Win.Sfs.Shared.RepositoryBase return lamba; } - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/UpdateIgnoreAttribute.cs b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/UpdateIgnoreAttribute.cs index 61c75bd4..8e224a9d 100644 --- a/code/src/Shared/Win.Sfs.Shared/RepositoryBase/UpdateIgnoreAttribute.cs +++ b/code/src/Shared/Win.Sfs.Shared/RepositoryBase/UpdateIgnoreAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Win.Sfs.Shared.RepositoryBase { @@ -9,4 +9,4 @@ namespace Win.Sfs.Shared.RepositoryBase public sealed class UpdateIgnoreAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Sfs.Shared/SharedModule.cs b/code/src/Shared/Win.Sfs.Shared/SharedModule.cs index e098fbfd..249b4512 100644 --- a/code/src/Shared/Win.Sfs.Shared/SharedModule.cs +++ b/code/src/Shared/Win.Sfs.Shared/SharedModule.cs @@ -1,6 +1,6 @@ -using Volo.Abp.Modularity; +using Volo.Abp.Modularity; namespace Win.Sfs.Shared { public class SharedModule : AbpModule { } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/AddBranchIdHeaderAttribute.cs b/code/src/Shared/Win.Utils/AddBranchIdHeaderAttribute.cs index c04899b9..b9c9d66b 100644 --- a/code/src/Shared/Win.Utils/AddBranchIdHeaderAttribute.cs +++ b/code/src/Shared/Win.Utils/AddBranchIdHeaderAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Win.Utils { @@ -9,7 +9,7 @@ namespace Win.Utils public string DefaultValue { get; } public bool IsRequired { get; } - public AddBranchIdHeaderAttribute(bool isRequired = false,string headerName=null, string description = null, string defaultValue = null) + public AddBranchIdHeaderAttribute(bool isRequired = false, string headerName = null, string description = null, string defaultValue = null) { HeaderName = headerName; Description = description; @@ -17,7 +17,5 @@ namespace Win.Utils IsRequired = isRequired; } - - } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/BranchHeaderConsts.cs b/code/src/Shared/Win.Utils/BranchHeaderConsts.cs index acfa3de2..b290d079 100644 --- a/code/src/Shared/Win.Utils/BranchHeaderConsts.cs +++ b/code/src/Shared/Win.Utils/BranchHeaderConsts.cs @@ -1,4 +1,4 @@ -namespace Win.Utils +namespace Win.Utils { public class BranchHeaderConsts { @@ -6,4 +6,4 @@ public const string HeaderDescription = "Branch Id"; } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/BranchHeaderParameter.cs b/code/src/Shared/Win.Utils/BranchHeaderParameter.cs index 56cb4f3f..13528177 100644 --- a/code/src/Shared/Win.Utils/BranchHeaderParameter.cs +++ b/code/src/Shared/Win.Utils/BranchHeaderParameter.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Reflection; using Microsoft.OpenApi.Any; @@ -71,11 +71,11 @@ namespace Win.Utils operation.Parameters.Add(new OpenApiParameter { - Name = BranchHeaderConsts.HeaderName, + Name = BranchHeaderConsts.HeaderName, In = ParameterLocation.Header, - Description = BranchHeaderConsts.HeaderDescription, + Description = BranchHeaderConsts.HeaderDescription, Required = false, - Schema = new OpenApiSchema + Schema = new OpenApiSchema { Type = "String", Default = new OpenApiString(_defaultValue) @@ -85,4 +85,4 @@ namespace Win.Utils } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/DateTimeConverterUsingDateTimeParse.cs b/code/src/Shared/Win.Utils/DateTimeConverterUsingDateTimeParse.cs index b2167711..5e6af2e4 100644 --- a/code/src/Shared/Win.Utils/DateTimeConverterUsingDateTimeParse.cs +++ b/code/src/Shared/Win.Utils/DateTimeConverterUsingDateTimeParse.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text.Json; using System.Text.Json.Serialization; @@ -16,4 +16,4 @@ namespace Win.Utils writer.WriteStringValue(value.ToString("yyyy-MM-dd HH:mm:ss")); } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/DatetimeJsonConverter.cs b/code/src/Shared/Win.Utils/DatetimeJsonConverter.cs index de2b37f9..01e85bad 100644 --- a/code/src/Shared/Win.Utils/DatetimeJsonConverter.cs +++ b/code/src/Shared/Win.Utils/DatetimeJsonConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text.Json; using System.Text.Json.Serialization; @@ -32,4 +32,4 @@ namespace Win.Utils } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/NullableDatetimeJsonConverter.cs b/code/src/Shared/Win.Utils/NullableDatetimeJsonConverter.cs index 2b673a41..0ae44fa0 100644 --- a/code/src/Shared/Win.Utils/NullableDatetimeJsonConverter.cs +++ b/code/src/Shared/Win.Utils/NullableDatetimeJsonConverter.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Text.Json; using System.Text.Json.Serialization; @@ -21,8 +21,10 @@ namespace Win.Utils public override void Write(Utf8JsonWriter writer, DateTime? value, JsonSerializerOptions options) { - if(value==null) + if (value == null) + { writer.WriteNullValue(); + } else { var valueValue = value.Value; @@ -37,4 +39,4 @@ namespace Win.Utils } } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/SerializeExtensions.cs b/code/src/Shared/Win.Utils/SerializeExtensions.cs index 179b9991..be3be928 100644 --- a/code/src/Shared/Win.Utils/SerializeExtensions.cs +++ b/code/src/Shared/Win.Utils/SerializeExtensions.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Text; using System.Text.Json; @@ -17,7 +17,7 @@ namespace Win.Utils var options = new JsonSerializerOptions() { IgnoreNullValues = ignoreNull, - Converters = { new DateTimeConverterUsingDateTimeParse() }, + Converters = { new DateTimeConverterUsingDateTimeParse() }, }; return JsonSerializer.Serialize(obj, options); } @@ -64,4 +64,4 @@ namespace Win.Utils return JsonSerializer.Deserialize>(jsonStr); } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/SwaggerHeaderAttribute.cs b/code/src/Shared/Win.Utils/SwaggerHeaderAttribute.cs index 8415d175..e9d281ff 100644 --- a/code/src/Shared/Win.Utils/SwaggerHeaderAttribute.cs +++ b/code/src/Shared/Win.Utils/SwaggerHeaderAttribute.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace Win.Utils { @@ -17,4 +17,4 @@ namespace Win.Utils IsRequired = isRequired; } } -} \ No newline at end of file +} diff --git a/code/src/Shared/Win.Utils/SwaggerHeaderFilter.cs b/code/src/Shared/Win.Utils/SwaggerHeaderFilter.cs index b0256bf3..40fc5ac2 100644 --- a/code/src/Shared/Win.Utils/SwaggerHeaderFilter.cs +++ b/code/src/Shared/Win.Utils/SwaggerHeaderFilter.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; using System.Reflection; using Microsoft.OpenApi.Any; @@ -39,4 +39,4 @@ namespace Win.Utils } } } -} \ No newline at end of file +}