From 7505bf77cf4632bdc513e1b7f6e409eff9d022fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E8=8D=A3=E5=9B=BD?= Date: Fri, 22 Oct 2021 13:25:47 +0800 Subject: [PATCH] [init] --- .gitattributes | 1 + .gitignore | 259 +++++ Management/.gitattributes | 1 + Management/.gitignore | 259 +++++ Management/.prettierrc | 5 + Management/NuGet.Config | 6 + Management/Win_in.Sfs.Scp.Management.sln | 104 ++ .../Win_in.Sfs.Scp.Management.sln.DotSettings | 23 + Management/common.props | 24 + Management/database/Dockerfile | 20 + Management/database/entrypoint.sh | 12 + Management/docker-compose.migrations.yml | 13 + Management/docker-compose.override.yml | 29 + Management/docker-compose.yml | 25 + .../Controllers/HomeController.cs | 13 + .../Dockerfile | 18 + ...anagementHttpApiHostMigrationsDbContext.cs | 21 + ...ntHttpApiHostMigrationsDbContextFactory.cs | 29 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementHttpApiHostModule.cs | 196 ++++ .../Program.cs | 59 ++ .../Properties/launchSettings.json | 12 + .../Startup.cs | 21 + ..._in.Sfs.Scp.Management.HttpApi.Host.csproj | 43 + .../appsettings.json | 20 + .../appsettings.secrets.json | 2 + .../yarn.lock | 4 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementApplicationContractsModule.cs | 16 + .../ManagementPermissionDefinitionProvider.cs | 19 + .../Permissions/ManagementPermissions.cs | 14 + .../Samples/ISampleAppService.cs | 12 + .../Samples/SampleDto.cs | 7 + ...cp.Management.Application.Contracts.csproj | 16 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementAppService.cs | 14 + .../ManagementApplicationAutoMapperProfile.cs | 14 + .../ManagementApplicationModule.cs | 25 + .../Samples/SampleAppService.cs | 29 + ...n_in.Sfs.Scp.Management.Application.csproj | 17 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../Localization/Management/ar.json | 7 + .../Localization/Management/cs.json | 7 + .../Localization/Management/de-DE.json | 7 + .../Localization/Management/en-GB.json | 7 + .../Localization/Management/en.json | 7 + .../Localization/Management/es.json | 7 + .../Localization/Management/fi.json | 7 + .../Localization/Management/fr.json | 7 + .../Localization/Management/hi.json | 7 + .../Localization/Management/hu.json | 7 + .../Localization/Management/it.json | 7 + .../Localization/Management/nl.json | 7 + .../Localization/Management/pl-PL.json | 6 + .../Localization/Management/pt-BR.json | 6 + .../Localization/Management/sk.json | 6 + .../Localization/Management/sl.json | 6 + .../Localization/Management/tr.json | 7 + .../Localization/Management/vi.json | 6 + .../Localization/Management/zh-Hans.json | 7 + .../Localization/Management/zh-Hant.json | 6 + .../Localization/ManagementResource.cs | 10 + .../ManagementDomainSharedModule.cs | 37 + .../ManagementErrorCodes.cs | 7 + ...in.Sfs.Scp.Management.Domain.Shared.csproj | 24 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementDbProperties.cs | 11 + .../ManagementDomainModule.cs | 14 + .../ManagementSettingDefinitionProvider.cs | 14 + .../Settings/ManagementSettings.cs | 11 + .../Win_in.Sfs.Scp.Management.Domain.csproj | 15 + .../IManagementDbContext.cs | 13 + .../ManagementDbContext.cs | 27 + ...agementDbContextModelCreatingExtensions.cs | 43 + .../ManagementEntityFrameworkCoreModule.cs | 23 + ...agementModelBuilderConfigurationOptions.cs | 18 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ....Scp.Management.EntityFrameworkCore.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementController.cs | 13 + .../ManagementHttpApiModule.cs | 33 + .../Samples/SampleController.cs | 33 + .../Win_in.Sfs.Scp.Management.HttpApi.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementApplicationTestBase.cs | 10 + .../ManagementApplicationTestModule.cs | 13 + .../Samples/SampleAppService_Tests.cs | 30 + ...fs.Scp.Management.Application.Tests.csproj | 16 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementDomainTestBase.cs | 10 + .../ManagementDomainTestModule.cs | 17 + .../Samples/SampleManager_Tests.cs | 21 + ..._in.Sfs.Scp.Management.Domain.Tests.csproj | 15 + .../ManagementEntityFrameworkCoreTestBase.cs | 10 + ...ManagementEntityFrameworkCoreTestModule.cs | 43 + .../Samples/SampleRepository_Tests.cs | 12 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ...anagement.EntityFrameworkCore.Tests.csproj | 18 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../ManagementDataSeedContributor.cs | 33 + .../ManagementTestBase.cs | 60 ++ .../ManagementTestBaseModule.cs | 42 + .../Samples/SampleRepository_Tests.cs | 27 + .../Security/FakeCurrentPrincipalAccessor.cs | 43 + .../Win_in.Sfs.Scp.Management.TestBase.csproj | 23 + ScpWebApiService/.gitattributes | 1 + ScpWebApiService/.gitignore | 259 +++++ ScpWebApiService/.prettierrc | 5 + ScpWebApiService/NuGet.Config | 6 + ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln | 104 ++ .../Win_in.Sfs.Scp.WebApi.sln.DotSettings | 26 + ScpWebApiService/common.props | 24 + ScpWebApiService/database/Dockerfile | 20 + ScpWebApiService/database/entrypoint.sh | 12 + .../docker-compose.migrations.yml | 13 + ScpWebApiService/docker-compose.override.yml | 29 + ScpWebApiService/docker-compose.yml | 25 + .../Controllers/HomeController.cs | 13 + .../Dockerfile | 18 + .../WebApiHttpApiHostMigrationsDbContext.cs | 21 + ...piHttpApiHostMigrationsDbContextFactory.cs | 29 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../20211021072716_20211021001.Designer.cs | 759 +++++++++++++ .../Migrations/20211021072716_20211021001.cs | 291 +++++ .../20211021081413_20211021002.Designer.cs | 728 +++++++++++++ .../Migrations/20211021081413_20211021002.cs | 363 +++++++ ...ApiHostMigrationsDbContextModelSnapshot.cs | 726 +++++++++++++ .../Program.cs | 59 ++ .../Properties/launchSettings.json | 12 + .../Startup.cs | 22 + .../WebApiHttpApiHostModule.cs | 287 +++++ .../Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj | 47 + .../appsettings.json | 20 + .../appsettings.secrets.json | 20 + .../yarn.lock | 4 + .../ASNs/ASNCreateDTO.cs | 7 + .../ASNs/ASNCreateOrUpdateDTOBase.cs | 10 + .../ASNs/ASNDTO.cs | 10 + .../ASNs/ASNUpdateDTO.cs | 7 + .../ASNs/IASNAppService.cs | 10 + .../AbpPractice.cs | 12 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../InputDTO.cs | 9 + .../POs/IPOAppService.cs | 18 + .../POs/POCreateDTO.cs | 10 + .../POs/POCreateOrUpdateDTOBase.cs | 103 ++ .../POs/PODTO.cs | 107 ++ .../POs/PODetailDTO.cs | 91 ++ .../POs/POUpdateDTO.cs | 10 + .../Parts/IPartAppService.cs | 19 + .../Parts/PartCreateDTO.cs | 16 + .../Parts/PartCreateOrUpdateDTOBase.cs | 148 +++ .../Parts/PartDTO.cs | 152 +++ .../Parts/PartUpdateDTO.cs | 10 + .../WebApiPermissionDefinitionProvider.cs | 20 + .../Permissions/WebApiPermissions.cs | 17 + .../Receipts/IReceiptAppService.cs | 12 + .../Receipts/ReceiptCreateDTO.cs | 7 + .../Receipts/ReceiptCreateOrUpdateDTOBase.cs | 172 +++ .../Receipts/ReceiptDTO.cs | 172 +++ .../Receipts/ReceiptUpdateDTO.cs | 9 + .../Samples/ISampleAppService.cs | 12 + .../Samples/SampleDto.cs | 7 + .../SupplierParts/ISupplierPartAppService.cs | 13 + .../SupplierParts/SupplierPartCreateDTO.cs | 7 + .../SupplierPartCreateOrUpdateDTOBase.cs | 47 + .../SupplierParts/SupplierPartDto.cs | 46 + .../SupplierParts/SupplierPartUpdateDTO.cs | 9 + .../Suppliers/ISupplierAppService.cs | 13 + .../Suppliers/SupplierCreateDTO.cs | 7 + .../SupplierCreateOrUpdateDTOBase.cs | 100 ++ .../Suppliers/SupplierDTO.cs | 100 ++ .../Suppliers/SupplierUpdateDTO.cs | 7 + .../WebApiApplicationContractsModule.cs | 16 + ...fs.Scp.WebApi.Application.Contracts.csproj | 25 + ...n.Sfs.Scp.WebApi.Application.Contracts.xml | 998 ++++++++++++++++++ .../ASNs/ASNAppService.cs | 29 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../POs/POAppService.cs | 88 ++ .../Parts/PartAppService.cs | 88 ++ .../Receipts/ReceiptAppService.cs | 89 ++ .../Samples/SampleAppService.cs | 29 + .../SupplierParts/SupplierPartAppService.cs | 89 ++ .../Suppliers/SuppliersAppService.cs | 90 ++ .../WebApiAppService.cs | 14 + .../WebApiApplicationAutoMapperProfile.cs | 90 ++ .../WebApiApplicationModule.cs | 25 + .../Win_in.Sfs.Scp.WebApi.Application.csproj | 27 + .../Win_in.Sfs.Scp.WebApi.Application.xml | 235 +++++ .../EntityBase/EntityBase.cs | 22 + .../EntityBase/EntityDetailBase.cs | 22 + .../EntityBase/EntityDetailDtoBase.cs | 18 + .../EntityBase/EntityDtoBase.cs | 23 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../Localization/WebApi/ar.json | 7 + .../Localization/WebApi/cs.json | 7 + .../Localization/WebApi/de-DE.json | 7 + .../Localization/WebApi/en-GB.json | 7 + .../Localization/WebApi/en.json | 7 + .../Localization/WebApi/es.json | 7 + .../Localization/WebApi/fi.json | 7 + .../Localization/WebApi/fr.json | 7 + .../Localization/WebApi/hi.json | 7 + .../Localization/WebApi/hu.json | 7 + .../Localization/WebApi/it.json | 7 + .../Localization/WebApi/nl.json | 7 + .../Localization/WebApi/pl-PL.json | 6 + .../Localization/WebApi/pt-BR.json | 6 + .../Localization/WebApi/sk.json | 6 + .../Localization/WebApi/sl.json | 6 + .../Localization/WebApi/tr.json | 7 + .../Localization/WebApi/vi.json | 6 + .../Localization/WebApi/zh-Hans.json | 7 + .../Localization/WebApi/zh-Hant.json | 6 + .../Localization/WebApiResource.cs | 10 + .../WebApiDomainSharedModule.cs | 37 + .../WebApiErrorCodes.cs | 7 + ...Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj | 26 + .../Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs | 10 + .../ASNs/IASNRepository.cs | 10 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../POs/IPORepository.cs | 10 + .../Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs | 169 +++ .../POs/PODetail.cs | 113 ++ .../Parts/IPartRepository.cs | 10 + .../Parts/Part.cs | 157 +++ .../Receipts/IReceiptRepository.cs | 10 + .../Receipts/Receipt.cs | 175 +++ .../WebApiSettingDefinitionProvider.cs | 14 + .../Settings/WebApiSettings.cs | 11 + .../SupplierParts/ISupplierRepository.cs | 10 + .../SupplierParts/SupplierPart.cs | 49 + .../Suppliers/ISupplierPartRepository.cs | 10 + .../Suppliers/Supplier.cs | 103 ++ .../WebApiDbProperties.cs | 11 + .../WebApiDomainModule.cs | 14 + .../Win_in.Sfs.Scp.WebApi.Domain.csproj | 15 + .../EntityFrameworkCore/IWebApiDbContext.cs | 21 + .../EntityFrameworkCore/WebApiDbContext.cs | 36 + .../WebApiDbContextModelCreatingExtensions.cs | 270 +++++ .../WebApiEntityFrameworkCoreModule.cs | 23 + .../WebApiModelBuilderConfigurationOptions.cs | 18 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ....Sfs.Scp.WebApi.EntityFrameworkCore.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../Samples/SampleController.cs | 34 + .../WebApiController.cs | 13 + .../WebApiHttpApiModule.cs | 36 + .../Win_in.Sfs.Scp.WebApi.HttpApi.csproj | 19 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../Samples/SampleAppService_Tests.cs | 30 + .../WebApiApplicationTestBase.cs | 10 + .../WebApiApplicationTestModule.cs | 13 + ...in.Sfs.Scp.WebApi.Application.Tests.csproj | 16 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../Samples/SampleManager_Tests.cs | 21 + .../WebApiDomainTestBase.cs | 10 + .../WebApiDomainTestModule.cs | 17 + .../Win_in.Sfs.Scp.WebApi.Domain.Tests.csproj | 15 + .../Samples/SampleRepository_Tests.cs | 12 + .../WebApiEntityFrameworkCoreTestBase.cs | 10 + .../WebApiEntityFrameworkCoreTestModule.cs | 43 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + ...cp.WebApi.EntityFrameworkCore.Tests.csproj | 18 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 + .../Samples/SampleRepository_Tests.cs | 27 + .../Security/FakeCurrentPrincipalAccessor.cs | 43 + .../WebApiDataSeedContributor.cs | 33 + .../WebApiTestBase.cs | 60 ++ .../WebApiTestBaseModule.cs | 42 + .../Win_in.Sfs.Scp.WebApi.TestBase.csproj | 23 + 293 files changed, 12610 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Management/.gitattributes create mode 100644 Management/.gitignore create mode 100644 Management/.prettierrc create mode 100644 Management/NuGet.Config create mode 100644 Management/Win_in.Sfs.Scp.Management.sln create mode 100644 Management/Win_in.Sfs.Scp.Management.sln.DotSettings create mode 100644 Management/common.props create mode 100644 Management/database/Dockerfile create mode 100644 Management/database/entrypoint.sh create mode 100644 Management/docker-compose.migrations.yml create mode 100644 Management/docker-compose.override.yml create mode 100644 Management/docker-compose.yml create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Controllers/HomeController.cs create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Dockerfile create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContext.cs create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContextFactory.cs create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xml create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xsd create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/ManagementHttpApiHostModule.cs create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Program.cs create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Properties/launchSettings.json create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Startup.cs create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Win_in.Sfs.Scp.Management.HttpApi.Host.csproj create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.json create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.secrets.json create mode 100644 Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/yarn.lock create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xml create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xsd create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/ManagementApplicationContractsModule.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissionDefinitionProvider.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissions.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/ISampleAppService.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/SampleDto.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Win_in.Sfs.Scp.Management.Application.Contracts.csproj create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xml create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xsd create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/ManagementAppService.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationAutoMapperProfile.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationModule.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/Samples/SampleAppService.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Application/Win_in.Sfs.Scp.Management.Application.csproj create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xml create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xsd create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/ar.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/cs.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/de-DE.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en-GB.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/es.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fi.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fr.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hi.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hu.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/it.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/nl.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pl-PL.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pt-BR.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sk.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sl.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/tr.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/vi.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hans.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hant.json create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/ManagementResource.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementDomainSharedModule.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementErrorCodes.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Win_in.Sfs.Scp.Management.Domain.Shared.csproj create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xml create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xsd create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDbProperties.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDomainModule.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettingDefinitionProvider.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettings.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.Domain/Win_in.Sfs.Scp.Management.Domain.csproj create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/IManagementDbContext.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContext.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContextModelCreatingExtensions.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementEntityFrameworkCoreModule.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementModelBuilderConfigurationOptions.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xml create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/Win_in.Sfs.Scp.Management.EntityFrameworkCore.csproj create mode 100644 Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xml create mode 100644 Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xsd create mode 100644 Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementController.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementHttpApiModule.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.HttpApi/Samples/SampleController.cs create mode 100644 Management/src/Win_in.Sfs.Scp.Management.HttpApi/Win_in.Sfs.Scp.Management.HttpApi.csproj create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xml create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xsd create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestBase.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestModule.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Samples/SampleAppService_Tests.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Win_in.Sfs.Scp.Management.Application.Tests.csproj create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xml create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xsd create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestBase.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestModule.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Samples/SampleManager_Tests.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Win_in.Sfs.Scp.Management.Domain.Tests.csproj create mode 100644 Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestBase.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestModule.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xml create mode 100644 Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xsd create mode 100644 Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests.csproj create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xml create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xsd create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementDataSeedContributor.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBase.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBaseModule.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/Samples/SampleRepository_Tests.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/Security/FakeCurrentPrincipalAccessor.cs create mode 100644 Management/test/Win_in.Sfs.Scp.Management.TestBase/Win_in.Sfs.Scp.Management.TestBase.csproj create mode 100644 ScpWebApiService/.gitattributes create mode 100644 ScpWebApiService/.gitignore create mode 100644 ScpWebApiService/.prettierrc create mode 100644 ScpWebApiService/NuGet.Config create mode 100644 ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln create mode 100644 ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln.DotSettings create mode 100644 ScpWebApiService/common.props create mode 100644 ScpWebApiService/database/Dockerfile create mode 100644 ScpWebApiService/database/entrypoint.sh create mode 100644 ScpWebApiService/docker-compose.migrations.yml create mode 100644 ScpWebApiService/docker-compose.override.yml create mode 100644 ScpWebApiService/docker-compose.yml create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Controllers/HomeController.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Dockerfile create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContext.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContextFactory.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xml create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xsd create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Properties/launchSettings.json create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Startup.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.secrets.json create mode 100644 ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/yarn.lock create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNUpdateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/AbpPractice.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xsd create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/InputDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissionDefinitionProvider.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissions.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/ISampleAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/SampleDto.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/ISupplierPartAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateOrUpdateDTOBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartDto.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartUpdateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/WebApiApplicationContractsModule.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xsd create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Samples/SampleAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/SupplierParts/SupplierPartAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationModule.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xsd create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hans.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApiResource.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiDomainSharedModule.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiErrorCodes.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNRepository.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xsd create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/IPartRepository.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/IReceiptRepository.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/Receipt.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettingDefinitionProvider.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/ISupplierRepository.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/SupplierPart.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/Supplier.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDbProperties.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDomainModule.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiModelBuilderConfigurationOptions.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xml create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xsd create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Samples/SampleController.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiController.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs create mode 100644 ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xml create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xsd create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Samples/SampleAppService_Tests.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestBase.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestModule.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Win_in.Sfs.Scp.WebApi.Application.Tests.csproj create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xml create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xsd create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Samples/SampleManager_Tests.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestBase.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestModule.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Win_in.Sfs.Scp.WebApi.Domain.Tests.csproj create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestBase.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestModule.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xml create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xsd create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests.csproj create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xml create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xsd create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Samples/SampleRepository_Tests.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Security/FakeCurrentPrincipalAccessor.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiDataSeedContributor.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBase.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBaseModule.cs create mode 100644 ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Win_in.Sfs.Scp.WebApi.TestBase.csproj diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..c941e52 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1e4186d --- /dev/null +++ b/.gitignore @@ -0,0 +1,259 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# Basedata +host/Win_in.Sfs.Basedata.IdentityServer/Logs/logs.txt +host/Win_in.Sfs.Basedata.HttpApi.Host/Logs/logs.txt +host/Win_in.Sfs.Basedata.Web.Host/Logs/logs.txt +host/Win_in.Sfs.Basedata.Web.Unified/Logs/logs.txt +host/Win_in.Sfs.Basedata.Blazor.Server.Host/Logs/logs.txt \ No newline at end of file diff --git a/Management/.gitattributes b/Management/.gitattributes new file mode 100644 index 0000000..c941e52 --- /dev/null +++ b/Management/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/Management/.gitignore b/Management/.gitignore new file mode 100644 index 0000000..37672c4 --- /dev/null +++ b/Management/.gitignore @@ -0,0 +1,259 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# Management +host/Win_in.Sfs.Scp.Management.IdentityServer/Logs/logs.txt +host/Win_in.Sfs.Scp.Management.HttpApi.Host/Logs/logs.txt +host/Win_in.Sfs.Scp.Management.Web.Host/Logs/logs.txt +host/Win_in.Sfs.Scp.Management.Web.Unified/Logs/logs.txt +host/Win_in.Sfs.Scp.Management.Blazor.Server.Host/Logs/logs.txt \ No newline at end of file diff --git a/Management/.prettierrc b/Management/.prettierrc new file mode 100644 index 0000000..56af76b --- /dev/null +++ b/Management/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/Management/NuGet.Config b/Management/NuGet.Config new file mode 100644 index 0000000..be8a1ec --- /dev/null +++ b/Management/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Management/Win_in.Sfs.Scp.Management.sln b/Management/Win_in.Sfs.Scp.Management.sln new file mode 100644 index 0000000..63464aa --- /dev/null +++ b/Management/Win_in.Sfs.Scp.Management.sln @@ -0,0 +1,104 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.Domain.Shared", "src\Win_in.Sfs.Scp.Management.Domain.Shared\Win_in.Sfs.Scp.Management.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.Domain", "src\Win_in.Sfs.Scp.Management.Domain\Win_in.Sfs.Scp.Management.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.Application.Contracts", "src\Win_in.Sfs.Scp.Management.Application.Contracts\Win_in.Sfs.Scp.Management.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.Application", "src\Win_in.Sfs.Scp.Management.Application\Win_in.Sfs.Scp.Management.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.EntityFrameworkCore", "src\Win_in.Sfs.Scp.Management.EntityFrameworkCore\Win_in.Sfs.Scp.Management.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.HttpApi", "src\Win_in.Sfs.Scp.Management.HttpApi\Win_in.Sfs.Scp.Management.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.TestBase", "test\Win_in.Sfs.Scp.Management.TestBase\Win_in.Sfs.Scp.Management.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests", "test\Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests\Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.Domain.Tests", "test\Win_in.Sfs.Scp.Management.Domain.Tests\Win_in.Sfs.Scp.Management.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.Application.Tests", "test\Win_in.Sfs.Scp.Management.Application.Tests\Win_in.Sfs.Scp.Management.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.Management.HttpApi.Host", "host\Win_in.Sfs.Scp.Management.HttpApi.Host\Win_in.Sfs.Scp.Management.HttpApi.Host.csproj", "{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2} = {E400416D-2895-4512-9D17-90681EEC7E0A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/Management/Win_in.Sfs.Scp.Management.sln.DotSettings b/Management/Win_in.Sfs.Scp.Management.sln.DotSettings new file mode 100644 index 0000000..cb0b2c9 --- /dev/null +++ b/Management/Win_in.Sfs.Scp.Management.sln.DotSettings @@ -0,0 +1,23 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL + \ No newline at end of file diff --git a/Management/common.props b/Management/common.props new file mode 100644 index 0000000..01eae14 --- /dev/null +++ b/Management/common.props @@ -0,0 +1,24 @@ + + + latest + 0.1.0 + $(NoWarn);CS1591 + module + + + + + + All + runtime; build; native; contentfiles; analyzers + + + + + + + $(NoWarn);0436 + + + + \ No newline at end of file diff --git a/Management/database/Dockerfile b/Management/database/Dockerfile new file mode 100644 index 0000000..095abc5 --- /dev/null +++ b/Management/database/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +COPY . . + +WORKDIR /templates/service/host/IdentityServerHost +RUN dotnet restore +RUN dotnet ef migrations script -i -o migrations-IdentityServerHost.sql + +WORKDIR /templates/service/host/Win_in.Sfs.Scp.Management.Host +RUN dotnet restore +RUN dotnet ef migrations script -i -o migrations-Management.sql + +FROM mcr.microsoft.com/mssql-tools AS final +WORKDIR /src +COPY --from=build /templates/service/host/IdentityServerHost/migrations-IdentityServerHost.sql migrations-IdentityServerHost.sql +COPY --from=build /templates/service/host/Win_in.Sfs.Scp.Management.Host/migrations-Management.sql migrations-Management.sql +COPY --from=build /templates/service/database/entrypoint.sh . +RUN /bin/bash -c "sed -i $'s/\r$//' entrypoint.sh" +RUN chmod +x ./entrypoint.sh + +ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file diff --git a/Management/database/entrypoint.sh b/Management/database/entrypoint.sh new file mode 100644 index 0000000..c78985c --- /dev/null +++ b/Management/database/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +until /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q 'SELECT name FROM master.sys.databases'; do +>&2 echo "SQL Server is starting up" +sleep 1 +done + +/opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$IdentityServer_DB]" +/opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$Management_DB]" + +/opt/mssql-tools/bin/sqlcmd -d $IdentityServer_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-IdentityServerHost.sql +/opt/mssql-tools/bin/sqlcmd -d $Management_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-Management.sql \ No newline at end of file diff --git a/Management/docker-compose.migrations.yml b/Management/docker-compose.migrations.yml new file mode 100644 index 0000000..fc84755 --- /dev/null +++ b/Management/docker-compose.migrations.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + migrations: + build: + context: ../../ + dockerfile: templates/service/database/Dockerfile + depends_on: + - sqlserver + environment: + - IdentityServer_DB=Management_Identity + - Management_DB=Management_ModuleDb + - SA_PASSWORD=yourStrong(!)Password diff --git a/Management/docker-compose.override.yml b/Management/docker-compose.override.yml new file mode 100644 index 0000000..943553b --- /dev/null +++ b/Management/docker-compose.override.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + sqlserver: + environment: + - SA_PASSWORD=yourStrong(!)Password + - ACCEPT_EULA=Y + ports: + - "51599:1433" + + identity-server: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=Management_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=Management_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + ports: + - "51600:80" + + management: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=Management_ModuleDb;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=Management_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=Management_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=Management_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=Management_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - AuthServer__Authority=http://identity-server + ports: + - "51601:80" \ No newline at end of file diff --git a/Management/docker-compose.yml b/Management/docker-compose.yml new file mode 100644 index 0000000..478f9fe --- /dev/null +++ b/Management/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.4' + +services: + sqlserver: + image: mcr.microsoft.com/mssql/server + volumes: + - dbdata:/var/opt/mssql + + identity-server: + build: + context: ../../ + dockerfile: templates/service/host/IdentityServerHost/Dockerfile + depends_on: + - sqlserver + + management: + build: + context: ../../ + dockerfile: templates/service/host/Win_in.Sfs.Scp.Management.Host/Dockerfile + depends_on: + - sqlserver + - identity-server + +volumes: + dbdata: \ No newline at end of file diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Controllers/HomeController.cs b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..71a6ae2 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace Win_in.Sfs.Scp.Management.Controllers +{ + public class HomeController : AbpController + { + public ActionResult Index() + { + return Redirect("~/swagger"); + } + } +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Dockerfile b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Dockerfile new file mode 100644 index 0000000..995205e --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +WORKDIR /src +COPY . . +WORKDIR /src/templates/service/host/Win_in.Sfs.Scp.Management.HttpApi.Host +RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet build --no-restore -c Release -o /app + +FROM build AS publish +RUN dotnet publish --no-restore -c Release -o /app + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "Win_in.Sfs.Scp.Management.HttpApi.Host.dll"] diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContext.cs b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContext.cs new file mode 100644 index 0000000..640a857 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContext.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + public class ManagementHttpApiHostMigrationsDbContext : AbpDbContext + { + public ManagementHttpApiHostMigrationsDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureManagement(); + } + } +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContextFactory.cs b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContextFactory.cs new file mode 100644 index 0000000..1d1c05f --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/EntityFrameworkCore/ManagementHttpApiHostMigrationsDbContextFactory.cs @@ -0,0 +1,29 @@ +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + public class ManagementHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory + { + public ManagementHttpApiHostMigrationsDbContext CreateDbContext(string[] args) + { + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseSqlServer(configuration.GetConnectionString("Management")); + + return new ManagementHttpApiHostMigrationsDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } + } +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xml b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xsd b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/ManagementHttpApiHostModule.cs b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/ManagementHttpApiHostModule.cs new file mode 100644 index 0000000..b06f085 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/ManagementHttpApiHostModule.cs @@ -0,0 +1,196 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using IdentityModel; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Win_in.Sfs.Scp.Management.EntityFrameworkCore; +using StackExchange.Redis; +using Microsoft.OpenApi.Models; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.Autofac; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.SqlServer; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.Security.Claims; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.Swashbuckle; +using Volo.Abp.VirtualFileSystem; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(ManagementApplicationModule), + typeof(ManagementEntityFrameworkCoreModule), + typeof(ManagementHttpApiModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpEntityFrameworkCoreSqlServerModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) + )] + public class ManagementHttpApiHostModule : AbpModule + { + private bool _isMultiTenancy = true; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); + _isMultiTenancy = Convert.ToBoolean(configuration["IsMultiTenancy"]); + + Configure(options => + { + options.UseSqlServer(); + }); + + Configure(options => + { + options.IsEnabled = _isMultiTenancy; + }); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.Management.Domain.Shared", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.Management.Domain", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.Management.Application.Contracts", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.Management.Application", Path.DirectorySeparatorChar))); + }); + } + + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"], + new Dictionary + { + {"Management", "Management API"} + }, + options => + { + options.SwaggerDoc("v1", new OpenApiInfo {Title = "Management API", Version = "v1"}); + options.DocInclusionPredicate((docName, description) => true); + options.CustomSchemaIds(type => type.FullName); + }); + + Configure(options => + { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in")); + options.Languages.Add(new LanguageInfo("it", "it", "Italian", "it")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + }); + + context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.Authority = configuration["AuthServer:Authority"]; + options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); + options.Audience = "Management"; + }); + + Configure(options => + { + options.KeyPrefix = "Management:"; + }); + + if (!hostingEnvironment.IsDevelopment()) + { + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "Management-Protection-Keys"); + } + + context.Services.AddCors(options => + { + options.AddDefaultPolicy(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(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + if (_isMultiTenancy) + { + app.UseMultiTenancy(); + } + app.UseAbpRequestLocalization(); + app.UseAuthorization(); + app.UseSwagger(); + app.UseAbpSwaggerUI(options => + { + options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); + + var configuration = context.GetConfiguration(); + options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); + options.OAuthScopes("Management"); + }); + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } + } +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Program.cs b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Program.cs new file mode 100644 index 0000000..77f2615 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Program.cs @@ -0,0 +1,59 @@ +using System; +using System.IO; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace Win_in.Sfs.Scp.Management +{ + public class Program + { + public static int Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) +#if DEBUG + .WriteTo.Async(c => c.Console()) +#endif + .CreateLogger(); + + try + { + Log.Information("Starting web host."); + CreateHostBuilder(args).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) + .ConfigureAppConfiguration(build => + { + build.AddJsonFile("appsettings.secrets.json", optional: true); + }) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }) + .UseAutofac() + .UseSerilog(); + } +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Properties/launchSettings.json b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..7dcaea2 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "Win_in.Sfs.Scp.Management.DemoApp": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:9202", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Startup.cs b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Startup.cs new file mode 100644 index 0000000..6be6d37 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Startup.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace Win_in.Sfs.Scp.Management +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.InitializeApplication(); + } + } +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Win_in.Sfs.Scp.Management.HttpApi.Host.csproj b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Win_in.Sfs.Scp.Management.HttpApi.Host.csproj new file mode 100644 index 0000000..4e3cce9 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/Win_in.Sfs.Scp.Management.HttpApi.Host.csproj @@ -0,0 +1,43 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.Management + true + Win_in.Sfs.Scp.Management-c2d31439-b723-48e2-b061-5ebd7aeb6010 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.json b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..52d4632 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.json @@ -0,0 +1,20 @@ +{ + "App": { + "CorsOrigins": "https://*.Management.com,http://localhost:4200,http://localhost:44307,https://localhost:44307" + }, + "ConnectionStrings": { + "Default": "Server=localhost;Database=Management_Main;User ID=sa;Password=Microsoft@2021;", + "Management": "Server=localhost;Database=Management_Module;User ID=sa;Password=Microsoft@2021;" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "AuthServer": { + "Authority": "https://localhost:9000/", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "Management_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "IsMultiTenancy": true + +} diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.secrets.json b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..7a73a41 --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/yarn.lock b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/Management/host/Win_in.Sfs.Scp.Management.HttpApi.Host/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xml b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xsd b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/ManagementApplicationContractsModule.cs b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/ManagementApplicationContractsModule.cs new file mode 100644 index 0000000..067d8ab --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/ManagementApplicationContractsModule.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(ManagementDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) + )] + public class ManagementApplicationContractsModule : AbpModule + { + + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissionDefinitionProvider.cs b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissionDefinitionProvider.cs new file mode 100644 index 0000000..989de10 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissionDefinitionProvider.cs @@ -0,0 +1,19 @@ +using Win_in.Sfs.Scp.Management.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace Win_in.Sfs.Scp.Management.Permissions +{ + public class ManagementPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(ManagementPermissions.GroupName, L("Permission:Management")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissions.cs b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissions.cs new file mode 100644 index 0000000..b404260 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Permissions/ManagementPermissions.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Reflection; + +namespace Win_in.Sfs.Scp.Management.Permissions +{ + public class ManagementPermissions + { + public const string GroupName = "Management"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(ManagementPermissions)); + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/ISampleAppService.cs b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/ISampleAppService.cs new file mode 100644 index 0000000..d22e61c --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/ISampleAppService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.Management.Samples +{ + public interface ISampleAppService : IApplicationService + { + Task GetAsync(); + + Task GetAuthorizedAsync(); + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/SampleDto.cs b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/SampleDto.cs new file mode 100644 index 0000000..81d4077 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Samples/SampleDto.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.Management.Samples +{ + public class SampleDto + { + public int Value { get; set; } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Win_in.Sfs.Scp.Management.Application.Contracts.csproj b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Win_in.Sfs.Scp.Management.Application.Contracts.csproj new file mode 100644 index 0000000..bb807d6 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application.Contracts/Win_in.Sfs.Scp.Management.Application.Contracts.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.Management + + + + + + + + + diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xml b/Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xsd b/Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementAppService.cs b/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementAppService.cs new file mode 100644 index 0000000..c616310 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementAppService.cs @@ -0,0 +1,14 @@ +using Win_in.Sfs.Scp.Management.Localization; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.Management +{ + public abstract class ManagementAppService : ApplicationService + { + protected ManagementAppService() + { + LocalizationResource = typeof(ManagementResource); + ObjectMapperContext = typeof(ManagementApplicationModule); + } + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationAutoMapperProfile.cs b/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..8e1259a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationAutoMapperProfile.cs @@ -0,0 +1,14 @@ +using AutoMapper; + +namespace Win_in.Sfs.Scp.Management +{ + public class ManagementApplicationAutoMapperProfile : Profile + { + public ManagementApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationModule.cs b/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationModule.cs new file mode 100644 index 0000000..0edb76f --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/ManagementApplicationModule.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(ManagementDomainModule), + typeof(ManagementApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] + public class ManagementApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/Samples/SampleAppService.cs b/Management/src/Win_in.Sfs.Scp.Management.Application/Samples/SampleAppService.cs new file mode 100644 index 0000000..d5b2deb --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/Samples/SampleAppService.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; + +namespace Win_in.Sfs.Scp.Management.Samples +{ + public class SampleAppService : ManagementAppService, ISampleAppService + { + public Task GetAsync() + { + return Task.FromResult( + new SampleDto + { + Value = 42 + } + ); + } + + [Authorize] + public Task GetAuthorizedAsync() + { + return Task.FromResult( + new SampleDto + { + Value = 42 + } + ); + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Application/Win_in.Sfs.Scp.Management.Application.csproj b/Management/src/Win_in.Sfs.Scp.Management.Application/Win_in.Sfs.Scp.Management.Application.csproj new file mode 100644 index 0000000..7590b7f --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Application/Win_in.Sfs.Scp.Management.Application.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.Management + + + + + + + + + + diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xml b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xsd b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/ar.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/ar.json new file mode 100644 index 0000000..fb7b748 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/ar.json @@ -0,0 +1,7 @@ +{ + "culture": "ar", + "texts": { + "MyAccount": "إدارة ملفى", + "SamplePageMessage": "صفحة نموذجية للوحدة النمطية Management" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/cs.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/cs.json new file mode 100644 index 0000000..cfce0c2 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/cs.json @@ -0,0 +1,7 @@ +{ + "culture": "cs", + "texts": { + "MyAccount": "Spravovat profil", + "SamplePageMessage": "Ukázková stránka pro modul Management" + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/de-DE.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/de-DE.json new file mode 100644 index 0000000..b04e913 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/de-DE.json @@ -0,0 +1,7 @@ +{ + "culture": "de-DE", + "texts": { + "MyAccount": "Mein Konto", + "SamplePageMessage": "Eine Beispielseite für das Modul ManagementModul" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en-GB.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en-GB.json new file mode 100644 index 0000000..860bedc --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en-GB.json @@ -0,0 +1,7 @@ +{ + "culture": "en-GB", + "texts": { + "MyAccount": "My account", + "SamplePageMessage": "A sample page for the Management module" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en.json new file mode 100644 index 0000000..2623a92 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/en.json @@ -0,0 +1,7 @@ +{ + "culture": "en", + "texts": { + "MyAccount": "My account", + "SamplePageMessage": "A sample page for the Management module" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/es.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/es.json new file mode 100644 index 0000000..6aba695 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/es.json @@ -0,0 +1,7 @@ +{ + "culture": "es", + "texts": { + "MyAccount": "Mi cuenta", + "SamplePageMessage": "Una página de ejemplo para el módulo Management " + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fi.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fi.json new file mode 100644 index 0000000..a164fa6 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fi.json @@ -0,0 +1,7 @@ +{ + "culture": "fi", + "texts": { + "MyAccount": "Tilini", + "SamplePageMessage": "Esimerkkisivu Management-moduulille" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fr.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fr.json new file mode 100644 index 0000000..164a5d0 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/fr.json @@ -0,0 +1,7 @@ +{ + "culture": "fr", + "texts": { + "MyAccount": "Mon compte", + "SamplePageMessage": "Exemple de page pour le module Management" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hi.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hi.json new file mode 100644 index 0000000..e2baf0a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hi.json @@ -0,0 +1,7 @@ +{ + "culture": "hi", + "texts": { + "MyAccount": "मेरा खाता", + "SamplePageMessage": "Management मॉड्यूल के लिए एक नमूना पृष्ठ" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hu.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hu.json new file mode 100644 index 0000000..7725d91 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/hu.json @@ -0,0 +1,7 @@ +{ + "culture": "hu", + "texts": { + "MyAccount": "A fiókom", + "SamplePageMessage": "Mintaoldal a Management modulhoz" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/it.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/it.json new file mode 100644 index 0000000..82db76c --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/it.json @@ -0,0 +1,7 @@ +{ + "culture": "it", + "texts": { + "MyAccount": "Il mio conto", + "SamplePageMessage": "Una pagina di esempio per il modulo Management" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/nl.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/nl.json new file mode 100644 index 0000000..c661158 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/nl.json @@ -0,0 +1,7 @@ +{ + "culture": "nl", + "texts": { + "MyAccount": "Mijn rekening", + "SamplePageMessage": "Een voorbeeldpagina voor de Management module" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pl-PL.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pl-PL.json new file mode 100644 index 0000000..3ea7b19 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pl-PL.json @@ -0,0 +1,6 @@ +{ + "culture": "pl-PL", + "texts": { + + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pt-BR.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pt-BR.json new file mode 100644 index 0000000..6d746df --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sk.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sk.json new file mode 100644 index 0000000..d7054d5 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sk.json @@ -0,0 +1,6 @@ +{ + "culture": "sk", + "texts": { + "SamplePageMessage": "Ukážka stránky pre modul Management" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sl.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sl.json new file mode 100644 index 0000000..229c449 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/sl.json @@ -0,0 +1,6 @@ +{ + "culture": "sl", + "texts": { + "MyAccount": "Moj račun" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/tr.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/tr.json new file mode 100644 index 0000000..4686042 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/tr.json @@ -0,0 +1,7 @@ +{ + "culture": "tr", + "texts": { + "MyAccount": "Hesabım", + "SamplePageMessage": "Management modulünden örnek bir sayfa" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/vi.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/vi.json new file mode 100644 index 0000000..d8eb5f3 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/vi.json @@ -0,0 +1,6 @@ +{ + "culture": "vi", + "texts": { + + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hans.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hans.json new file mode 100644 index 0000000..0debead --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "culture": "zh-Hans", + "texts": { + "MyAccount": "我的账户", + "SamplePageMessage": "Management模块的示例页面" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hant.json b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hant.json new file mode 100644 index 0000000..699d31e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/Management/zh-Hant.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hant", + "texts": { + "MyAccount": "我的賬戶" + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/ManagementResource.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/ManagementResource.cs new file mode 100644 index 0000000..45ffe79 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Localization/ManagementResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace Win_in.Sfs.Scp.Management.Localization +{ + [LocalizationResourceName("Management")] + public class ManagementResource + { + + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementDomainSharedModule.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementDomainSharedModule.cs new file mode 100644 index 0000000..cb229da --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementDomainSharedModule.cs @@ -0,0 +1,37 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using Win_in.Sfs.Scp.Management.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(AbpValidationModule) + )] + public class ManagementDomainSharedModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/Management"); + }); + + Configure(options => + { + options.MapCodeNamespace("Management", typeof(ManagementResource)); + }); + } + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementErrorCodes.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementErrorCodes.cs new file mode 100644 index 0000000..6be2c10 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/ManagementErrorCodes.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.Management +{ + public static class ManagementErrorCodes + { + //Add your business exception error codes here... + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Win_in.Sfs.Scp.Management.Domain.Shared.csproj b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Win_in.Sfs.Scp.Management.Domain.Shared.csproj new file mode 100644 index 0000000..60338c0 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain.Shared/Win_in.Sfs.Scp.Management.Domain.Shared.csproj @@ -0,0 +1,24 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.Management + true + + + + + + + + + + + + + + + + diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xml b/Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xsd b/Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDbProperties.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDbProperties.cs new file mode 100644 index 0000000..0b98b53 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDbProperties.cs @@ -0,0 +1,11 @@ +namespace Win_in.Sfs.Scp.Management +{ + public static class ManagementDbProperties + { + public static string DbTablePrefix { get; set; } = "Management"; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "Management"; + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDomainModule.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDomainModule.cs new file mode 100644 index 0000000..33d07c6 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/ManagementDomainModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(AbpDddDomainModule), + typeof(ManagementDomainSharedModule) + )] + public class ManagementDomainModule : AbpModule + { + + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettingDefinitionProvider.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettingDefinitionProvider.cs new file mode 100644 index 0000000..7238ec6 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettingDefinitionProvider.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Settings; + +namespace Win_in.Sfs.Scp.Management.Settings +{ + public class ManagementSettingDefinitionProvider : SettingDefinitionProvider + { + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from ManagementSettings class. + */ + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettings.cs b/Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettings.cs new file mode 100644 index 0000000..76293da --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/Settings/ManagementSettings.cs @@ -0,0 +1,11 @@ +namespace Win_in.Sfs.Scp.Management.Settings +{ + public static class ManagementSettings + { + public const string GroupName = "Management"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.Domain/Win_in.Sfs.Scp.Management.Domain.csproj b/Management/src/Win_in.Sfs.Scp.Management.Domain/Win_in.Sfs.Scp.Management.Domain.csproj new file mode 100644 index 0000000..859e201 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.Domain/Win_in.Sfs.Scp.Management.Domain.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.Management + + + + + + + + diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/IManagementDbContext.cs b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/IManagementDbContext.cs new file mode 100644 index 0000000..4eda73b --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/IManagementDbContext.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + [ConnectionStringName(ManagementDbProperties.ConnectionStringName)] + public interface IManagementDbContext : IEfCoreDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContext.cs b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContext.cs new file mode 100644 index 0000000..939878b --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContext.cs @@ -0,0 +1,27 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + [ConnectionStringName(ManagementDbProperties.ConnectionStringName)] + public class ManagementDbContext : AbpDbContext, IManagementDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public ManagementDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureManagement(); + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContextModelCreatingExtensions.cs b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContextModelCreatingExtensions.cs new file mode 100644 index 0000000..fc5c7a4 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementDbContextModelCreatingExtensions.cs @@ -0,0 +1,43 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + public static class ManagementDbContextModelCreatingExtensions + { + public static void ConfigureManagement( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new ManagementModelBuilderConfigurationOptions( + ManagementDbProperties.DbTablePrefix, + ManagementDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "Questions", options.Schema); + + b.ConfigureByConvention(); + + //Properties + b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Relations + b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Indexes + b.HasIndex(q => q.CreationTime); + }); + */ + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementEntityFrameworkCoreModule.cs b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..c18ccfd --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementEntityFrameworkCoreModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + [DependsOn( + typeof(ManagementDomainModule), + typeof(AbpEntityFrameworkCoreModule) + )] + public class ManagementEntityFrameworkCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementModelBuilderConfigurationOptions.cs b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementModelBuilderConfigurationOptions.cs new file mode 100644 index 0000000..0e361aa --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/EntityFrameworkCore/ManagementModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + public class ManagementModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + { + public ManagementModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xml b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xsd b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/Win_in.Sfs.Scp.Management.EntityFrameworkCore.csproj b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/Win_in.Sfs.Scp.Management.EntityFrameworkCore.csproj new file mode 100644 index 0000000..a44918a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.EntityFrameworkCore/Win_in.Sfs.Scp.Management.EntityFrameworkCore.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.1 + Win_in.Sfs.Scp.Management + + + + + + + + diff --git a/Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xml b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xsd b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementController.cs b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementController.cs new file mode 100644 index 0000000..de9bc43 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementController.cs @@ -0,0 +1,13 @@ +using Win_in.Sfs.Scp.Management.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace Win_in.Sfs.Scp.Management +{ + public abstract class ManagementController : AbpController + { + protected ManagementController() + { + LocalizationResource = typeof(ManagementResource); + } + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementHttpApiModule.cs b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementHttpApiModule.cs new file mode 100644 index 0000000..9383e31 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/ManagementHttpApiModule.cs @@ -0,0 +1,33 @@ +using Localization.Resources.AbpUi; +using Win_in.Sfs.Scp.Management.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(ManagementApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class ManagementHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(ManagementHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.HttpApi/Samples/SampleController.cs b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/Samples/SampleController.cs new file mode 100644 index 0000000..308e9a4 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/Samples/SampleController.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; + +namespace Win_in.Sfs.Scp.Management.Samples +{ + [RemoteService] + [Route("api/Management/sample")] + public class SampleController : ManagementController, ISampleAppService + { + private readonly ISampleAppService _sampleAppService; + + public SampleController(ISampleAppService sampleAppService) + { + _sampleAppService = sampleAppService; + } + + [HttpGet] + public async Task GetAsync() + { + return await _sampleAppService.GetAsync(); + } + + [HttpGet] + [Route("authorized")] + [Authorize] + public async Task GetAuthorizedAsync() + { + return await _sampleAppService.GetAsync(); + } + } +} diff --git a/Management/src/Win_in.Sfs.Scp.Management.HttpApi/Win_in.Sfs.Scp.Management.HttpApi.csproj b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/Win_in.Sfs.Scp.Management.HttpApi.csproj new file mode 100644 index 0000000..3257857 --- /dev/null +++ b/Management/src/Win_in.Sfs.Scp.Management.HttpApi/Win_in.Sfs.Scp.Management.HttpApi.csproj @@ -0,0 +1,15 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.Management + + + + + + + + diff --git a/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xml b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xsd b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestBase.cs b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestBase.cs new file mode 100644 index 0000000..6d1314b --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestBase.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.Management +{ + /* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ + public abstract class ManagementApplicationTestBase : ManagementTestBase + { + + } +} \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestModule.cs b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestModule.cs new file mode 100644 index 0000000..6e0fd27 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/ManagementApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(ManagementApplicationModule), + typeof(ManagementDomainTestModule) + )] + public class ManagementApplicationTestModule : AbpModule + { + + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Samples/SampleAppService_Tests.cs b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Samples/SampleAppService_Tests.cs new file mode 100644 index 0000000..8d8cbaf --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Samples/SampleAppService_Tests.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace Win_in.Sfs.Scp.Management.Samples +{ + public class SampleAppService_Tests : ManagementApplicationTestBase + { + private readonly ISampleAppService _sampleAppService; + + public SampleAppService_Tests() + { + _sampleAppService = GetRequiredService(); + } + + [Fact] + public async Task GetAsync() + { + var result = await _sampleAppService.GetAsync(); + result.Value.ShouldBe(42); + } + + [Fact] + public async Task GetAuthorizedAsync() + { + var result = await _sampleAppService.GetAuthorizedAsync(); + result.Value.ShouldBe(42); + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Win_in.Sfs.Scp.Management.Application.Tests.csproj b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Win_in.Sfs.Scp.Management.Application.Tests.csproj new file mode 100644 index 0000000..88245b1 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Application.Tests/Win_in.Sfs.Scp.Management.Application.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.Management + + + + + + + + + diff --git a/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xml b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xsd b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestBase.cs b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestBase.cs new file mode 100644 index 0000000..d4460db --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestBase.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.Management +{ + /* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ + public abstract class ManagementDomainTestBase : ManagementTestBase + { + + } +} \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestModule.cs b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestModule.cs new file mode 100644 index 0000000..90ac7cd --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/ManagementDomainTestModule.cs @@ -0,0 +1,17 @@ +using Win_in.Sfs.Scp.Management.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.Management +{ + /* Domain tests are configured to use the EF Core provider. + * You can switch to MongoDB, however your domain tests should be + * database independent anyway. + */ + [DependsOn( + typeof(ManagementEntityFrameworkCoreTestModule) + )] + public class ManagementDomainTestModule : AbpModule + { + + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Samples/SampleManager_Tests.cs b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Samples/SampleManager_Tests.cs new file mode 100644 index 0000000..baf276e --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Samples/SampleManager_Tests.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Xunit; + +namespace Win_in.Sfs.Scp.Management.Samples +{ + public class SampleManager_Tests : ManagementDomainTestBase + { + //private readonly SampleManager _sampleManager; + + public SampleManager_Tests() + { + //_sampleManager = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Win_in.Sfs.Scp.Management.Domain.Tests.csproj b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Win_in.Sfs.Scp.Management.Domain.Tests.csproj new file mode 100644 index 0000000..6f0af36 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.Domain.Tests/Win_in.Sfs.Scp.Management.Domain.Tests.csproj @@ -0,0 +1,15 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.Management + + + + + + + + diff --git a/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestBase.cs b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..36cc401 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestBase.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + /* This class can be used as a base class for EF Core integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class ManagementEntityFrameworkCoreTestBase : ManagementTestBase + { + + } +} \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestModule.cs b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..d734235 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/ManagementEntityFrameworkCoreTestModule.cs @@ -0,0 +1,43 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore +{ + [DependsOn( + typeof(ManagementTestBaseModule), + typeof(ManagementEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] + public class ManagementEntityFrameworkCoreTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new ManagementDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs new file mode 100644 index 0000000..8817d76 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs @@ -0,0 +1,12 @@ +using Win_in.Sfs.Scp.Management.Samples; + +namespace Win_in.Sfs.Scp.Management.EntityFrameworkCore.Samples +{ + public class SampleRepository_Tests : SampleRepository_Tests + { + /* Don't write custom repository tests here, instead write to + * the base class. + * One exception can be some specific tests related to EF core. + */ + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xml b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xsd b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests.csproj b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..b811f45 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.Management.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.Management + + + + + + + + + + + diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xml b/Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xsd b/Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementDataSeedContributor.cs b/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementDataSeedContributor.cs new file mode 100644 index 0000000..a0f5416 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementDataSeedContributor.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; + +namespace Win_in.Sfs.Scp.Management +{ + public class ManagementDataSeedContributor : IDataSeedContributor, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + + public ManagementDataSeedContributor( + IGuidGenerator guidGenerator, ICurrentTenant currentTenant) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + using (_currentTenant.Change(context?.TenantId)) + { + return Task.CompletedTask; + } + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBase.cs b/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBase.cs new file mode 100644 index 0000000..9cd93d0 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace Win_in.Sfs.Scp.Management +{ + /* All test classes are derived from this class, directly or indirectly. */ + public abstract class ManagementTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBaseModule.cs b/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBaseModule.cs new file mode 100644 index 0000000..ee1feaa --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/ManagementTestBaseModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace Win_in.Sfs.Scp.Management +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(ManagementDomainModule) + )] + public class ManagementTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/Samples/SampleRepository_Tests.cs b/Management/test/Win_in.Sfs.Scp.Management.TestBase/Samples/SampleRepository_Tests.cs new file mode 100644 index 0000000..8f9db87 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/Samples/SampleRepository_Tests.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Volo.Abp.Modularity; +using Xunit; + +namespace Win_in.Sfs.Scp.Management.Samples +{ + /* Write your custom repository tests like that, in this project, as abstract classes. + * Then inherit these abstract classes from EF Core & MongoDB test projects. + * In this way, both database providers are tests with the same set tests. + */ + public abstract class SampleRepository_Tests : ManagementTestBase + where TStartupModule : IAbpModule + { + //private readonly ISampleRepository _sampleRepository; + + protected SampleRepository_Tests() + { + //_sampleRepository = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/Management/test/Win_in.Sfs.Scp.Management.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..194f924 --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace Win_in.Sfs.Scp.Management.Security +{ + [Dependency(ReplaceServices = true)] + public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor + { + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } + } +} diff --git a/Management/test/Win_in.Sfs.Scp.Management.TestBase/Win_in.Sfs.Scp.Management.TestBase.csproj b/Management/test/Win_in.Sfs.Scp.Management.TestBase/Win_in.Sfs.Scp.Management.TestBase.csproj new file mode 100644 index 0000000..e5b229a --- /dev/null +++ b/Management/test/Win_in.Sfs.Scp.Management.TestBase/Win_in.Sfs.Scp.Management.TestBase.csproj @@ -0,0 +1,23 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.Management + + + + + + + + + + + + + + + + diff --git a/ScpWebApiService/.gitattributes b/ScpWebApiService/.gitattributes new file mode 100644 index 0000000..c941e52 --- /dev/null +++ b/ScpWebApiService/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/ScpWebApiService/.gitignore b/ScpWebApiService/.gitignore new file mode 100644 index 0000000..a667592 --- /dev/null +++ b/ScpWebApiService/.gitignore @@ -0,0 +1,259 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# WebApi +host/Win_in.Sfs.Scp.WebApi.IdentityServer/Logs/logs.txt +host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Logs/logs.txt +host/Win_in.Sfs.Scp.WebApi.Web.Host/Logs/logs.txt +host/Win_in.Sfs.Scp.WebApi.Web.Unified/Logs/logs.txt +host/Win_in.Sfs.Scp.WebApi.Blazor.Server.Host/Logs/logs.txt \ No newline at end of file diff --git a/ScpWebApiService/.prettierrc b/ScpWebApiService/.prettierrc new file mode 100644 index 0000000..56af76b --- /dev/null +++ b/ScpWebApiService/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/ScpWebApiService/NuGet.Config b/ScpWebApiService/NuGet.Config new file mode 100644 index 0000000..be8a1ec --- /dev/null +++ b/ScpWebApiService/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln b/ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln new file mode 100644 index 0000000..8364178 --- /dev/null +++ b/ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln @@ -0,0 +1,104 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.Domain.Shared", "src\Win_in.Sfs.Scp.WebApi.Domain.Shared\Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.Domain", "src\Win_in.Sfs.Scp.WebApi.Domain\Win_in.Sfs.Scp.WebApi.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.Application.Contracts", "src\Win_in.Sfs.Scp.WebApi.Application.Contracts\Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.Application", "src\Win_in.Sfs.Scp.WebApi.Application\Win_in.Sfs.Scp.WebApi.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.EntityFrameworkCore", "src\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.HttpApi", "src\Win_in.Sfs.Scp.WebApi.HttpApi\Win_in.Sfs.Scp.WebApi.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.TestBase", "test\Win_in.Sfs.Scp.WebApi.TestBase\Win_in.Sfs.Scp.WebApi.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests", "test\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests\Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.Domain.Tests", "test\Win_in.Sfs.Scp.WebApi.Domain.Tests\Win_in.Sfs.Scp.WebApi.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.Application.Tests", "test\Win_in.Sfs.Scp.WebApi.Application.Tests\Win_in.Sfs.Scp.WebApi.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Win_in.Sfs.Scp.WebApi.HttpApi.Host", "host\Win_in.Sfs.Scp.WebApi.HttpApi.Host\Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj", "{37B135B0-DAFE-4616-B25C-1BDF32FC44A2}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {37B135B0-DAFE-4616-B25C-1BDF32FC44A2} = {E400416D-2895-4512-9D17-90681EEC7E0A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln.DotSettings b/ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln.DotSettings new file mode 100644 index 0000000..57aeeef --- /dev/null +++ b/ScpWebApiService/Win_in.Sfs.Scp.WebApi.sln.DotSettings @@ -0,0 +1,26 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + ASN + DTO + PO + SQL + \ No newline at end of file diff --git a/ScpWebApiService/common.props b/ScpWebApiService/common.props new file mode 100644 index 0000000..01eae14 --- /dev/null +++ b/ScpWebApiService/common.props @@ -0,0 +1,24 @@ + + + latest + 0.1.0 + $(NoWarn);CS1591 + module + + + + + + All + runtime; build; native; contentfiles; analyzers + + + + + + + $(NoWarn);0436 + + + + \ No newline at end of file diff --git a/ScpWebApiService/database/Dockerfile b/ScpWebApiService/database/Dockerfile new file mode 100644 index 0000000..01e141f --- /dev/null +++ b/ScpWebApiService/database/Dockerfile @@ -0,0 +1,20 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +COPY . . + +WORKDIR /templates/service/host/IdentityServerHost +RUN dotnet restore +RUN dotnet ef migrations script -i -o migrations-IdentityServerHost.sql + +WORKDIR /templates/service/host/Win_in.Sfs.Scp.WebApi.Host +RUN dotnet restore +RUN dotnet ef migrations script -i -o migrations-WebApi.sql + +FROM mcr.microsoft.com/mssql-tools AS final +WORKDIR /src +COPY --from=build /templates/service/host/IdentityServerHost/migrations-IdentityServerHost.sql migrations-IdentityServerHost.sql +COPY --from=build /templates/service/host/Win_in.Sfs.Scp.WebApi.Host/migrations-WebApi.sql migrations-WebApi.sql +COPY --from=build /templates/service/database/entrypoint.sh . +RUN /bin/bash -c "sed -i $'s/\r$//' entrypoint.sh" +RUN chmod +x ./entrypoint.sh + +ENTRYPOINT ["./entrypoint.sh"] \ No newline at end of file diff --git a/ScpWebApiService/database/entrypoint.sh b/ScpWebApiService/database/entrypoint.sh new file mode 100644 index 0000000..c537cb6 --- /dev/null +++ b/ScpWebApiService/database/entrypoint.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +until /opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q 'SELECT name FROM master.sys.databases'; do +>&2 echo "SQL Server is starting up" +sleep 1 +done + +/opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$IdentityServer_DB]" +/opt/mssql-tools/bin/sqlcmd -S sqlserver -U SA -P $SA_PASSWORD -Q "CREATE DATABASE [$WebApi_DB]" + +/opt/mssql-tools/bin/sqlcmd -d $IdentityServer_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-IdentityServerHost.sql +/opt/mssql-tools/bin/sqlcmd -d $WebApi_DB -S sqlserver -U sa -P $SA_PASSWORD -i migrations-WebApi.sql \ No newline at end of file diff --git a/ScpWebApiService/docker-compose.migrations.yml b/ScpWebApiService/docker-compose.migrations.yml new file mode 100644 index 0000000..9a024ec --- /dev/null +++ b/ScpWebApiService/docker-compose.migrations.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + migrations: + build: + context: ../../ + dockerfile: templates/service/database/Dockerfile + depends_on: + - sqlserver + environment: + - IdentityServer_DB=WebApi_Identity + - WebApi_DB=WebApi_ModuleDb + - SA_PASSWORD=yourStrong(!)Password diff --git a/ScpWebApiService/docker-compose.override.yml b/ScpWebApiService/docker-compose.override.yml new file mode 100644 index 0000000..cccc182 --- /dev/null +++ b/ScpWebApiService/docker-compose.override.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + sqlserver: + environment: + - SA_PASSWORD=yourStrong(!)Password + - ACCEPT_EULA=Y + ports: + - "51599:1433" + + identity-server: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=WebApi_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=WebApi_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + ports: + - "51600:80" + + web-api: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=WebApi_ModuleDb;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=WebApi_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=WebApi_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=WebApi_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=WebApi_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - AuthServer__Authority=http://identity-server + ports: + - "51601:80" \ No newline at end of file diff --git a/ScpWebApiService/docker-compose.yml b/ScpWebApiService/docker-compose.yml new file mode 100644 index 0000000..63d0dea --- /dev/null +++ b/ScpWebApiService/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.4' + +services: + sqlserver: + image: mcr.microsoft.com/mssql/server + volumes: + - dbdata:/var/opt/mssql + + identity-server: + build: + context: ../../ + dockerfile: templates/service/host/IdentityServerHost/Dockerfile + depends_on: + - sqlserver + + web-api: + build: + context: ../../ + dockerfile: templates/service/host/Win_in.Sfs.Scp.WebApi.Host/Dockerfile + depends_on: + - sqlserver + - identity-server + +volumes: + dbdata: \ No newline at end of file diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Controllers/HomeController.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Controllers/HomeController.cs new file mode 100644 index 0000000..8e7b9dd --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Controllers/HomeController.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc; + +namespace Win_in.Sfs.Scp.WebApi.Controllers +{ + public class HomeController : AbpController + { + public ActionResult Index() + { + return Redirect("~/swagger"); + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Dockerfile b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Dockerfile new file mode 100644 index 0000000..52970bd --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-buster-slim AS base +WORKDIR /app +EXPOSE 80 + +FROM mcr.microsoft.com/dotnet/core/sdk:3.0-buster AS build +WORKDIR /src +COPY . . +WORKDIR /src/templates/service/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host +RUN dotnet restore -nowarn:msb3202,nu1503 +RUN dotnet build --no-restore -c Release -o /app + +FROM build AS publish +RUN dotnet publish --no-restore -c Release -o /app + +FROM base AS final +WORKDIR /app +COPY --from=publish /app . +ENTRYPOINT ["dotnet", "Win_in.Sfs.Scp.WebApi.HttpApi.Host.dll"] diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContext.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContext.cs new file mode 100644 index 0000000..1aa2976 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContext.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + public class WebApiHttpApiHostMigrationsDbContext : AbpDbContext + { + public WebApiHttpApiHostMigrationsDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + base.OnModelCreating(modelBuilder); + + modelBuilder.ConfigureWebApi(); + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContextFactory.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContextFactory.cs new file mode 100644 index 0000000..bc0f0b8 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/EntityFrameworkCore/WebApiHttpApiHostMigrationsDbContextFactory.cs @@ -0,0 +1,29 @@ +using System.IO; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Design; +using Microsoft.Extensions.Configuration; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + public class WebApiHttpApiHostMigrationsDbContextFactory : IDesignTimeDbContextFactory + { + public WebApiHttpApiHostMigrationsDbContext CreateDbContext(string[] args) + { + var configuration = BuildConfiguration(); + + var builder = new DbContextOptionsBuilder() + .UseSqlServer(configuration.GetConnectionString("WebApi")); + + return new WebApiHttpApiHostMigrationsDbContext(builder.Options); + } + + private static IConfigurationRoot BuildConfiguration() + { + var builder = new ConfigurationBuilder() + .SetBasePath(Directory.GetCurrentDirectory()) + .AddJsonFile("appsettings.json", optional: false); + + return builder.Build(); + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xml b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xsd b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs new file mode 100644 index 0000000..be08c48 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.Designer.cs @@ -0,0 +1,759 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.Migrations +{ + [DbContext(typeof(WebApiHttpApiHostMigrationsDbContext))] + [Migration("20211021072716_20211021001")] + partial class _20211021001 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.11") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsConsignment") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("PoNumber") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("WebApi_PO"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("IsConsignment") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStatus") + .HasColumnType("int"); + + b.Property("OrderQty") + .IsRequired() + .HasColumnType("decimal(18,2)"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("StdPackQty") + .IsRequired() + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPackConvertRate") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("PoNumber", "PoLine") + .IsUnique(); + + b.ToTable("WebApi_PODetail"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Part", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Color") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configuration") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Desc1") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Desc2") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Eco") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtPackUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsBuyPart") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("IsMakePart") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Project") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("abcClass") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("catalog") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("productline") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("WebApi_Part"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Receipt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AsnNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Batch") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("DeliverQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("RcNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RcType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("RpNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPackConvertRate") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TimeWIndowEnd") + .HasColumnType("datetime2"); + + b.Property("TimeWindowBegin") + .HasColumnType("datetime2"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Warehouse") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseDoor") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("RcNumber", "PoLine", "PartCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("WebApi_Receipt"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Supplier", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("City") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Country") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("Desc") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Fax") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PostId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Rank") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.ToTable("WebApi_Suppliers"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.SupplierPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeleterId") + .HasColumnType("uniqueidentifier") + .HasColumnName("DeleterId"); + + b.Property("DeletionTime") + .HasColumnType("datetime2") + .HasColumnName("DeletionTime"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false) + .HasColumnName("IsDeleted"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPartCode") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("SupplierStdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierStdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SupplierCode", "PartCode") + .IsUnique() + .HasFilter("IsDeleted=0"); + + b.ToTable("WebApi_SupplierPart"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => + { + b.HasOne("Win_in.Sfs.Scp.WebApi.PO", null) + .WithMany("PODetails") + .HasForeignKey("Id") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => + { + b.Navigation("PODetails"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs new file mode 100644 index 0000000..d1e8513 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021072716_20211021001.cs @@ -0,0 +1,291 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win_in.Sfs.Scp.WebApi.Migrations +{ + public partial class _20211021001 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "WebApi_Part", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Desc1 = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + Desc2 = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + Status = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + IsMakePart = table.Column(type: "bit", nullable: false), + IsBuyPart = table.Column(type: "bit", nullable: false), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + abcClass = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + productline = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Type = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + catalog = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Group = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Color = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Configuration = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Project = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Eco = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + StdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + StdPackQty = table.Column(type: "decimal(18,2)", nullable: false), + ExtPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ExtPackQty = table.Column(type: "decimal(18,2)", nullable: false), + Site = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + SequenceNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Version = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WebApi_Part", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WebApi_PO", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + PoNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + SupplierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PoType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Status = table.Column(type: "int", nullable: false), + IsConsignment = table.Column(type: "bit", nullable: false), + OrderDate = table.Column(type: "datetime2", nullable: false), + DueDate = table.Column(type: "datetime2", nullable: false), + Version = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + TaxRate = table.Column(type: "decimal(18,2)", nullable: false), + Site = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ContactName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ContactPhone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WebApi_PO", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WebApi_Receipt", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + RcNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + AsnNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + RpNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PoNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + SupplierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + RcType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Warehouse = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + WarehouseDoor = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + TimeWindowBegin = table.Column(type: "datetime2", nullable: false), + TimeWIndowEnd = table.Column(type: "datetime2", nullable: false), + ReceiveTime = table.Column(type: "datetime2", nullable: false), + Site = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PoLine = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PartCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Batch = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + SupplierBatch = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + ProduceDate = table.Column(type: "datetime2", nullable: false), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + DeliverQty = table.Column(type: "decimal(18,2)", nullable: false), + ReceiveQty = table.Column(type: "decimal(18,2)", nullable: false), + StdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + StdPackQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + SupplierPackQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierPackConvertRate = table.Column(type: "decimal(18,2)", nullable: false), + Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WebApi_Receipt", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WebApi_SupplierPart", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + SupplierCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PartCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + SupplierPartCode = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + SupplierStdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + SupplierStdPackQty = table.Column(type: "decimal(18,2)", nullable: false), + Remark = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WebApi_SupplierPart", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WebApi_Suppliers", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Code = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Name = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Desc = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + Rank = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Address = table.Column(type: "nvarchar(1024)", maxLength: 1024, nullable: true), + Country = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + City = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Phone = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Fax = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + PostId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + ContactName = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Currency = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + IsActive = table.Column(type: "bit", nullable: false), + Company = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WebApi_Suppliers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WebApi_PODetail", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + PoNumber = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PoLine = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + PartCode = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + Uom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + OrderQty = table.Column(type: "decimal(18,2)", nullable: false), + StdPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), + StdPackQty = table.Column(type: "decimal(18,2)", nullable: false), + SupplierPackUom = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: true), + SupplierPackQty = table.Column(type: "decimal(18,2)", nullable: true), + SupplierPackConvertRate = table.Column(type: "decimal(18,2)", nullable: true), + IsConsignment = table.Column(type: "bit", nullable: false), + LineStatus = table.Column(type: "int", nullable: false), + Remark = table.Column(type: "nvarchar(max)", maxLength: 4096, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WebApi_PODetail", x => x.Id); + table.ForeignKey( + name: "FK_WebApi_PODetail_WebApi_PO_Id", + column: x => x.Id, + principalTable: "WebApi_PO", + principalColumn: "Id"); + }); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Part_Code", + table: "WebApi_Part", + column: "Code", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_PO_PoNumber", + table: "WebApi_PO", + column: "PoNumber", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_PODetail_PoNumber_PoLine", + table: "WebApi_PODetail", + columns: new[] { "PoNumber", "PoLine" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", + table: "WebApi_Receipt", + columns: new[] { "RcNumber", "PoLine", "PartCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", + table: "WebApi_SupplierPart", + columns: new[] { "SupplierCode", "PartCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Suppliers_CreationTime", + table: "WebApi_Suppliers", + column: "CreationTime"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "WebApi_Part"); + + migrationBuilder.DropTable( + name: "WebApi_PODetail"); + + migrationBuilder.DropTable( + name: "WebApi_Receipt"); + + migrationBuilder.DropTable( + name: "WebApi_SupplierPart"); + + migrationBuilder.DropTable( + name: "WebApi_Suppliers"); + + migrationBuilder.DropTable( + name: "WebApi_PO"); + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs new file mode 100644 index 0000000..34a17b9 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.Designer.cs @@ -0,0 +1,728 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.Migrations +{ + [DbContext(typeof(WebApiHttpApiHostMigrationsDbContext))] + [Migration("20211021081413_20211021002")] + partial class _20211021002 + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.11") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsConsignment") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("PoNumber") + .IsUnique() + .HasFilter("[PoNumber] IS NOT NULL"); + + b.ToTable("WebApi_PO"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsConsignment") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStatus") + .HasColumnType("int"); + + b.Property("OrderQty") + .IsRequired() + .HasColumnType("decimal(18,2)"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("StdPackQty") + .IsRequired() + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPackConvertRate") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("PoNumber", "PoLine") + .IsUnique(); + + b.ToTable("WebApi_PODetail"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Part", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Color") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configuration") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Desc1") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Desc2") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Eco") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtPackUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsBuyPart") + .HasColumnType("bit"); + + b.Property("IsMakePart") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Project") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("abcClass") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("catalog") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("productline") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique(); + + b.ToTable("WebApi_Part"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Receipt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AsnNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Batch") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeliverQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("RcNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RcType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("RpNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPackConvertRate") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TimeWIndowEnd") + .HasColumnType("datetime2"); + + b.Property("TimeWindowBegin") + .HasColumnType("datetime2"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Warehouse") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseDoor") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("RcNumber", "PoLine", "PartCode") + .IsUnique(); + + b.ToTable("WebApi_Receipt"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Supplier", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("City") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Country") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Desc") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Fax") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PostId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Rank") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.ToTable("WebApi_Suppliers"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.SupplierPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPartCode") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("SupplierStdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierStdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SupplierCode", "PartCode") + .IsUnique(); + + b.ToTable("WebApi_SupplierPart"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => + { + b.HasOne("Win_in.Sfs.Scp.WebApi.PO", null) + .WithMany("PODetails") + .HasForeignKey("Id") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => + { + b.Navigation("PODetails"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs new file mode 100644 index 0000000..b94785f --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/20211021081413_20211021002.cs @@ -0,0 +1,363 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Win_in.Sfs.Scp.WebApi.Migrations +{ + public partial class _20211021002 : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropIndex( + name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", + table: "WebApi_Receipt"); + + migrationBuilder.DropIndex( + name: "IX_WebApi_PO_PoNumber", + table: "WebApi_PO"); + + migrationBuilder.DropIndex( + name: "IX_WebApi_Part_Code", + table: "WebApi_Part"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "WebApi_Suppliers"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "WebApi_Suppliers"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "WebApi_Suppliers"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "WebApi_Receipt"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "WebApi_Receipt"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "WebApi_Receipt"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "WebApi_PO"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "WebApi_PO"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "WebApi_PO"); + + migrationBuilder.DropColumn( + name: "DeleterId", + table: "WebApi_Part"); + + migrationBuilder.DropColumn( + name: "DeletionTime", + table: "WebApi_Part"); + + migrationBuilder.DropColumn( + name: "IsDeleted", + table: "WebApi_Part"); + + migrationBuilder.AddColumn( + name: "SequenceNumber", + table: "WebApi_Suppliers", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "Version", + table: "WebApi_Suppliers", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "SequenceNumber", + table: "WebApi_SupplierPart", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "Version", + table: "WebApi_SupplierPart", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "SequenceNumber", + table: "WebApi_Receipt", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "Version", + table: "WebApi_Receipt", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "ConcurrencyStamp", + table: "WebApi_PODetail", + type: "nvarchar(40)", + maxLength: 40, + nullable: true); + + migrationBuilder.AddColumn( + name: "ExtraProperties", + table: "WebApi_PODetail", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.AddColumn( + name: "Version", + table: "WebApi_PODetail", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.AddColumn( + name: "SequenceNumber", + table: "WebApi_PO", + type: "nvarchar(64)", + maxLength: 64, + nullable: true); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", + table: "WebApi_SupplierPart", + columns: new[] { "SupplierCode", "PartCode" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", + table: "WebApi_Receipt", + columns: new[] { "RcNumber", "PoLine", "PartCode" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_PO_PoNumber", + table: "WebApi_PO", + column: "PoNumber", + unique: true, + filter: "[PoNumber] IS NOT NULL"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Part_Code", + table: "WebApi_Part", + column: "Code", + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropIndex( + name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropIndex( + name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", + table: "WebApi_Receipt"); + + migrationBuilder.DropIndex( + name: "IX_WebApi_PO_PoNumber", + table: "WebApi_PO"); + + migrationBuilder.DropIndex( + name: "IX_WebApi_Part_Code", + table: "WebApi_Part"); + + migrationBuilder.DropColumn( + name: "SequenceNumber", + table: "WebApi_Suppliers"); + + migrationBuilder.DropColumn( + name: "Version", + table: "WebApi_Suppliers"); + + migrationBuilder.DropColumn( + name: "SequenceNumber", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropColumn( + name: "Version", + table: "WebApi_SupplierPart"); + + migrationBuilder.DropColumn( + name: "SequenceNumber", + table: "WebApi_Receipt"); + + migrationBuilder.DropColumn( + name: "Version", + table: "WebApi_Receipt"); + + migrationBuilder.DropColumn( + name: "ConcurrencyStamp", + table: "WebApi_PODetail"); + + migrationBuilder.DropColumn( + name: "ExtraProperties", + table: "WebApi_PODetail"); + + migrationBuilder.DropColumn( + name: "Version", + table: "WebApi_PODetail"); + + migrationBuilder.DropColumn( + name: "SequenceNumber", + table: "WebApi_PO"); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "WebApi_Suppliers", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "WebApi_Suppliers", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "WebApi_Suppliers", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "WebApi_SupplierPart", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "WebApi_SupplierPart", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "WebApi_SupplierPart", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "WebApi_Receipt", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "WebApi_Receipt", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "WebApi_Receipt", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "WebApi_PO", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "WebApi_PO", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "WebApi_PO", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.AddColumn( + name: "DeleterId", + table: "WebApi_Part", + type: "uniqueidentifier", + nullable: true); + + migrationBuilder.AddColumn( + name: "DeletionTime", + table: "WebApi_Part", + type: "datetime2", + nullable: true); + + migrationBuilder.AddColumn( + name: "IsDeleted", + table: "WebApi_Part", + type: "bit", + nullable: false, + defaultValue: false); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_SupplierPart_SupplierCode_PartCode", + table: "WebApi_SupplierPart", + columns: new[] { "SupplierCode", "PartCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Receipt_RcNumber_PoLine_PartCode", + table: "WebApi_Receipt", + columns: new[] { "RcNumber", "PoLine", "PartCode" }, + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_PO_PoNumber", + table: "WebApi_PO", + column: "PoNumber", + unique: true, + filter: "IsDeleted=0"); + + migrationBuilder.CreateIndex( + name: "IX_WebApi_Part_Code", + table: "WebApi_Part", + column: "Code", + unique: true, + filter: "IsDeleted=0"); + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs new file mode 100644 index 0000000..2ab4ec8 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Migrations/WebApiHttpApiHostMigrationsDbContextModelSnapshot.cs @@ -0,0 +1,726 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; +using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.Migrations +{ + [DbContext(typeof(WebApiHttpApiHostMigrationsDbContext))] + partial class WebApiHttpApiHostMigrationsDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("ProductVersion", "5.0.11") + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ContactPhone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DueDate") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsConsignment") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("OrderDate") + .HasColumnType("datetime2"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TaxRate") + .HasColumnType("decimal(18,2)"); + + b.Property("Version") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("PoNumber") + .IsUnique() + .HasFilter("[PoNumber] IS NOT NULL"); + + b.ToTable("WebApi_PO"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("IsConsignment") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("LineStatus") + .HasColumnType("int"); + + b.Property("OrderQty") + .IsRequired() + .HasColumnType("decimal(18,2)"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("StdPackQty") + .IsRequired() + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPackConvertRate") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("PoNumber", "PoLine") + .IsUnique(); + + b.ToTable("WebApi_PODetail"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Part", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Color") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("Configuration") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Desc1") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Desc2") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("Eco") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtPackUom") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Group") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsBuyPart") + .HasColumnType("bit"); + + b.Property("IsMakePart") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Project") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Type") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("abcClass") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("catalog") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("productline") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("Code") + .IsUnique(); + + b.ToTable("WebApi_Part"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Receipt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AsnNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Batch") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("DeliverQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoLine") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PoNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ProduceDate") + .HasColumnType("datetime2"); + + b.Property("RcNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("RcType") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ReceiveQty") + .HasColumnType("decimal(18,2)"); + + b.Property("ReceiveTime") + .HasColumnType("datetime2"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("RpNumber") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Site") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("StdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("StdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierBatch") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPackConvertRate") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("TimeWIndowEnd") + .HasColumnType("datetime2"); + + b.Property("TimeWindowBegin") + .HasColumnType("datetime2"); + + b.Property("Uom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Warehouse") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("WarehouseDoor") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("RcNumber", "PoLine", "PartCode") + .IsUnique(); + + b.ToTable("WebApi_Receipt"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.Supplier", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Address") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("City") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Code") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Company") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("ContactName") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Country") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("Currency") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Desc") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("Fax") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("IsActive") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Phone") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("PostId") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Rank") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(4096) + .HasColumnType("nvarchar(max)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("CreationTime"); + + b.ToTable("WebApi_Suppliers"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.SupplierPart", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasMaxLength(40) + .HasColumnType("nvarchar(40)") + .HasColumnName("ConcurrencyStamp"); + + b.Property("CreationTime") + .HasColumnType("datetime2") + .HasColumnName("CreationTime"); + + b.Property("CreatorId") + .HasColumnType("uniqueidentifier") + .HasColumnName("CreatorId"); + + b.Property("ExtraProperties") + .HasColumnType("nvarchar(max)") + .HasColumnName("ExtraProperties"); + + b.Property("LastModificationTime") + .HasColumnType("datetime2") + .HasColumnName("LastModificationTime"); + + b.Property("LastModifierId") + .HasColumnType("uniqueidentifier") + .HasColumnName("LastModifierId"); + + b.Property("PartCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Remark") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SequenceNumber") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierCode") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("SupplierPartCode") + .HasMaxLength(1024) + .HasColumnType("nvarchar(1024)"); + + b.Property("SupplierStdPackQty") + .HasColumnType("decimal(18,2)"); + + b.Property("SupplierStdPackUom") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.Property("Version") + .HasMaxLength(64) + .HasColumnType("nvarchar(64)"); + + b.HasKey("Id"); + + b.HasIndex("SupplierCode", "PartCode") + .IsUnique(); + + b.ToTable("WebApi_SupplierPart"); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PODetail", b => + { + b.HasOne("Win_in.Sfs.Scp.WebApi.PO", null) + .WithMany("PODetails") + .HasForeignKey("Id") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + }); + + modelBuilder.Entity("Win_in.Sfs.Scp.WebApi.PO", b => + { + b.Navigation("PODetails"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs new file mode 100644 index 0000000..9258263 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Program.cs @@ -0,0 +1,59 @@ +using System; +using System.IO; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Hosting; +using Serilog; +using Serilog.Events; + +namespace Win_in.Sfs.Scp.WebApi +{ + public class Program + { + public static int Main(string[] args) + { + Log.Logger = new LoggerConfiguration() +#if DEBUG + .MinimumLevel.Debug() +#else + .MinimumLevel.Information() +#endif + .MinimumLevel.Override("Microsoft", LogEventLevel.Information) + .Enrich.FromLogContext() + .WriteTo.Async(c => c.File("Logs/logs.txt")) +#if DEBUG + .WriteTo.Async(c => c.Console()) +#endif + .CreateLogger(); + + try + { + Log.Information("Starting web host."); + CreateHostBuilder(args).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) + .ConfigureAppConfiguration(build => + { + build.AddJsonFile("appsettings.secrets.json", optional: true); + }) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }) + .UseAutofac() + .UseSerilog(); + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Properties/launchSettings.json b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Properties/launchSettings.json new file mode 100644 index 0000000..285218d --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "Win_in.Sfs.Scp.WebApi.DemoApp": { + "commandName": "Project", + "launchBrowser": true, + "applicationUrl": "https://localhost:9203", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Startup.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Startup.cs new file mode 100644 index 0000000..419c2e4 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Startup.cs @@ -0,0 +1,22 @@ +using System; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace Win_in.Sfs.Scp.WebApi +{ + public class Startup + { + public void ConfigureServices(IServiceCollection services) + { + services.AddApplication(); + + } + + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) + { + app.InitializeApplication(); + } + } +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs new file mode 100644 index 0000000..e33d664 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/WebApiHttpApiHostModule.cs @@ -0,0 +1,287 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using IdentityModel; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Cors; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; +using StackExchange.Redis; +using Microsoft.OpenApi.Models; +using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AspNetCore.Serilog; +using Volo.Abp.AuditLogging.EntityFrameworkCore; +using Volo.Abp.Autofac; +using Volo.Abp.Caching; +using Volo.Abp.Caching.StackExchangeRedis; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.SqlServer; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Volo.Abp.MultiTenancy; +using Volo.Abp.PermissionManagement.EntityFrameworkCore; +using Volo.Abp.Security.Claims; +using Volo.Abp.SettingManagement.EntityFrameworkCore; +using Volo.Abp.Swashbuckle; +using Volo.Abp.VirtualFileSystem; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.SwaggerGen; +using System.Reflection; +using Serilog; +using Serilog.Events; +using Volo.Abp.AspNetCore.Mvc; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(WebApiApplicationModule), + typeof(WebApiEntityFrameworkCoreModule), + typeof(WebApiHttpApiModule), + typeof(AbpAspNetCoreMvcUiMultiTenancyModule), + typeof(AbpAutofacModule), + typeof(AbpCachingStackExchangeRedisModule), + typeof(AbpEntityFrameworkCoreSqlServerModule), + typeof(AbpAuditLoggingEntityFrameworkCoreModule), + typeof(AbpPermissionManagementEntityFrameworkCoreModule), + typeof(AbpSettingManagementEntityFrameworkCoreModule), + typeof(AbpAspNetCoreSerilogModule), + typeof(AbpSwashbuckleModule) + )] + public class WebApiHttpApiHostModule : AbpModule + { + private bool _isMultiTenancy = true; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + var hostingEnvironment = context.Services.GetHostingEnvironment(); + var configuration = context.Services.GetConfiguration(); + _isMultiTenancy = Convert.ToBoolean(configuration["IsMultiTenancy"]); + + Configure(options => + { + options.UseSqlServer(); + }); + + Configure(options => + { + options.IsEnabled = _isMultiTenancy; + }); + + if (hostingEnvironment.IsDevelopment()) + { + Configure(options => + { + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Domain.Shared", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Domain", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Application.Contracts", Path.DirectorySeparatorChar))); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}src{0}Win_in.Sfs.Scp.WebApi.Application", Path.DirectorySeparatorChar))); + }); + } + + Configure(options => + { + options + .ConventionalControllers + .Create(typeof(WebApiApplicationModule).Assembly); + }); + + context.Services.AddAbpSwaggerGenWithOAuth( + configuration["AuthServer:Authority"], + new Dictionary + { + {"WebApi", "WebApi API"} + }, + //options => + //{ + // options.SwaggerDoc("v1", new OpenApiInfo {Title = "WebApi API", Version = "v1"}); + // options.DocInclusionPredicate((docName, description) => true); + // options.CustomSchemaIds(type => type.FullName); + //}); + options => + { + //遍历Swagger分组,注册SwaggerDoc + foreach (var groupName in typeof(SwaggerGroupConsts).GetFields() + .Select(f => f.GetValue(null).ToString())) + { + options.SwaggerDoc(groupName, + new OpenApiInfo { Title = $"{groupName} API", Version = groupName }); + + } + + //根据APIExplorerSetting判断是否包含于Swagger文档当前分组 + options.DocInclusionPredicate(IsIncludeInDoc); + + //反射注入全部Application和Application.Contract程序集说明 + GetXmlFiles().ForEach(file => + { + options.IncludeXmlComments(file); + Log.Information( " TEST-SWAGGER PATH ==> "+ file); + }); + + + options.CustomSchemaIds(type => type.FullName); + }); + + Configure(options => + { + options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština")); + options.Languages.Add(new LanguageInfo("en", "en", "English")); + options.Languages.Add(new LanguageInfo("en-GB", "en-GB", "English (UK)")); + options.Languages.Add(new LanguageInfo("fi", "fi", "Finnish")); + options.Languages.Add(new LanguageInfo("fr", "fr", "Français")); + options.Languages.Add(new LanguageInfo("hi", "hi", "Hindi", "in")); + options.Languages.Add(new LanguageInfo("it", "it", "Italian", "it")); + options.Languages.Add(new LanguageInfo("hu", "hu", "Magyar")); + options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português")); + options.Languages.Add(new LanguageInfo("ru", "ru", "Русский")); + options.Languages.Add(new LanguageInfo("sk", "sk", "Slovak")); + options.Languages.Add(new LanguageInfo("tr", "tr", "Türkçe")); + options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); + options.Languages.Add(new LanguageInfo("zh-Hant", "zh-Hant", "繁體中文")); + }); + + context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.Authority = configuration["AuthServer:Authority"]; + options.RequireHttpsMetadata = Convert.ToBoolean(configuration["AuthServer:RequireHttpsMetadata"]); + options.Audience = "WebApi"; + }); + + Configure(options => + { + options.KeyPrefix = "WebApi:"; + }); + + if (!hostingEnvironment.IsDevelopment()) + { + var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]); + context.Services + .AddDataProtection() + .PersistKeysToStackExchangeRedis(redis, "WebApi-Protection-Keys"); + } + + context.Services.AddCors(options => + { + options.AddDefaultPolicy(builder => + { + builder + .WithOrigins( + configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); + }); + } + /// + /// 判断是否应该加入当前分组 + /// + /// + /// + /// + private bool IsIncludeInDoc(string docName, ApiDescription apiDesc) + { + if (!apiDesc.TryGetMethodInfo(out MethodInfo methodInfo)) + { + return false; + } + + var groups = methodInfo.ReflectedType.GetCustomAttributes(true) + .OfType() + .Select(attr => attr.GroupName) + .ToList(); + + if (docName == SwaggerGroupConsts.Default) + { + if (groups.Count == 0) + { + return true; + } + + return apiDesc.GroupName == SwaggerGroupConsts.Default; + } + + return docName == apiDesc.GroupName; + } + + /// + /// 获取当前目录下的xml文档 + /// + /// + private List GetXmlFiles() + { + var basePath = Path.GetDirectoryName(typeof(Program).Assembly.Location); + Log.Information(" TEST- base Path PATH ==> " + basePath); + //Console.WriteLine(" TEST- base Path PATH ==> " + basePath); + var files1 = Directory.GetFiles(basePath, "*.Application*.xml"); + return files1.ToList(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + var env = context.GetEnvironment(); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseErrorPage(); + app.UseHsts(); + } + + app.UseHttpsRedirection(); + app.UseCorrelationId(); + app.UseStaticFiles(); + app.UseRouting(); + app.UseCors(); + app.UseAuthentication(); + if (_isMultiTenancy) + { + app.UseMultiTenancy(); + } + app.UseAbpRequestLocalization(); + app.UseAuthorization(); + app.UseSwagger(); + app.UseAbpSwaggerUI(options => + { + //options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support APP API"); + //遍历Swagger分组,注册SwaggerEndpoint + foreach (var groupName in typeof(SwaggerGroupConsts).GetFields() + .Select(f => f.GetValue(null).ToString())) + { + Log.Information(groupName); + options.SwaggerEndpoint($"/swagger/{groupName}/swagger.json", $"{groupName} API"); + } + var configuration = context.GetConfiguration(); + options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); + options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); + options.OAuthScopes("WebApi"); + }); + + + + app.UseAuditing(); + app.UseAbpSerilogEnrichers(); + app.UseConfiguredEndpoints(); + } + } + +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj new file mode 100644 index 0000000..d38837a --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/Win_in.Sfs.Scp.WebApi.HttpApi.Host.csproj @@ -0,0 +1,47 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.WebApi + true + Win_in.Sfs.Scp.WebApi-c2d31439-b723-48e2-b061-5ebd7aeb6010 + + + + ..\..\host\Win_in.Sfs.Scp.WebApi.HttpApi.Host\bin\Debug\net5.0\Win_in.Sfs.Scp.WebApi.HttpApi.Host.xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json new file mode 100644 index 0000000..ac2b8f1 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.json @@ -0,0 +1,20 @@ +{ + "App": { + "CorsOrigins": "https://*.WebApi.com,http://localhost:4200,http://localhost:44307,https://localhost:44307" + }, + "ConnectionStrings": { + "Default": "Server=119.3.213.202,13315;Database=WebApi_Module;User ID=sa;Password=ChangkeTec@2020;connection timeout=600", + "WebApi": "Server=119.3.213.202,13315;Database=WebApi_Module;User ID=sa;Password=ChangkeTec@2020;connection timeout=600" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "AuthServer": { + "Authority": "https://localhost:9000/", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebApi_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "IsMultiTenancy": true + +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.secrets.json b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.secrets.json new file mode 100644 index 0000000..5feb464 --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/appsettings.secrets.json @@ -0,0 +1,20 @@ +{ + "App": { + "CorsOrigins": "https://*.WebApi.com,http://localhost:4200,http://localhost:44307,https://localhost:44307" + }, + "ConnectionStrings": { + "Default": "Server=119.3.213.202,13315;Database=WebApi_Module;User ID=sa;Password=ChangkeTec@2020;connection timeout=600", + "WebApi": "Server=119.3.213.202,13315;Database=WebApi_Module;User ID=sa;Password=ChangkeTec@2020;connection timeout=600" + }, + "Redis": { + "Configuration": "127.0.0.1" + }, + "AuthServer": { + "Authority": "https://localhost:9000/", + "RequireHttpsMetadata": "false", + "SwaggerClientId": "WebApi_Swagger", + "SwaggerClientSecret": "1q2w3e*" + }, + "IsMultiTenancy": true + +} diff --git a/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/yarn.lock b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/yarn.lock new file mode 100644 index 0000000..fb57ccd --- /dev/null +++ b/ScpWebApiService/host/Win_in.Sfs.Scp.WebApi.HttpApi.Host/yarn.lock @@ -0,0 +1,4 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateDTO.cs new file mode 100644 index 0000000..05689ee --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public class ASNCreateDTO : ASNCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..eb09dc9 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNCreateOrUpdateDTOBase.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public abstract class ASNCreateOrUpdateDTOBase : EntityDto + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs new file mode 100644 index 0000000..ab2ba8e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNDTO.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public class ASNDTO : AuditedEntityDto + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNUpdateDTO.cs new file mode 100644 index 0000000..b1dfcbf --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/ASNUpdateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public class ASNUpdateDTO : ASNCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNAppService.cs new file mode 100644 index 0000000..e13bd46 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/ASNs/IASNAppService.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public interface IASNAppService:ICrudAppService + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/AbpPractice.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/AbpPractice.cs new file mode 100644 index 0000000..eb4203f --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/AbpPractice.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Win_in.Sfs.Scp.WebApi +{ + public static class SwaggerGroupConsts + { + public const string ScpWebApi = "ScpWebApi"; + public const string Default = "AbpDefault"; + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xsd b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/InputDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/InputDTO.cs new file mode 100644 index 0000000..a71acc1 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/InputDTO.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Application.Dtos; + +namespace Win_in.Sfs.Scp.WebApi +{ + public class InputDTO:EntityDto + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs new file mode 100644 index 0000000..d22bb45 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/IPOAppService.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// PO接口 + /// + public interface IPOAppService : ICrudAppService + { + + } + + +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs new file mode 100644 index 0000000..631aaf4 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateDTO.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单创建Dto + /// + public class POCreateDTO : POCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..6aa8355 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POCreateOrUpdateDTOBase.cs @@ -0,0 +1,103 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单创建更新基础Dto + /// + public abstract class POCreateOrUpdateDTOBase : EntityDtoBase + { + /// + /// 代码(Code) + /// + [Display(Name = "代码(Code)")] + public string Code { set; get; } + + /// + /// 简称(Name) + /// + [Display(Name = "简称(Name)")] + public string Name { set; get; } + + /// + /// 描述(Description) + /// + [Display(Name = "描述(Description)")] + public string Desc { set; get; } + + /// + /// 级别(Rank) + /// + [Display(Name = "级别(Rank)")] + public string Rank { get; set; } + + /// + /// 地址 + /// + [Display(Name = "地址(Address)")] + public string Address { get; set; } + + /// + /// 国家(Country) + /// + [Display(Name = "国家(Country)")] + public string Country { get; set; } + + /// + /// 城市(City) + /// + [Display(Name = "城市(City)")] + public string City { get; set; } + + /// + /// 电话(Phone) + /// + [Display(Name = "电话(Phone)")] + public string Phone { set; get; } + + /// + /// 传真(Fax) + /// + [Display(Name = "传真(Fax)")] + public string Fax { set; get; } + + /// + /// 邮编(PostId) + /// + [Display(Name = "邮编(PostId)")] + public string PostId { set; get; } + + /// + /// 联系人(ContactName) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 货币(Currency) + /// + [Display(Name = "货币(Currency)")] + public string Currency { set; get; } + + /// + /// 是否激活(IsActive) + /// + [Display(Name = "是否激活(IsActive)")] + public bool IsActive { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs new file mode 100644 index 0000000..82bee1b --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODTO.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单主表Dto + /// + public class PODTO : EntityDtoBase + { + + /// + /// 代码(Code) + /// + [Display(Name = "代码(Code)")] + public string Code { set; get; } + + /// + /// 简称(Name) + /// + [Display(Name = "简称(Name)")] + public string Name { set; get; } + + /// + /// 描述(Description) + /// + [Display(Name = "描述(Description)")] + public string Desc { set; get; } + + /// + /// 级别(Rank) + /// + [Display(Name = "级别(Rank)")] + public string Rank { get; set; } + + /// + /// 地址 + /// + [Display(Name = "地址(Address)")] + public string Address { get; set; } + + /// + /// 国家(Country) + /// + [Display(Name = "国家(Country)")] + public string Country { get; set; } + + /// + /// 城市(City) + /// + [Display(Name = "城市(City)")] + public string City { get; set; } + + /// + /// 电话(Phone) + /// + [Display(Name = "电话(Phone)")] + public string Phone { set; get; } + + /// + /// 传真(Fax) + /// + [Display(Name = "传真(Fax)")] + public string Fax { set; get; } + + /// + /// 邮编(PostId) + /// + [Display(Name = "邮编(PostId)")] + public string PostId { set; get; } + + /// + /// 联系人(ContactName) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 货币(Currency) + /// + [Display(Name = "货币(Currency)")] + public string Currency { set; get; } + + /// + /// 是否激活(IsActive) + /// + [Display(Name = "是否激活(IsActive)")] + public bool IsActive { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + public virtual ICollection Details { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs new file mode 100644 index 0000000..c8338f6 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/PODetailDTO.cs @@ -0,0 +1,91 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单明细表Dto + /// + public class PODetailDTO : EntityDetailBase + { + /// + /// 订单号(PoNumber) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 订单行(PoLine) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 订单数量(OrderQty) + /// + [Display(Name = "订单数量(OrderQty)")] + public decimal OrderQty { set; get; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { set; get; } + + /// + /// 供应商计量单位(SupplierPackUom) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(SupplierPackQty) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(SupplierPackConvertRate) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal SupplierPackConvertRate { set; get; } + + /// + /// 是否寄存订单(IsConsignment) + /// + [Display(Name = "是否寄存订单(IsConsignment)")] + public bool IsConsignment { set; get; } + + /// + /// 订单行状态(LineStatus) + /// + [Display(Name = "订单行状态(LineStatus)")] + public int LineStatus { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs new file mode 100644 index 0000000..73f06da --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/POs/POUpdateDTO.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单更新Dto + /// + public class POUpdateDTO : POCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs new file mode 100644 index 0000000..cc46762 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/IPartAppService.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.Parts +{ + /// + /// Part接口 + /// + public interface IPartAppService : ICrudAppService + { + + + } + + +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs new file mode 100644 index 0000000..24274aa --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateDTO.cs @@ -0,0 +1,16 @@ +using System.ComponentModel.DataAnnotations; + +namespace Win_in.Sfs.Scp.WebApi.Parts +{ + /// + /// 零件创建Dto + /// + public class PartCreateDTO : PartCreateOrUpdateDTOBase + { + /// + /// 代码(Code) + /// + [Display(Name = "代码")] + public string Code { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..f8bbe6e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartCreateOrUpdateDTOBase.cs @@ -0,0 +1,148 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.Parts +{ + /// + /// 零件创建更新基础Dto + /// + public abstract class PartCreateOrUpdateDTOBase : EntityDtoBase + { + + + + /// + /// 名称(Name) + /// + [Display(Name = "名称")] + public string Name { get; set; } + + /// + /// 描述(Desc1) + /// + [Display(Name = "描述")] + public string Desc1 { get; set; } + + /// + /// 描述2(Desc2) + /// + [Display(Name = "描述2")] + public string Desc2 { get; set; } + + /// + /// 状态(Status) + /// + [Display(Name = "状态")] + public string Status { get; set; } + + /// + /// 制造件(IsMakePart) + /// + [Display(Name = "制造件")] + public bool IsMakePart { get; set; } + + /// + /// 采购件(IsBuyPart) + /// + [Display(Name = "采购件")] + public bool IsBuyPart { get; set; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位")] + public string Uom { get; set; } + + /// + /// ABC类(abcClass) + /// + [Display(Name = "ABC类")] + public string abcClass { get; set; } + + /// + /// 产品类(productline) + /// + [Display(Name = "产品类")] + public string productline { get; set; } + + /// + /// 类型(Type) + /// + [Display(Name = "类型")] + public string Type { get; set; } + + /// + /// 种类(catalog) + /// + [Display(Name = "代码")] + public string catalog { get; set; } + + /// + /// 分组(Group) + /// + [Display(Name = "分组")] + public string Group { get; set; } + + /// + /// 颜色(Color) + /// + [Display(Name = "颜色")] + public string Color { get; set; } + + /// + /// 配置(Configuration) + /// + [Display(Name = "配置")] + public string Configuration { get; set; } + + /// + /// 项目(Project) + /// + [Display(Name = "项目")] + public string Project { get; set; } + + /// + /// 工程变革(Eco) + /// + [Display(Name = "工程变革")] + public string Eco { get; set; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位")] + public string StdPackUom { get; set; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量")] + public decimal StdPackQty { get; set; } + + /// + /// 替代计量单位(ExtPackUom) + /// + [Display(Name = "替代计量单位")] + public string ExtPackUom { get; set; } + + /// + /// 替代包装数量(ExtPackQty) + /// + [Display(Name = "替代包装数量")] + public decimal ExtPackQty { get; set; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点")] + public string Site { get; set; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司")] + public string Company { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartDTO.cs new file mode 100644 index 0000000..a497aaa --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartDTO.cs @@ -0,0 +1,152 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.Parts +{ + /// + /// 零件Dto + /// + public class PartDTO : EntityDtoBase + { + + /// + /// 代码(Code) + /// + [Display(Name = "代码")] + public string Code { get; set; } + + /// + /// 名称(Name) + /// + [Display(Name = "名称")] + public string Name { get; set; } + + /// + /// 描述(Desc1) + /// + [Display(Name = "描述")] + public string Desc1 { get; set; } + + /// + /// 描述2(Desc2) + /// + [Display(Name = "描述2")] + public string Desc2 { get; set; } + + /// + /// 状态(Status) + /// + [Display(Name = "状态")] + public string Status { get; set; } + + /// + /// 制造件(IsMakePart) + /// + [Display(Name = "制造件")] + public bool IsMakePart { get; set; } + + /// + /// 采购件(IsBuyPart) + /// + [Display(Name = "采购件")] + public bool IsBuyPart { get; set; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位")] + public string Uom { get; set; } + + /// + /// ABC类(abcClass) + /// + [Display(Name = "ABC类")] + public string abcClass { get; set; } + + /// + /// 产品类(productline) + /// + [Display(Name = "产品类")] + public string productline { get; set; } + + /// + /// 类型(Type) + /// + [Display(Name = "类型")] + public string Type { get; set; } + + /// + /// 种类(catalog) + /// + [Display(Name = "代码")] + public string catalog { get; set; } + + /// + /// 分组(Group) + /// + [Display(Name = "分组")] + public string Group { get; set; } + + /// + /// 颜色(Color) + /// + [Display(Name = "颜色")] + public string Color { get; set; } + + /// + /// 配置(Configuration) + /// + [Display(Name = "配置")] + public string Configuration { get; set; } + + /// + /// 项目(Project) + /// + [Display(Name = "项目")] + public string Project { get; set; } + + /// + /// 工程变革(Eco) + /// + [Display(Name = "工程变革")] + public string Eco { get; set; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位")] + public string StdPackUom { get; set; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量")] + public decimal StdPackQty { get; set; } + + /// + /// 替代计量单位(ExtPackUom) + /// + [Display(Name = "替代计量单位")] + public string ExtPackUom { get; set; } + + /// + /// 替代包装数量(ExtPackQty) + /// + [Display(Name = "替代包装数量")] + public decimal ExtPackQty { get; set; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点")] + public string Site { get; set; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司")] + public string Company { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs new file mode 100644 index 0000000..9b7c73c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Parts/PartUpdateDTO.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.WebApi.Parts +{ + /// + /// 零件更新Dto + /// + public class PartUpdateDTO : PartCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissionDefinitionProvider.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissionDefinitionProvider.cs new file mode 100644 index 0000000..db0babc --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissionDefinitionProvider.cs @@ -0,0 +1,20 @@ +using Win_in.Sfs.Scp.WebApi.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace Win_in.Sfs.Scp.WebApi.Permissions +{ + public class WebApiPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + var scpWebApi = context.AddGroup(WebApiPermissions.GroupName, L("Permission:WebApi")); + + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissions.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissions.cs new file mode 100644 index 0000000..a70ef4e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Permissions/WebApiPermissions.cs @@ -0,0 +1,17 @@ +using Volo.Abp.Reflection; + +namespace Win_in.Sfs.Scp.WebApi.Permissions +{ + public class WebApiPermissions + { + public const string GroupName = "WebApi"; + public const string Create = "Create"; + public const string Update = "Update"; + public const string Delete = "Delete"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(WebApiPermissions)); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs new file mode 100644 index 0000000..49b0d3e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/IReceiptAppService.cs @@ -0,0 +1,12 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.Receipts +{ + public interface IReceiptAppService : ICrudAppService + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs new file mode 100644 index 0000000..2bf7bc4 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.Receipts +{ + public class ReceiptCreateDTO : ReceiptCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..6c594cc --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptCreateOrUpdateDTOBase.cs @@ -0,0 +1,172 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.Receipts +{ + public abstract class ReceiptCreateOrUpdateDTOBase : EntityDtoBase + { + /// + /// 发货单号(RcNumber) + /// + [Display(Name = "发货单号(RcNumber)")] + public string RcNumber { set; get; } + + /// + /// 发货单号(AsnNumber) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + + /// + /// 要货计划单号(RpNumber) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { set; get; } + + /// + /// 订单号(PoNumber) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(PoNumber) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 收货单类型(RcType) + /// + [Display(Name = "收货单类型(RcType)")] + public string RcType { set; get; } + + /// + /// 仓库(Warehouse) + /// + [Display(Name = "仓库(Warehouse)")] + public string Warehouse { set; get; } + + /// + /// 收货口(WarehouseDoor) + /// + [Display(Name = "收货口(WarehouseDoor)")] + public string WarehouseDoor { set; get; } + + /// + /// 时间窗口开始(TimeWindowBegin) + /// + [Display(Name = "时间窗口开始(TimeWindowBegin)")] + public DateTime TimeWindowBegin { set; get; } + + /// + /// 时间窗口结束(TimeWIndowEnd) + /// + [Display(Name = "时间窗口结束(TimeWIndowEnd)")] + public DateTime TimeWIndowEnd { set; get; } + + /// + /// 收货时间(ReceiveTime) + /// + [Display(Name = "收货时间(ReceiveTime)")] + public DateTime ReceiveTime { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 订单行(PoLine) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 批次(Batch) + /// + [Display(Name = "批次(Batch)")] + public string Batch { set; get; } + + /// + /// 供应商批次(SupplierBatch) + /// + [Display(Name = "供应商批次(SupplierBatch)")] + public string SupplierBatch { set; get; } + + /// + /// 生产日期(ProduceDate) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { set; get; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 发货数量(DeliverQty) + /// + [Display(Name = "发货数量(DeliverQty)")] + public decimal DeliverQty { set; get; } + + /// + /// 收货数量(ReceiveQty) + /// + [Display(Name = "收货数量(ReceiveQty)")] + public decimal ReceiveQty { set; get; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { set; get; } + + /// + /// 供应商计量单位(SupplierPackUom) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(SupplierPackQty) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(SupplierPackConvertRate) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal SupplierPackConvertRate { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptDTO.cs new file mode 100644 index 0000000..ab861d3 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptDTO.cs @@ -0,0 +1,172 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.Receipts +{ + public class ReceiptDTO : EntityDtoBase + { + /// + /// 发货单号(RcNumber) + /// + [Display(Name = "发货单号(RcNumber)")] + public string RcNumber { set; get; } + + /// + /// 发货单号(AsnNumber) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + + /// + /// 要货计划单号(RpNumber) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { set; get; } + + /// + /// 订单号(PoNumber) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(PoNumber) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 收货单类型(RcType) + /// + [Display(Name = "收货单类型(RcType)")] + public string RcType { set; get; } + + /// + /// 仓库(Warehouse) + /// + [Display(Name = "仓库(Warehouse)")] + public string Warehouse { set; get; } + + /// + /// 收货口(WarehouseDoor) + /// + [Display(Name = "收货口(WarehouseDoor)")] + public string WarehouseDoor { set; get; } + + /// + /// 时间窗口开始(TimeWindowBegin) + /// + [Display(Name = "时间窗口开始(TimeWindowBegin)")] + public DateTime TimeWindowBegin { set; get; } + + /// + /// 时间窗口结束(TimeWIndowEnd) + /// + [Display(Name = "时间窗口结束(TimeWIndowEnd)")] + public DateTime TimeWIndowEnd { set; get; } + + /// + /// 收货时间(ReceiveTime) + /// + [Display(Name = "收货时间(ReceiveTime)")] + public DateTime ReceiveTime { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 订单行(PoLine) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 批次(Batch) + /// + [Display(Name = "批次(Batch)")] + public string Batch { set; get; } + + /// + /// 供应商批次(SupplierBatch) + /// + [Display(Name = "供应商批次(SupplierBatch)")] + public string SupplierBatch { set; get; } + + /// + /// 生产日期(ProduceDate) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { set; get; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 发货数量(DeliverQty) + /// + [Display(Name = "发货数量(DeliverQty)")] + public decimal DeliverQty { set; get; } + + /// + /// 收货数量(ReceiveQty) + /// + [Display(Name = "收货数量(ReceiveQty)")] + public decimal ReceiveQty { set; get; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { set; get; } + + /// + /// 供应商计量单位(SupplierPackUom) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(SupplierPackQty) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(SupplierPackConvertRate) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal SupplierPackConvertRate { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs new file mode 100644 index 0000000..a60d82d --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Receipts/ReceiptUpdateDTO.cs @@ -0,0 +1,9 @@ +using Win_in.Sfs.Scp.WebApi.Receipts; + +namespace Win_in.Sfs.Scp.WebApi.Receipts +{ + public class ReceiptUpdateDTO : ReceiptCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/ISampleAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/ISampleAppService.cs new file mode 100644 index 0000000..6b75c79 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/ISampleAppService.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + public interface ISampleAppService : IApplicationService + { + Task GetAsync(); + + Task GetAuthorizedAsync(); + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/SampleDto.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/SampleDto.cs new file mode 100644 index 0000000..33b3e6b --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Samples/SampleDto.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + public class SampleDto + { + public int Value { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/ISupplierPartAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/ISupplierPartAppService.cs new file mode 100644 index 0000000..77ef295 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/ISupplierPartAppService.cs @@ -0,0 +1,13 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win_in.Sfs.Scp.WebApi.SupplierParts; + +namespace Win_in.Sfs.Scp.WebApi.Application.Contracts.SupplierParts +{ + public interface ISupplierPartAppService : ICrudAppService + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateDTO.cs new file mode 100644 index 0000000..feacc4f --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.SupplierParts +{ + public class SupplierPartCreateDTO : SupplierPartCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..635b8ea --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartCreateOrUpdateDTOBase.cs @@ -0,0 +1,47 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.SupplierParts +{ + public abstract class SupplierPartCreateOrUpdateDTOBase : EntityDtoBase + { + /// + /// 供应商代码(SupplierCode) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 供应商零件号(SupplierPartCode) + /// + [Display(Name = "供应商零件号(SupplierPartCode)")] + public string SupplierPartCode { set; get; } + + /// + /// 供应商标包计量单位(SupplierStdPackUom) + /// + [Display(Name = "供应商标包计量单位(SupplierStdPackUom)")] + public string SupplierStdPackUom { get; set; } + + /// + /// 供应商标包数量 + /// + [Display(Name = "供应商标包数量(SupplierStdPackQty)")] + public decimal SupplierStdPackQty { get; set; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { get; set; } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartDto.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartDto.cs new file mode 100644 index 0000000..01f51c2 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartDto.cs @@ -0,0 +1,46 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.SupplierParts +{ + public class SupplierPartDTO : EntityDtoBase + { + /// + /// Ӧ̴(SupplierCode) + /// + [Display(Name = "Ӧ̴(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// (PartCode) + /// + [Display(Name = "(PartCode)")] + public string PartCode { set; get; } + + /// + /// Ӧ(SupplierPartCode) + /// + [Display(Name = "Ӧ(SupplierPartCode)")] + public string SupplierPartCode { set; get; } + + /// + /// Ӧ̱λ(SupplierStdPackUom) + /// + [Display(Name = "Ӧ̱λ(SupplierStdPackUom)")] + public string SupplierStdPackUom { get; set; } + + /// + /// Ӧ̱ + /// + [Display(Name = "Ӧ̱(SupplierStdPackQty)")] + public decimal SupplierStdPackQty { get; set; } + + /// + /// ע(Remark) + /// + [Display(Name = "ע(Remark)")] + public string Remark { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartUpdateDTO.cs new file mode 100644 index 0000000..3409697 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/SupplierParts/SupplierPartUpdateDTO.cs @@ -0,0 +1,9 @@ +using Win_in.Sfs.Scp.WebApi.SupplierParts; + +namespace Win_in.Sfs.Scp.WebApi.SupplierParts +{ + public class SupplierPartUpdateDTO : SupplierPartCreateOrUpdateDTOBase + { + + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs new file mode 100644 index 0000000..bb2bb35 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/ISupplierAppService.cs @@ -0,0 +1,13 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win_in.Sfs.Scp.WebApi.Suppliers; + +namespace Win_in.Sfs.Scp.WebApi.Supplierss +{ + public interface ISupplierAppService : ICrudAppService + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs new file mode 100644 index 0000000..f9a6c13 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.Suppliers +{ + public class SupplierCreateDTO : SupplierCreateOrUpdateDTOBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs new file mode 100644 index 0000000..9a25433 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierCreateOrUpdateDTOBase.cs @@ -0,0 +1,100 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.Suppliers +{ + public abstract class SupplierCreateOrUpdateDTOBase : EntityDtoBase + { + /// + /// 代码(Code) + /// + [Display(Name = "代码(Code)")] + public string Code { set; get; } + + /// + /// 简称(Name) + /// + [Display(Name = "简称(Name)")] + public string Name { set; get; } + + /// + /// 描述(Description) + /// + [Display(Name = "描述(Description)")] + public string Desc { set; get; } + + /// + /// 级别(Rank) + /// + [Display(Name = "级别(Rank)")] + public string Rank { get; set; } + + /// + /// 地址 + /// + [Display(Name = "地址(Address)")] + public string Address { get; set; } + + /// + /// 国家(Country) + /// + [Display(Name = "国家(Country)")] + public string Country { get; set; } + + /// + /// 城市(City) + /// + [Display(Name = "城市(City)")] + public string City { get; set; } + + /// + /// 电话(Phone) + /// + [Display(Name = "电话(Phone)")] + public string Phone { set; get; } + + /// + /// 传真(Fax) + /// + [Display(Name = "传真(Fax)")] + public string Fax { set; get; } + + /// + /// 邮编(PostId) + /// + [Display(Name = "邮编(PostId)")] + public string PostId { set; get; } + + /// + /// 联系人(ContactName) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 货币(Currency) + /// + [Display(Name = "货币(Currency)")] + public string Currency { set; get; } + + /// + /// 是否激活(IsActive) + /// + [Display(Name = "是否激活(IsActive)")] + public bool IsActive { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierDTO.cs new file mode 100644 index 0000000..967f82a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierDTO.cs @@ -0,0 +1,100 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi.Suppliers +{ + public class SupplierDTO : EntityDtoBase + { + /// + /// 代码(Code) + /// + [Display(Name = "代码(Code)")] + public string Code { set; get; } + + /// + /// 简称(Name) + /// + [Display(Name = "简称(Name)")] + public string Name { set; get; } + + /// + /// 描述(Description) + /// + [Display(Name = "描述(Description)")] + public string Desc { set; get; } + + /// + /// 级别(Rank) + /// + [Display(Name = "级别(Rank)")] + public string Rank { get; set; } + + /// + /// 地址 + /// + [Display(Name = "地址(Address)")] + public string Address { get; set; } + + /// + /// 国家(Country) + /// + [Display(Name = "国家(Country)")] + public string Country { get; set; } + + /// + /// 城市(City) + /// + [Display(Name = "城市(City)")] + public string City { get; set; } + + /// + /// 电话(Phone) + /// + [Display(Name = "电话(Phone)")] + public string Phone { set; get; } + + /// + /// 传真(Fax) + /// + [Display(Name = "传真(Fax)")] + public string Fax { set; get; } + + /// + /// 邮编(PostId) + /// + [Display(Name = "邮编(PostId)")] + public string PostId { set; get; } + + /// + /// 联系人(ContactName) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 货币(Currency) + /// + [Display(Name = "货币(Currency)")] + public string Currency { set; get; } + + /// + /// 是否激活(IsActive) + /// + [Display(Name = "是否激活(IsActive)")] + public bool IsActive { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs new file mode 100644 index 0000000..3a7cccb --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Suppliers/SupplierUpdateDTO.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi.Suppliers +{ + public class SupplierUpdateDTO : SupplierCreateOrUpdateDTOBase + { + + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/WebApiApplicationContractsModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/WebApiApplicationContractsModule.cs new file mode 100644 index 0000000..878795d --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/WebApiApplicationContractsModule.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(WebApiDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) + )] + public class WebApiApplicationContractsModule : AbpModule + { + + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj new file mode 100644 index 0000000..f28c42f --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.csproj @@ -0,0 +1,25 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.WebApi + + + + ..\..\host\Win_in.Sfs.Scp.WebApi.HttpApi.Host\bin\Debug\net5.0\Win_in.Sfs.Scp.WebApi.Application.Contracts.xml + + + + + + + + + + + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.xml new file mode 100644 index 0000000..23771eb --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application.Contracts/Win_in.Sfs.Scp.WebApi.Application.Contracts.xml @@ -0,0 +1,998 @@ + + + + Win_in.Sfs.Scp.WebApi.Application.Contracts + + + + + Part接口 + + + + + 零件创建Dto + + + + + 代码(Code) + + + + + 零件创建更新基础Dto + + + + + 名称(Name) + + + + + 描述(Desc1) + + + + + 描述2(Desc2) + + + + + 状态(Status) + + + + + 制造件(IsMakePart) + + + + + 采购件(IsBuyPart) + + + + + 计量单位(Uom) + + + + + ABC类(abcClass) + + + + + 产品类(productline) + + + + + 类型(Type) + + + + + 种类(catalog) + + + + + 分组(Group) + + + + + 颜色(Color) + + + + + 配置(Configuration) + + + + + 项目(Project) + + + + + 版本(version) + + + + + 工程变革(Eco) + + + + + 标包计量单位(StdPackUom) + + + + + 标包数量(StdPackQty) + + + + + 替代计量单位(ExtPackUom) + + + + + 替代包装数量(ExtPackQty) + + + + + 地点(Site) + + + + + 公司(Company) + + + + + 零件Dto + + + + + 代码(Code) + + + + + 名称(Name) + + + + + 描述(Desc1) + + + + + 描述2(Desc2) + + + + + 状态(Status) + + + + + 制造件(IsMakePart) + + + + + 采购件(IsBuyPart) + + + + + 计量单位(Uom) + + + + + ABC类(abcClass) + + + + + 产品类(productline) + + + + + 类型(Type) + + + + + 种类(catalog) + + + + + 分组(Group) + + + + + 颜色(Color) + + + + + 配置(Configuration) + + + + + 项目(Project) + + + + + 版本(version) + + + + + 工程变革(Eco) + + + + + 标包计量单位(StdPackUom) + + + + + 标包数量(StdPackQty) + + + + + 替代计量单位(ExtPackUom) + + + + + 替代包装数量(ExtPackQty) + + + + + 地点(Site) + + + + + 公司(Company) + + + + + 零件更新Dto + + + + + PO接口 + + + + + 采购订单创建Dto + + + + + 采购订单创建更新基础Dto + + + + + 代码(Code) + + + + + 简称(Name) + + + + + 描述(Description) + + + + + 级别(Rank) + + + + + 地址 + + + + + 国家(Country) + + + + + 城市(City) + + + + + 电话(Phone) + + + + + 传真(Fax) + + + + + 邮编(PostId) + + + + + 联系人(ContactName) + + + + + 货币(Currency) + + + + + 是否激活(IsActive) + + + + + 公司(Company) + + + + + 备注(Remark) + + + + + 采购订单明细表Dto + + + + + 订单号(PoNumber) + + + + + 订单行(PoLine) + + + + + 零件号(PartCode) + + + + + 计量单位(Uom) + + + + + 订单数量(OrderQty) + + + + + 标包计量单位(StdPackUom) + + + + + 标包数量(StdPackQty) + + + + + 供应商计量单位(SupplierPackUom) + + + + + 供应商包装数量(SupplierPackQty) + + + + + 供应商包装转换率(SupplierPackConvertRate) + + + + + 是否寄存订单(IsConsignment) + + + + + 订单行状态(LineStatus) + + + + + 备注(Remark) + + + + + 采购订单主表Dto + + + + + 代码(Code) + + + + + 简称(Name) + + + + + 描述(Description) + + + + + 级别(Rank) + + + + + 地址 + + + + + 国家(Country) + + + + + 城市(City) + + + + + 电话(Phone) + + + + + 传真(Fax) + + + + + 邮编(PostId) + + + + + 联系人(ContactName) + + + + + 货币(Currency) + + + + + 是否激活(IsActive) + + + + + 公司(Company) + + + + + 备注(Remark) + + + + + 采购订单更新Dto + + + + + 发货单号(RcNumber) + + + + + 发货单号(AsnNumber) + + + + + 要货计划单号(RpNumber) + + + + + 订单号(PoNumber) + + + + + 供应商代码(PoNumber) + + + + + 收货单类型(RcType) + + + + + 仓库(Warehouse) + + + + + 收货口(WarehouseDoor) + + + + + 时间窗口开始(TimeWindowBegin) + + + + + 时间窗口结束(TimeWIndowEnd) + + + + + 收货时间(ReceiveTime) + + + + + 地点(Site) + + + + + 公司(Company) + + + + + 订单行(PoLine) + + + + + 零件号(PartCode) + + + + + 批次(Batch) + + + + + 供应商批次(SupplierBatch) + + + + + 生产日期(ProduceDate) + + + + + 计量单位(Uom) + + + + + 发货数量(DeliverQty) + + + + + 收货数量(ReceiveQty) + + + + + 标包计量单位(StdPackUom) + + + + + 标包数量(StdPackQty) + + + + + 供应商计量单位(SupplierPackUom) + + + + + 供应商包装数量(SupplierPackQty) + + + + + 供应商包装转换率(SupplierPackConvertRate) + + + + + 备注(Remark) + + + + + 发货单号(RcNumber) + + + + + 发货单号(AsnNumber) + + + + + 要货计划单号(RpNumber) + + + + + 订单号(PoNumber) + + + + + 供应商代码(PoNumber) + + + + + 收货单类型(RcType) + + + + + 仓库(Warehouse) + + + + + 收货口(WarehouseDoor) + + + + + 时间窗口开始(TimeWindowBegin) + + + + + 时间窗口结束(TimeWIndowEnd) + + + + + 收货时间(ReceiveTime) + + + + + 地点(Site) + + + + + 公司(Company) + + + + + 订单行(PoLine) + + + + + 零件号(PartCode) + + + + + 批次(Batch) + + + + + 供应商批次(SupplierBatch) + + + + + 生产日期(ProduceDate) + + + + + 计量单位(Uom) + + + + + 发货数量(DeliverQty) + + + + + 收货数量(ReceiveQty) + + + + + 标包计量单位(StdPackUom) + + + + + 标包数量(StdPackQty) + + + + + 供应商计量单位(SupplierPackUom) + + + + + 供应商包装数量(SupplierPackQty) + + + + + 供应商包装转换率(SupplierPackConvertRate) + + + + + 备注(Remark) + + + + + 供应商代码(SupplierCode) + + + + + 零件号(PartCode) + + + + + 供应商零件号(SupplierPartCode) + + + + + 供应商标包计量单位(SupplierStdPackUom) + + + + + 供应商标包数量 + + + + + 备注(Remark) + + + + + 供应商代码(SupplierCode) + + + + + 零件号(PartCode) + + + + + 供应商零件号(SupplierPartCode) + + + + + 供应商标包计量单位(SupplierStdPackUom) + + + + + 供应商标包数量 + + + + + 备注(Remark) + + + + + 代码(Code) + + + + + 简称(Name) + + + + + 描述(Description) + + + + + 级别(Rank) + + + + + 地址 + + + + + 国家(Country) + + + + + 城市(City) + + + + + 电话(Phone) + + + + + 传真(Fax) + + + + + 邮编(PostId) + + + + + 联系人(ContactName) + + + + + 货币(Currency) + + + + + 是否激活(IsActive) + + + + + 公司(Company) + + + + + 备注(Remark) + + + + + 代码(Code) + + + + + 简称(Name) + + + + + 描述(Description) + + + + + 级别(Rank) + + + + + 地址 + + + + + 国家(Country) + + + + + 城市(City) + + + + + 电话(Phone) + + + + + 传真(Fax) + + + + + 邮编(PostId) + + + + + 联系人(ContactName) + + + + + 货币(Currency) + + + + + 是否激活(IsActive) + + + + + 公司(Company) + + + + + 备注(Remark) + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs new file mode 100644 index 0000000..3d81d94 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/ASNs/ASNAppService.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi.ASNs +{ + public class ASNAppService:CrudAppService, IASNAppService + { + private readonly IASNRepository _asnRepository; + + public ASNAppService(IASNRepository repository) : base(repository) + { + _asnRepository = repository; + } + + /// + /// 新增实体 (Create New entity) + /// + /// + /// + [HttpPost] + public override Task CreateAsync(ASNCreateDTO input) + { + return base.CreateAsync(input); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xsd b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs new file mode 100644 index 0000000..d1fc2d9 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/POs/POAppService.cs @@ -0,0 +1,88 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.POs +{ + /// + /// 采购订单服务 + /// + [AllowAnonymous] + [Route("api/SCP/PO")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + public class POAppService : CrudAppService, IPOAppService + { + private readonly IPORepository _partRepository; + + public POAppService(IPORepository repository) : base(repository) + { + _partRepository = repository; + } + + + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + + /// + /// 新增实体 (Create New entity) + /// + /// + [HttpPost] + [Route("")] + public override Task CreateAsync(POCreateDTO input) + { + return base.CreateAsync(input); + } + + /// + /// 修改实体 (Modify entity) + /// + /// + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, POUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs new file mode 100644 index 0000000..75f0355 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Parts/PartAppService.cs @@ -0,0 +1,88 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; +using Win_in.Sfs.Scp.WebApi.ASNs; + +namespace Win_in.Sfs.Scp.WebApi.Parts +{ + /// + ///零件服务 + /// + [AllowAnonymous] + [Route("api/SCP/Part")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + + public class PartAppService : CrudAppService, IPartAppService + { + private readonly IPartRepository _partRepository; + + public PartAppService(IPartRepository repository) : base(repository) + { + _partRepository = repository; + } + + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + /// + /// 新增实体 (Create New entity) + /// + /// + [HttpPost] + [Route("")] + public override Task CreateAsync(PartCreateDTO input) + { + return base.CreateAsync(input); + } + + /// + /// 修改实体 (Modify entity) + /// + /// + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, PartUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs new file mode 100644 index 0000000..ce73e65 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Receipts/ReceiptAppService.cs @@ -0,0 +1,89 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi.Receipts +{ + /// + ///零件服务 + /// + [AllowAnonymous] + [Route("api/SCP/Receipt")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + public class ReceiptAppService : CrudAppService, IReceiptAppService + { + private readonly IReceiptRepository _partRepository; + + public ReceiptAppService(IReceiptRepository repository) : base(repository) + { + _partRepository = repository; + } + + + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + + /// + /// 新增实体 (Create New entity) + /// + /// + [HttpPost] + [Route("")] + public override Task CreateAsync(ReceiptCreateDTO input) + { + return base.CreateAsync(input); + } + + /// + /// 修改实体 (Modify entity) + /// + /// + + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, ReceiptUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Samples/SampleAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Samples/SampleAppService.cs new file mode 100644 index 0000000..bd09f69 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Samples/SampleAppService.cs @@ -0,0 +1,29 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; + +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + public class SampleAppService : WebApiAppService, ISampleAppService + { + public Task GetAsync() + { + return Task.FromResult( + new SampleDto + { + Value = 42 + } + ); + } + + [Authorize] + public Task GetAuthorizedAsync() + { + return Task.FromResult( + new SampleDto + { + Value = 42 + } + ); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/SupplierParts/SupplierPartAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/SupplierParts/SupplierPartAppService.cs new file mode 100644 index 0000000..a3d5463 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/SupplierParts/SupplierPartAppService.cs @@ -0,0 +1,89 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win_in.Sfs.Scp.WebApi.Application.Contracts.SupplierParts; + +namespace Win_in.Sfs.Scp.WebApi.SupplierParts +{ + /// + ///零件服务 + /// + [AllowAnonymous] + [Route("api/SCP/SupplierPart")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + public class SupplierPartAppService : CrudAppService, ISupplierPartAppService + { + private readonly ISupplierPartRepository _partRepository; + + public SupplierPartAppService(ISupplierPartRepository repository) : base(repository) + { + _partRepository = repository; + } + + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + + /// + /// 新增实体 (Create New entity) + /// + /// + [HttpPost] + [Route("")] + public override Task CreateAsync(SupplierPartCreateDTO input) + { + return base.CreateAsync(input); + } + + /// + /// 修改实体 (Modify entity) + /// + /// + + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, SupplierPartUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs new file mode 100644 index 0000000..0ce1fe2 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Suppliers/SuppliersAppService.cs @@ -0,0 +1,90 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Win_in.Sfs.Scp.WebApi.Suppliers; + +namespace Win_in.Sfs.Scp.WebApi.Supplierss +{ + /// + ///零件服务 + /// + [AllowAnonymous] + [Route("api/SCP/Supplier")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + public class SuppliersAppService : CrudAppService, ISupplierAppService + { + private readonly ISupplierRepository _partRepository; + + public SuppliersAppService(ISupplierRepository repository) : base(repository) + { + _partRepository = repository; + } + + + /// + ///获取一条数据 (Get a piece of data) + /// + /// + /// + [HttpGet] + [Route("{id}")] + public override Task GetAsync(Guid id) + { + return base.GetAsync(id); + } + + + /// + ///获取数据列表 (Get data list) + /// + /// + /// + [HttpGet] + [Route("")] + public override Task> GetListAsync(InputDTO input) + { + return base.GetListAsync(input); + } + + + /// + /// 新增实体 (Create New entity) + /// + /// + [HttpPost] + [Route("")] + public override Task CreateAsync(SupplierCreateDTO input) + { + return base.CreateAsync(input); + } + + /// + /// 修改实体 (Modify entity) + /// + /// + + [HttpPut] + [Route("{id}")] + public override Task UpdateAsync(Guid id, SupplierUpdateDTO input) + { + return base.UpdateAsync(id, input); + } + + /// + /// 删除实体 (Delete entity) + /// + /// ID + /// + [HttpDelete] + [Route("{id}")] + public override Task DeleteAsync(Guid id) + { + return base.DeleteAsync(id); + } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs new file mode 100644 index 0000000..56fdd1a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiAppService.cs @@ -0,0 +1,14 @@ +using Win_in.Sfs.Scp.WebApi.Localization; +using Volo.Abp.Application.Services; + +namespace Win_in.Sfs.Scp.WebApi +{ + public abstract class WebApiAppService : ApplicationService + { + protected WebApiAppService() + { + LocalizationResource = typeof(WebApiResource); + ObjectMapperContext = typeof(WebApiApplicationModule); + } + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs new file mode 100644 index 0000000..cc8d3ed --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationAutoMapperProfile.cs @@ -0,0 +1,90 @@ +using AutoMapper; +using Win_in.Sfs.Scp.WebApi.ASNs; +using Win_in.Sfs.Scp.WebApi.Parts; +using Win_in.Sfs.Scp.WebApi.POs; +using Win_in.Sfs.Scp.WebApi.Receipts; +using Win_in.Sfs.Scp.WebApi.SupplierParts; +using Win_in.Sfs.Scp.WebApi.Suppliers; + +namespace Win_in.Sfs.Scp.WebApi +{ + public class WebApiApplicationAutoMapperProfile : Profile + { + public WebApiApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + + CreateMapPart(); + CreateMapSupplier(); + CreateMapSupplierPart(); + CreateMapReceipt(); + } + + /// + /// 零件实体与Dto相互映射 + /// + private void CreateMapPart() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 供应商实体与Dto相互映射 + /// + private void CreateMapSupplier() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 供应商零件实体与Dto相互映射 + /// + private void CreateMapSupplierPart() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 收货单与退货单明细实体与Dto相互映射 + /// + private void CreateMapReceipt() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + + /// + /// 采购订单主表映射 + /// + private void CreateMapPO() + + { + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + CreateMap().ReverseMap(); + } + + /// + /// 采购订单明细表映射 + /// + private void CreateMapPODetial() + + { + CreateMap().ReverseMap(); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationModule.cs new file mode 100644 index 0000000..571b494 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/WebApiApplicationModule.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(WebApiDomainModule), + typeof(WebApiApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] + public class WebApiApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj new file mode 100644 index 0000000..06b4093 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.csproj @@ -0,0 +1,27 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.WebApi + + + + ..\..\host\Win_in.Sfs.Scp.WebApi.HttpApi.Host\bin\Debug\net5.0\Win_in.Sfs.Scp.WebApi.Application.xml + + + + + + + + + + + + + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.xml new file mode 100644 index 0000000..42a3163 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Application/Win_in.Sfs.Scp.WebApi.Application.xml @@ -0,0 +1,235 @@ + + + + Win_in.Sfs.Scp.WebApi.Application + + + + + 新增实体 (Create New entity) + + + + + + + 零件服务 + + + + + 获取一条数据 (Get a piece of data) + + + + + + + 获取数据列表 (Get data list) + + + + + + + 新增实体 (Create New entity) + + + + + + 修改实体 (Modify entity) + + + + + + 删除实体 (Delete entity) + + ID + + + + + 采购订单服务 + + + + + 获取一条数据 (Get a piece of data) + + + + + + + 获取数据列表 (Get data list) + + + + + + + 新增实体 (Create New entity) + + + + + + 修改实体 (Modify entity) + + + + + + 删除实体 (Delete entity) + + ID + + + + + 零件服务 + + + + + 获取一条数据 (Get a piece of data) + + + + + + + 获取数据列表 (Get data list) + + + + + + + 新增实体 (Create New entity) + + + + + + 修改实体 (Modify entity) + + + + + + 删除实体 (Delete entity) + + ID + + + + + 零件服务 + + + + + 获取一条数据 (Get a piece of data) + + + + + + + 获取数据列表 (Get data list) + + + + + + + 新增实体 (Create New entity) + + + + + + 修改实体 (Modify entity) + + + + + + 删除实体 (Delete entity) + + ID + + + + + 零件服务 + + + + + 获取一条数据 (Get a piece of data) + + + + + + + 获取数据列表 (Get data list) + + + + + + + 新增实体 (Create New entity) + + + + + + 修改实体 (Modify entity) + + + + + + 删除实体 (Delete entity) + + ID + + + + + 零件实体与Dto相互映射 + + + + + 供应商实体与Dto相互映射 + + + + + 供应商零件实体与Dto相互映射 + + + + + 收货单与退货单明细实体与Dto相互映射 + + + + + 采购订单主表映射 + + + + + 采购订单明细表映射 + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs new file mode 100644 index 0000000..a8d647a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityBase.cs @@ -0,0 +1,22 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Win_in.Sfs.Scp.WebApi.Domain.Shared +{ + public class EntityBase : AuditedAggregateRoot + { + /// + /// 序列(SequenceNumber) + /// + [Display(Name = "序列(SequenceNumber)")] + public string SequenceNumber { set; get; } + + /// + /// 版本(Name) + /// + [Display(Name = "版本(Version)")] + public string Version { set; get; } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs new file mode 100644 index 0000000..243afcd --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailBase.cs @@ -0,0 +1,22 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Win_in.Sfs.Scp.WebApi.Domain.Shared +{ + public class EntityDetailBase : AuditedAggregateRoot + { + + /// + /// 版本(Name) + /// + [Display(Name = "版本(Version)")] + public string Version { set; get; } + + public EntityDetailBase() { } + public EntityDetailBase(TKey id) : base(id) { } + + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs new file mode 100644 index 0000000..4e9acbb --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDetailDtoBase.cs @@ -0,0 +1,18 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Win_in.Sfs.Scp.WebApi.Domain.Shared +{ + public class EntityDetailDtoBase : AuditedEntityDto + { + + /// + /// 版本(Name) + /// + [Display(Name = "版本(Version)")] + public string Version { set; get; } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs new file mode 100644 index 0000000..38731eb --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/EntityBase/EntityDtoBase.cs @@ -0,0 +1,23 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Win_in.Sfs.Scp.WebApi.Domain.Shared +{ + public class EntityDtoBase : AuditedEntityDto + { + /// + /// 序列(SequenceNumber) + /// + [Display(Name = "序列(SequenceNumber)")] + public string SequenceNumber { set; get; } + + /// + /// 版本(Name) + /// + [Display(Name = "版本(Version)")] + public string Version { set; get; } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xsd b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json new file mode 100644 index 0000000..6b75803 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/ar.json @@ -0,0 +1,7 @@ +{ + "culture": "ar", + "texts": { + "MyAccount": "إدارة ملفى", + "SamplePageMessage": "صفحة نموذجية للوحدة النمطية WebApi" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json new file mode 100644 index 0000000..30361d7 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/cs.json @@ -0,0 +1,7 @@ +{ + "culture": "cs", + "texts": { + "MyAccount": "Spravovat profil", + "SamplePageMessage": "Ukázková stránka pro modul WebApi" + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json new file mode 100644 index 0000000..ac2a364 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/de-DE.json @@ -0,0 +1,7 @@ +{ + "culture": "de-DE", + "texts": { + "MyAccount": "Mein Konto", + "SamplePageMessage": "Eine Beispielseite für das Modul WebApiModul" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json new file mode 100644 index 0000000..82bb2e9 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en-GB.json @@ -0,0 +1,7 @@ +{ + "culture": "en-GB", + "texts": { + "MyAccount": "My account", + "SamplePageMessage": "A sample page for the WebApi module" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en.json new file mode 100644 index 0000000..1c448f1 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/en.json @@ -0,0 +1,7 @@ +{ + "culture": "en", + "texts": { + "MyAccount": "My account", + "SamplePageMessage": "A sample page for the WebApi module" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json new file mode 100644 index 0000000..3d8e3ad --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/es.json @@ -0,0 +1,7 @@ +{ + "culture": "es", + "texts": { + "MyAccount": "Mi cuenta", + "SamplePageMessage": "Una página de ejemplo para el módulo WebApi " + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json new file mode 100644 index 0000000..096a28f --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fi.json @@ -0,0 +1,7 @@ +{ + "culture": "fi", + "texts": { + "MyAccount": "Tilini", + "SamplePageMessage": "Esimerkkisivu WebApi-moduulille" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json new file mode 100644 index 0000000..8bba6f6 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/fr.json @@ -0,0 +1,7 @@ +{ + "culture": "fr", + "texts": { + "MyAccount": "Mon compte", + "SamplePageMessage": "Exemple de page pour le module WebApi" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json new file mode 100644 index 0000000..936ea28 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hi.json @@ -0,0 +1,7 @@ +{ + "culture": "hi", + "texts": { + "MyAccount": "मेरा खाता", + "SamplePageMessage": "WebApi मॉड्यूल के लिए एक नमूना पृष्ठ" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json new file mode 100644 index 0000000..9d918d7 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/hu.json @@ -0,0 +1,7 @@ +{ + "culture": "hu", + "texts": { + "MyAccount": "A fiókom", + "SamplePageMessage": "Mintaoldal a WebApi modulhoz" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json new file mode 100644 index 0000000..f067b52 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/it.json @@ -0,0 +1,7 @@ +{ + "culture": "it", + "texts": { + "MyAccount": "Il mio conto", + "SamplePageMessage": "Una pagina di esempio per il modulo WebApi" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json new file mode 100644 index 0000000..cfb281c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/nl.json @@ -0,0 +1,7 @@ +{ + "culture": "nl", + "texts": { + "MyAccount": "Mijn rekening", + "SamplePageMessage": "Een voorbeeldpagina voor de WebApi module" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json new file mode 100644 index 0000000..3ea7b19 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pl-PL.json @@ -0,0 +1,6 @@ +{ + "culture": "pl-PL", + "texts": { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json new file mode 100644 index 0000000..6d746df --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/pt-BR.json @@ -0,0 +1,6 @@ +{ + "culture": "pt-BR", + "texts": { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json new file mode 100644 index 0000000..c185f4c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sk.json @@ -0,0 +1,6 @@ +{ + "culture": "sk", + "texts": { + "SamplePageMessage": "Ukážka stránky pre modul WebApi" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json new file mode 100644 index 0000000..229c449 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/sl.json @@ -0,0 +1,6 @@ +{ + "culture": "sl", + "texts": { + "MyAccount": "Moj račun" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json new file mode 100644 index 0000000..267efce --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/tr.json @@ -0,0 +1,7 @@ +{ + "culture": "tr", + "texts": { + "MyAccount": "Hesabım", + "SamplePageMessage": "WebApi modulünden örnek bir sayfa" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json new file mode 100644 index 0000000..d8eb5f3 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/vi.json @@ -0,0 +1,6 @@ +{ + "culture": "vi", + "texts": { + + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hans.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hans.json new file mode 100644 index 0000000..80aa1e6 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hans.json @@ -0,0 +1,7 @@ +{ + "culture": "zh-Hans", + "texts": { + "MyAccount": "我的账户", + "SamplePageMessage": "WebApi模块的示例页面" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json new file mode 100644 index 0000000..699d31e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApi/zh-Hant.json @@ -0,0 +1,6 @@ +{ + "culture": "zh-Hant", + "texts": { + "MyAccount": "我的賬戶" + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApiResource.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApiResource.cs new file mode 100644 index 0000000..23a7963 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Localization/WebApiResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace Win_in.Sfs.Scp.WebApi.Localization +{ + [LocalizationResourceName("WebApi")] + public class WebApiResource + { + + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiDomainSharedModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiDomainSharedModule.cs new file mode 100644 index 0000000..e60c71d --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiDomainSharedModule.cs @@ -0,0 +1,37 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using Win_in.Sfs.Scp.WebApi.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(AbpValidationModule) + )] + public class WebApiDomainSharedModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/WebApi"); + }); + + Configure(options => + { + options.MapCodeNamespace("WebApi", typeof(WebApiResource)); + }); + } + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiErrorCodes.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiErrorCodes.cs new file mode 100644 index 0000000..4899294 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/WebApiErrorCodes.cs @@ -0,0 +1,7 @@ +namespace Win_in.Sfs.Scp.WebApi +{ + public static class WebApiErrorCodes + { + //Add your business exception error codes here... + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj new file mode 100644 index 0000000..d19da84 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain.Shared/Win_in.Sfs.Scp.WebApi.Domain.Shared.csproj @@ -0,0 +1,26 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.WebApi + true + + + + + + + + + + + + + + + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs new file mode 100644 index 0000000..bc43095 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/ASN.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; + +namespace Win_in.Sfs.Scp.WebApi +{ + public class ASN:AuditedAggregateRoot + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNRepository.cs new file mode 100644 index 0000000..e319e85 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/ASNs/IASNRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface IASNRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xsd b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs new file mode 100644 index 0000000..1266ba6 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/IPORepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface IPORepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs new file mode 100644 index 0000000..d3bc4b6 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PO.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Volo.Abp; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.Guids; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 采购订单主表 + /// + public class PO: EntityBase + { + /// + /// 订单号(PoNumber) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(SupplierCode) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 订单类型(PoType) + /// + [Display(Name = "订单类型(PoType)")] + public string PoType { set; get; } + + /// + /// 订单状态(Status) + /// + [Display(Name = "订单状态(Status)")] + public int Status { set; get; } + + /// + /// 是否寄存订单(IsConsignment) + /// + [Display(Name = "是否寄存订单(IsConsignment)")] + public bool IsConsignment { set; get; } + + /// + /// 订单日期(OrderDate) + /// + [Display(Name = "订单日期(OrderDate)")] + public DateTime OrderDate { set; get; } + + /// + /// 截止日期(DueDate) + /// + [Display(Name = "截止日期(DueDate)")] + public DateTime DueDate { set; get; } + + /// + /// 版本(Version) + /// + [Display(Name = "版本(Version)")] + public string Version { set; get; } + + /// + /// 税率(TaxRate) + /// + [Display(Name = "税率(TaxRate)")] + public decimal TaxRate { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 联系人(ContactName) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 联系电话(ContactPhone) + /// + [Display(Name = "联系电话(ContactPhone)")] + public string ContactPhone { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + + public virtual List PODetails { get; set; } + + + + #region details handler + public virtual void AddDetail(IGuidGenerator guidGenerator, PODetail detail) + { + Check.NotNull(guidGenerator, nameof(guidGenerator)); + Check.NotNull(detail, nameof(PODetail)); + if (IsInDetails(detail.PoNumber,detail.PoLine)) + { + throw new Exception(detail.PoNumber+ detail.PoLine + "已经在明细中存在!"); + } + + PODetails.Add(new PODetail(guidGenerator.Create(),detail.PoNumber, detail.PoLine, detail.PartCode, detail.Uom, detail.OrderQty, detail.StdPackUom,detail.StdPackQty, + detail.SupplierPackUom, detail.SupplierPackQty, detail.SupplierPackConvertRate, detail.IsConsignment, detail.LineStatus, detail.Remark)); + } + + public virtual void AddDetails(IGuidGenerator guidGenerator, IEnumerable details) + { + Check.NotNull(guidGenerator, nameof(guidGenerator)); + foreach (var detail in details) + { + AddDetail(guidGenerator, detail); + } + } + + + + public virtual bool IsInDetails(string ponumber , string poline) + { + return PODetails.Any(di => di.PoNumber == ponumber && di.PoLine == poline); + } + + public virtual bool IsInDetails(Guid itemId) + { + return PODetails.Any(di => di.Id == itemId); + } + + public virtual bool UpdateDetail(IGuidGenerator guidGenerator, PODetail detail) + { + Check.NotNull(detail, nameof(PODetail)); + + var item = FindDetail(detail.Id); + + if (item == null) + { + AddDetail(guidGenerator, detail); + } + else + { + Check.NotNull(item, nameof(PODetail)); + + //item.Set(detail.Remark, detail.Enabled); + + } + return true; + } + + public virtual PODetail FindDetail(Guid itemId) + { + var item = PODetails.FirstOrDefault(p => p.Id == itemId); + return item; + } + + #endregion + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs new file mode 100644 index 0000000..4a49739 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/POs/PODetail.cs @@ -0,0 +1,113 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 采购订单明细 + /// + public class PODetail: EntityDetailBase + { + /// + /// 订单号(PoNumber) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 订单行(PoLine) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 订单数量(OrderQty) + /// + [Display(Name = "订单数量(OrderQty)")] + public decimal? OrderQty { set; get; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal? StdPackQty { set; get; } + + /// + /// 供应商计量单位(SupplierPackUom) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(SupplierPackQty) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal? SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(SupplierPackConvertRate) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal? SupplierPackConvertRate { set; get; } + + /// + /// 是否寄存订单(IsConsignment) + /// + [Display(Name = "是否寄存订单(IsConsignment)")] + public bool IsConsignment { set; get; } + + /// + /// 订单行状态(LineStatus) + /// + [Display(Name = "订单行状态(LineStatus)")] + public int LineStatus { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + + + public PODetail() { } + + public PODetail( + Guid id , string poNumber, string poLine,string partCode, string uom, decimal? orderQty, string stdPackUom, decimal? stdPackQty, + string supplierPackUom, decimal? supplierPackQty, decimal? supplierPackConvertRate, bool isConsignment,int lineStatus,string remark) :base(id) + { + PoNumber = poNumber; + PoLine = poLine; + PartCode = partCode; + Uom = uom; + OrderQty = orderQty; + StdPackUom = stdPackUom; + StdPackQty = stdPackQty; + SupplierPackUom = supplierPackUom; + SupplierPackQty = supplierPackQty; + SupplierPackConvertRate = supplierPackConvertRate; + IsConsignment = isConsignment; + LineStatus = lineStatus; + Remark = remark; + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/IPartRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/IPartRepository.cs new file mode 100644 index 0000000..65f485e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/IPartRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface IPartRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs new file mode 100644 index 0000000..bfbb7a1 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Parts/Part.cs @@ -0,0 +1,157 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 零件表实体 + /// + public class Part:EntityBase + { + /// + /// 代码(Code) + /// + [Display(Name = "代码")] + public string Code {get;set;} + + /// + /// 名称(Name) + /// + [Display(Name = "名称")] + public string Name {get;set;} + + /// + /// 描述(Desc1) + /// + [Display(Name = "描述")] + public string Desc1 {get;set;} + + /// + /// 描述2(Desc2) + /// + [Display(Name = "描述2")] + public string Desc2 {get;set;} + + /// + /// 状态(Status) + /// + [Display(Name = "状态")] + public string Status {get;set;} + + /// + /// 制造件(IsMakePart) + /// + [Display(Name = "制造件")] + public bool IsMakePart {get;set;} + + /// + /// 采购件(IsBuyPart) + /// + [Display(Name = "采购件")] + public bool IsBuyPart {get;set;} + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位")] + public string Uom {get;set;} + + /// + /// ABC类(abcClass) + /// + [Display(Name = "ABC类")] + public string abcClass {get;set;} + + /// + /// 产品类(productline) + /// + [Display(Name = "产品类")] + public string productline {get;set;} + + /// + /// 类型(Type) + /// + [Display(Name = "类型")] + public string Type {get;set;} + + /// + /// 种类(catalog) + /// + [Display(Name = "代码")] + public string catalog {get;set;} + + /// + /// 分组(Group) + /// + [Display(Name = "分组")] + public string Group {get;set;} + + /// + /// 颜色(Color) + /// + [Display(Name = "颜色")] + public string Color {get;set;} + + /// + /// 配置(Configuration) + /// + [Display(Name = "配置")] + public string Configuration {get;set;} + + /// + /// 项目(Project) + /// + [Display(Name = "项目")] + public string Project {get;set;} + + /// + /// 版本(version) + /// + //[Display(Name = "版本")] + //public string version {get;set;} + + /// + /// 工程变革(Eco) + /// + [Display(Name = "工程变革")] + public string Eco {get;set;} + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位")] + public string StdPackUom {get;set;} + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量")] + public decimal StdPackQty {get;set;} + + /// + /// 替代计量单位(ExtPackUom) + /// + [Display(Name = "替代计量单位")] + public string ExtPackUom {get;set;} + + /// + /// 替代包装数量(ExtPackQty) + /// + [Display(Name = "替代包装数量")] + public decimal ExtPackQty {get;set;} + + /// + /// 地点(Site) + /// + [Display(Name = "地点")] + public string Site {get;set;} + + /// + /// 公司(Company) + /// + [Display(Name = "公司")] + public string Company {get;set;} + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/IReceiptRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/IReceiptRepository.cs new file mode 100644 index 0000000..c7f145f --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/IReceiptRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface IReceiptRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/Receipt.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/Receipt.cs new file mode 100644 index 0000000..73527ee --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Receipts/Receipt.cs @@ -0,0 +1,175 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 收货单与退货单明细(Receipt) + /// + public class Receipt: EntityBase + { + /// + /// 发货单号(RcNumber) + /// + [Display(Name = "发货单号(RcNumber)")] + public string RcNumber { set; get; } + + /// + /// 发货单号(AsnNumber) + /// + [Display(Name = "发货单号(AsnNumber)")] + public string AsnNumber { set; get; } + + /// + /// 要货计划单号(RpNumber) + /// + [Display(Name = "要货计划单号(RpNumber)")] + public string RpNumber { set; get; } + + /// + /// 订单号(PoNumber) + /// + [Display(Name = "订单号(PoNumber)")] + public string PoNumber { set; get; } + + /// + /// 供应商代码(PoNumber) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 收货单类型(RcType) + /// + [Display(Name = "收货单类型(RcType)")] + public string RcType { set; get; } + + /// + /// 仓库(Warehouse) + /// + [Display(Name = "仓库(Warehouse)")] + public string Warehouse { set; get; } + + /// + /// 收货口(WarehouseDoor) + /// + [Display(Name = "收货口(WarehouseDoor)")] + public string WarehouseDoor { set; get; } + + /// + /// 时间窗口开始(TimeWindowBegin) + /// + [Display(Name = "时间窗口开始(TimeWindowBegin)")] + public DateTime TimeWindowBegin { set; get; } + + /// + /// 时间窗口结束(TimeWIndowEnd) + /// + [Display(Name = "时间窗口结束(TimeWIndowEnd)")] + public DateTime TimeWIndowEnd { set; get; } + + /// + /// 收货时间(ReceiveTime) + /// + [Display(Name = "收货时间(ReceiveTime)")] + public DateTime ReceiveTime { set; get; } + + /// + /// 地点(Site) + /// + [Display(Name = "地点(Site)")] + public string Site { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 订单行(PoLine) + /// + [Display(Name = "订单行(PoLine)")] + public string PoLine { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 批次(Batch) + /// + [Display(Name = "批次(Batch)")] + public string Batch { set; get; } + + /// + /// 供应商批次(SupplierBatch) + /// + [Display(Name = "供应商批次(SupplierBatch)")] + public string SupplierBatch { set; get; } + + /// + /// 生产日期(ProduceDate) + /// + [Display(Name = "生产日期(ProduceDate)")] + public DateTime ProduceDate { set; get; } + + /// + /// 计量单位(Uom) + /// + [Display(Name = "计量单位(Uom)")] + public string Uom { set; get; } + + /// + /// 发货数量(DeliverQty) + /// + [Display(Name = "发货数量(DeliverQty)")] + public decimal DeliverQty { set; get; } + + /// + /// 收货数量(ReceiveQty) + /// + [Display(Name = "收货数量(ReceiveQty)")] + public decimal ReceiveQty { set; get; } + + /// + /// 标包计量单位(StdPackUom) + /// + [Display(Name = "标包计量单位(StdPackUom)")] + public string StdPackUom { set; get; } + + /// + /// 标包数量(StdPackQty) + /// + [Display(Name = "标包数量(StdPackQty)")] + public decimal StdPackQty { set; get; } + + /// + /// 供应商计量单位(SupplierPackUom) + /// + [Display(Name = "供应商计量单位(SupplierPackUom)")] + public string SupplierPackUom { set; get; } + + /// + /// 供应商包装数量(SupplierPackQty) + /// + [Display(Name = "供应商包装数量(SupplierPackQty)")] + public decimal SupplierPackQty { set; get; } + + /// + /// 供应商包装转换率(SupplierPackConvertRate) + /// + [Display(Name = "供应商包装转换率(SupplierPackConvertRate)")] + public decimal SupplierPackConvertRate { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettingDefinitionProvider.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettingDefinitionProvider.cs new file mode 100644 index 0000000..4a3586c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettingDefinitionProvider.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Settings; + +namespace Win_in.Sfs.Scp.WebApi.Settings +{ + public class WebApiSettingDefinitionProvider : SettingDefinitionProvider + { + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from WebApiSettings class. + */ + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs new file mode 100644 index 0000000..0480c0c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Settings/WebApiSettings.cs @@ -0,0 +1,11 @@ +namespace Win_in.Sfs.Scp.WebApi.Settings +{ + public static class WebApiSettings + { + public const string GroupName = "WebApi"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/ISupplierRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/ISupplierRepository.cs new file mode 100644 index 0000000..7793994 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/ISupplierRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface ISupplierRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/SupplierPart.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/SupplierPart.cs new file mode 100644 index 0000000..8441f63 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/SupplierParts/SupplierPart.cs @@ -0,0 +1,49 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 供应商零件表 + /// + public class SupplierPart: EntityBase + { + /// + /// 供应商代码(SupplierCode) + /// + [Display(Name = "供应商代码(SupplierCode)")] + public string SupplierCode { set; get; } + + /// + /// 零件号(PartCode) + /// + [Display(Name = "零件号(PartCode)")] + public string PartCode { set; get; } + + /// + /// 供应商零件号(SupplierPartCode) + /// + [Display(Name = "供应商零件号(SupplierPartCode)")] + public string SupplierPartCode { set; get; } + + /// + /// 供应商标包计量单位(SupplierStdPackUom) + /// + [Display(Name = "供应商标包计量单位(SupplierStdPackUom)")] + public string SupplierStdPackUom { get; set; } + + /// + /// 供应商标包数量 + /// + [Display(Name = "供应商标包数量(SupplierStdPackQty)")] + public decimal SupplierStdPackQty { get; set; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs new file mode 100644 index 0000000..d0312b7 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/ISupplierPartRepository.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace Win_in.Sfs.Scp.WebApi +{ + public interface ISupplierPartRepository : IRepository + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/Supplier.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/Supplier.cs new file mode 100644 index 0000000..9c0f955 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Suppliers/Supplier.cs @@ -0,0 +1,103 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Domain.Entities.Auditing; +using Win_in.Sfs.Scp.WebApi.Domain.Shared; + +namespace Win_in.Sfs.Scp.WebApi +{ + /// + /// 供应商表 + /// + public class Supplier : EntityBase + { + /// + /// 代码(Code) + /// + [Display(Name = "代码(Code)")] + public string Code { set; get; } + + /// + /// 简称(Name) + /// + [Display(Name = "简称(Name)")] + public string Name { set; get; } + + /// + /// 描述(Description) + /// + [Display(Name = "描述(Description)")] + public string Desc { set; get; } + + /// + /// 级别(Rank) + /// + [Display(Name = "级别(Rank)")] + public string Rank { get; set; } + + /// + /// 地址 + /// + [Display(Name = "地址(Address)")] + public string Address { get; set; } + + /// + /// 国家(Country) + /// + [Display(Name = "国家(Country)")] + public string Country { get; set; } + + /// + /// 城市(City) + /// + [Display(Name = "城市(City)")] + public string City { get; set; } + + /// + /// 电话(Phone) + /// + [Display(Name = "电话(Phone)")] + public string Phone { set; get; } + + /// + /// 传真(Fax) + /// + [Display(Name = "传真(Fax)")] + public string Fax { set; get; } + + /// + /// 邮编(PostId) + /// + [Display(Name = "邮编(PostId)")] + public string PostId { set; get; } + + /// + /// 联系人(ContactName) + /// + [Display(Name = "联系人(ContactName)")] + public string ContactName { set; get; } + + /// + /// 货币(Currency) + /// + [Display(Name = "货币(Currency)")] + public string Currency { set; get; } + + /// + /// 是否激活(IsActive) + /// + [Display(Name = "是否激活(IsActive)")] + public bool IsActive { set; get; } + + /// + /// 公司(Company) + /// + [Display(Name = "公司(Company)")] + public string Company { set; get; } + + /// + /// 备注(Remark) + /// + [Display(Name = "备注(Remark)")] + public string Remark { set; get; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDbProperties.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDbProperties.cs new file mode 100644 index 0000000..444eece --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDbProperties.cs @@ -0,0 +1,11 @@ +namespace Win_in.Sfs.Scp.WebApi +{ + public static class WebApiDbProperties + { + public static string DbTablePrefix { get; set; } = "WebApi"; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "WebApi"; + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDomainModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDomainModule.cs new file mode 100644 index 0000000..a333ae5 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/WebApiDomainModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(AbpDddDomainModule), + typeof(WebApiDomainSharedModule) + )] + public class WebApiDomainModule : AbpModule + { + + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj new file mode 100644 index 0000000..9fa82a8 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.Domain/Win_in.Sfs.Scp.WebApi.Domain.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + Win_in.Sfs.Scp.WebApi + + + + + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs new file mode 100644 index 0000000..6c030f1 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/IWebApiDbContext.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + [ConnectionStringName(WebApiDbProperties.ConnectionStringName)] + public interface IWebApiDbContext : IEfCoreDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + + DbSet Parts { get; set; } + DbSet Suppliers { get; set; } + DbSet SupplierParts { get; set; } + DbSet POs { get; set; } + DbSet ASNs { get; set; } + DbSet Receipts { get; set; } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs new file mode 100644 index 0000000..0d39a53 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContext.cs @@ -0,0 +1,36 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + [ConnectionStringName(WebApiDbProperties.ConnectionStringName)] + public class WebApiDbContext : AbpDbContext, IWebApiDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + + public virtual DbSet Parts { get; set; } + public virtual DbSet Suppliers { get; set; } + public virtual DbSet SupplierParts { get; set; } + public virtual DbSet POs { get; set; } + public virtual DbSet ASNs { get; set; } + public virtual DbSet Receipts { get; set; } + + public WebApiDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureWebApi(); + } + + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs new file mode 100644 index 0000000..b24110c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiDbContextModelCreatingExtensions.cs @@ -0,0 +1,270 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + public static class WebApiDbContextModelCreatingExtensions + { + public const string IsDeletedFilter = "IsDeleted=0"; + public static void ConfigureWebApi( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new WebApiModelBuilderConfigurationOptions( + WebApiDbProperties.DbTablePrefix, + WebApiDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "Questions", options.Schema); + + b.ConfigureByConvention(); + + //Properties + b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Relations + b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Indexes + b.HasIndex(q => q.CreationTime); + }); + */ + + builder.ConfigurePart(options); + builder.ConfigSuppliers(options); + builder.ConfigSupplierPart(options); + builder.ConfigReceipt(options); + builder.ConfigPO(options); + builder.ConfigPODetail(options); + + } + + /// + /// 零件表 + /// + /// + /// + private static void ConfigurePart(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + + builder.Entity(b => + { + + b.ToTable($"{options.TablePrefix}_Part", options.Schema); + + b.ConfigureByConvention(); + b.Property(x => x.Code).IsRequired().HasMaxLength(64); + b.Property(x => x.Name).IsRequired().HasMaxLength(64); + b.Property(x => x.Desc1).HasMaxLength(1024); + b.Property(x => x.Desc2).HasMaxLength(1024); + b.Property(x => x.Status).IsRequired().HasMaxLength(64); + b.Property(x => x.IsMakePart).IsRequired(); + b.Property(x => x.IsBuyPart).IsRequired(); + b.Property(x => x.Uom).IsRequired().HasMaxLength(64); + b.Property(x => x.abcClass).IsRequired().HasMaxLength(64); + b.Property(x => x.productline).HasMaxLength(64); + b.Property(x => x.Type).HasMaxLength(64); + b.Property(x => x.catalog).HasMaxLength(64); + b.Property(x => x.Group).HasMaxLength(64); + b.Property(x => x.Color).HasMaxLength(64); + b.Property(x => x.Configuration).HasMaxLength(64); + b.Property(x => x.Project).HasMaxLength(64); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.SequenceNumber).HasMaxLength(64); + b.Property(x => x.Eco).HasMaxLength(64); + b.Property(x => x.StdPackUom).IsRequired().HasMaxLength(64); + b.Property(x => x.StdPackQty).IsRequired(); + b.Property(x => x.ExtPackUom).HasMaxLength(64); + b.Property(x => x.ExtPackQty); + b.Property(x => x.Site).IsRequired().HasMaxLength(64); + b.Property(x => x.Company).IsRequired().HasMaxLength(64); + + b.HasIndex(x => new { x.Code }).IsUnique(); + }); + } + + + /// + /// 供应商 + /// + private static void ConfigSuppliers(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_Suppliers", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.Code).IsRequired().HasMaxLength(64); + b.Property(q => q.Name).IsRequired().HasMaxLength(64); + b.Property(q => q.Desc).HasMaxLength(1024); + b.Property(q => q.Rank).HasMaxLength(64); + b.Property(q => q.Address).HasMaxLength(1024); + b.Property(q => q.Country).HasMaxLength(64); + b.Property(q => q.City).HasMaxLength(64); + b.Property(q => q.Phone).HasMaxLength(64); + b.Property(q => q.Fax).HasMaxLength(64); + b.Property(q => q.PostId).HasMaxLength(64); + b.Property(q => q.ContactName).HasMaxLength(64); + b.Property(q => q.Currency).HasMaxLength(64); + b.Property(q => q.IsActive).IsRequired(); + b.Property(q => q.Company).HasMaxLength(64); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.SequenceNumber).HasMaxLength(64); + + b.HasIndex(q => q.CreationTime); + }); + } + + /// + /// 供应商零件 + /// + private static void ConfigSupplierPart(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_SupplierPart", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierPartCode).HasMaxLength(1024); + b.Property(q => q.SupplierStdPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierStdPackQty).IsRequired(); + b.Property(q => q.Remark).HasMaxLength(64); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.SequenceNumber).HasMaxLength(64); + + b.HasIndex(x => new { x.SupplierCode,x.PartCode }).IsUnique(); + }); + } + + /// + /// 收货单与退货单明细 + /// + private static void ConfigReceipt(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_Receipt", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.RcNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.AsnNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.RpNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.RcType).IsRequired().HasMaxLength(64); + b.Property(q => q.Warehouse).IsRequired().HasMaxLength(64); + b.Property(q => q.WarehouseDoor).IsRequired().HasMaxLength(64); + b.Property(q => q.TimeWindowBegin).IsRequired(); + b.Property(q => q.TimeWIndowEnd).IsRequired(); + b.Property(q => q.ReceiveTime).IsRequired(); + b.Property(q => q.Site).IsRequired().HasMaxLength(64); + b.Property(q => q.Company).IsRequired().HasMaxLength(64); + b.Property(q => q.PoLine).IsRequired().HasMaxLength(64); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Batch).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierBatch).IsRequired().HasMaxLength(64); + b.Property(q => q.ProduceDate).IsRequired(); + b.Property(q => q.Uom).IsRequired().HasMaxLength(64); + b.Property(q => q.DeliverQty).IsRequired(); + b.Property(q => q.ReceiveQty).IsRequired(); + b.Property(q => q.StdPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.StdPackQty).IsRequired(); + b.Property(q => q.SupplierPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.SupplierPackQty).IsRequired(); + b.Property(q => q.SupplierPackConvertRate).IsRequired(); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.SequenceNumber).HasMaxLength(64); + + b.HasIndex(x => new { x.RcNumber,x.PoLine,x.PartCode }).IsUnique(); + }); + } + + /// + /// 采购订单主表 + /// + private static void ConfigPO(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_PO", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.PoNumber).HasMaxLength(64); + b.Property(q => q.SupplierCode).IsRequired().HasMaxLength(64); + b.Property(q => q.PoType).IsRequired().HasMaxLength(64); + b.Property(q => q.Status).IsRequired(); + b.Property(q => q.IsConsignment).IsRequired(); + b.Property(q => q.OrderDate).IsRequired(); + b.Property(q => q.DueDate).IsRequired(); + b.Property(q => q.Version).IsRequired().HasMaxLength(64); + b.Property(q => q.TaxRate).IsRequired(); + b.Property(q => q.Site).IsRequired().HasMaxLength(64); + b.Property(q => q.Company).IsRequired().HasMaxLength(64); + b.Property(q => q.ContactName).HasMaxLength(64); + b.Property(q => q.ContactPhone).HasMaxLength(64); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Version).HasMaxLength(64); + b.Property(x => x.SequenceNumber).HasMaxLength(64); + + b.HasMany(u => u.PODetails).WithOne().HasForeignKey(rd => rd.Id).OnDelete(DeleteBehavior.NoAction).IsRequired(); + + + b.HasIndex(x => new { x.PoNumber }).IsUnique(); + }); + } + + /// + /// 采购订单明细表 + /// + private static void ConfigPODetail(this ModelBuilder builder, WebApiModelBuilderConfigurationOptions options) + { + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "_PODetail", options.Schema); + + b.ConfigureByConvention(); + + b.Property(q => q.PoNumber).IsRequired().HasMaxLength(64); + b.Property(q => q.PoLine).IsRequired().HasMaxLength(64); + b.Property(q => q.PartCode).IsRequired().HasMaxLength(64); + b.Property(q => q.Uom).IsRequired().HasMaxLength(64); + b.Property(q => q.OrderQty).IsRequired(); + b.Property(q => q.StdPackUom).IsRequired().HasMaxLength(64); + b.Property(q => q.StdPackQty).IsRequired(); + b.Property(q => q.SupplierPackUom).HasMaxLength(64); + b.Property(q => q.SupplierPackQty); + b.Property(q => q.SupplierPackConvertRate); + b.Property(q => q.IsConsignment).IsRequired(); + b.Property(q => q.LineStatus).IsRequired(); + b.Property(q => q.Remark).HasMaxLength(4096); + b.Property(x => x.Version).HasMaxLength(64); + + b.HasIndex(x => new { x.PoNumber,x.PoLine }).IsUnique(); + }); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs new file mode 100644 index 0000000..1aa151c --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiEntityFrameworkCoreModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + [DependsOn( + typeof(WebApiDomainModule), + typeof(AbpEntityFrameworkCoreModule) + )] + public class WebApiEntityFrameworkCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiModelBuilderConfigurationOptions.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiModelBuilderConfigurationOptions.cs new file mode 100644 index 0000000..63bdcea --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/EntityFrameworkCore/WebApiModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + public class WebApiModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + { + public WebApiModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xsd b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj new file mode 100644 index 0000000..dabb4b8 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.1 + Win_in.Sfs.Scp.WebApi + + + + + + + + diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xml b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xsd b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Samples/SampleController.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Samples/SampleController.cs new file mode 100644 index 0000000..a0aafb6 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Samples/SampleController.cs @@ -0,0 +1,34 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; + +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + [RemoteService] + [Route("api/WebApi/sample")] + [ApiExplorerSettings(GroupName = SwaggerGroupConsts.ScpWebApi)] + public class SampleController : WebApiController, ISampleAppService + { + private readonly ISampleAppService _sampleAppService; + + public SampleController(ISampleAppService sampleAppService) + { + _sampleAppService = sampleAppService; + } + + [HttpGet] + public async Task GetAsync() + { + return await _sampleAppService.GetAsync(); + } + + [HttpGet] + [Route("authorized")] + [Authorize] + public async Task GetAuthorizedAsync() + { + return await _sampleAppService.GetAsync(); + } + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiController.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiController.cs new file mode 100644 index 0000000..063f8ab --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiController.cs @@ -0,0 +1,13 @@ +using Win_in.Sfs.Scp.WebApi.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace Win_in.Sfs.Scp.WebApi +{ + public abstract class WebApiController : AbpController + { + protected WebApiController() + { + LocalizationResource = typeof(WebApiResource); + } + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs new file mode 100644 index 0000000..e4399b9 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/WebApiHttpApiModule.cs @@ -0,0 +1,36 @@ +using Localization.Resources.AbpUi; +using Win_in.Sfs.Scp.WebApi.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + + typeof(WebApiApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class WebApiHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(WebApiHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + + + } + } +} diff --git a/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj new file mode 100644 index 0000000..88699f4 --- /dev/null +++ b/ScpWebApiService/src/Win_in.Sfs.Scp.WebApi.HttpApi/Win_in.Sfs.Scp.WebApi.HttpApi.csproj @@ -0,0 +1,19 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.WebApi + + + + + + + + + + + + diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xml b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xsd b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Samples/SampleAppService_Tests.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Samples/SampleAppService_Tests.cs new file mode 100644 index 0000000..f719358 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Samples/SampleAppService_Tests.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + public class SampleAppService_Tests : WebApiApplicationTestBase + { + private readonly ISampleAppService _sampleAppService; + + public SampleAppService_Tests() + { + _sampleAppService = GetRequiredService(); + } + + [Fact] + public async Task GetAsync() + { + var result = await _sampleAppService.GetAsync(); + result.Value.ShouldBe(42); + } + + [Fact] + public async Task GetAuthorizedAsync() + { + var result = await _sampleAppService.GetAuthorizedAsync(); + result.Value.ShouldBe(42); + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestBase.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestBase.cs new file mode 100644 index 0000000..a5f14fb --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestBase.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.WebApi +{ + /* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ + public abstract class WebApiApplicationTestBase : WebApiTestBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestModule.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestModule.cs new file mode 100644 index 0000000..988f938 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/WebApiApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(WebApiApplicationModule), + typeof(WebApiDomainTestModule) + )] + public class WebApiApplicationTestModule : AbpModule + { + + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Win_in.Sfs.Scp.WebApi.Application.Tests.csproj b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Win_in.Sfs.Scp.WebApi.Application.Tests.csproj new file mode 100644 index 0000000..67dc561 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Application.Tests/Win_in.Sfs.Scp.WebApi.Application.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.WebApi + + + + + + + + + diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xml b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xsd b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Samples/SampleManager_Tests.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Samples/SampleManager_Tests.cs new file mode 100644 index 0000000..9a911be --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Samples/SampleManager_Tests.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Xunit; + +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + public class SampleManager_Tests : WebApiDomainTestBase + { + //private readonly SampleManager _sampleManager; + + public SampleManager_Tests() + { + //_sampleManager = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestBase.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestBase.cs new file mode 100644 index 0000000..3145c52 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestBase.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.WebApi +{ + /* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ + public abstract class WebApiDomainTestBase : WebApiTestBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestModule.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestModule.cs new file mode 100644 index 0000000..6c9aff1 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/WebApiDomainTestModule.cs @@ -0,0 +1,17 @@ +using Win_in.Sfs.Scp.WebApi.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.WebApi +{ + /* Domain tests are configured to use the EF Core provider. + * You can switch to MongoDB, however your domain tests should be + * database independent anyway. + */ + [DependsOn( + typeof(WebApiEntityFrameworkCoreTestModule) + )] + public class WebApiDomainTestModule : AbpModule + { + + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Win_in.Sfs.Scp.WebApi.Domain.Tests.csproj b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Win_in.Sfs.Scp.WebApi.Domain.Tests.csproj new file mode 100644 index 0000000..60a9e5b --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.Domain.Tests/Win_in.Sfs.Scp.WebApi.Domain.Tests.csproj @@ -0,0 +1,15 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.WebApi + + + + + + + + diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs new file mode 100644 index 0000000..f6f2d7d --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs @@ -0,0 +1,12 @@ +using Win_in.Sfs.Scp.WebApi.Samples; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Samples +{ + public class SampleRepository_Tests : SampleRepository_Tests + { + /* Don't write custom repository tests here, instead write to + * the base class. + * One exception can be some specific tests related to EF core. + */ + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestBase.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestBase.cs new file mode 100644 index 0000000..d2c196a --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestBase.cs @@ -0,0 +1,10 @@ +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + /* This class can be used as a base class for EF Core integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class WebApiEntityFrameworkCoreTestBase : WebApiTestBase + { + + } +} \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestModule.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestModule.cs new file mode 100644 index 0000000..632ca31 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/EntityFrameworkCore/WebApiEntityFrameworkCoreTestModule.cs @@ -0,0 +1,43 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; + +namespace Win_in.Sfs.Scp.WebApi.EntityFrameworkCore +{ + [DependsOn( + typeof(WebApiTestBaseModule), + typeof(WebApiEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] + public class WebApiEntityFrameworkCoreTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new WebApiDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xml b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xsd b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests.csproj b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000..a5afa38 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests/Win_in.Sfs.Scp.WebApi.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.WebApi + + + + + + + + + + + diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xml b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xml new file mode 100644 index 0000000..be0de3a --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xsd b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xsd new file mode 100644 index 0000000..3f3946e --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Samples/SampleRepository_Tests.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Samples/SampleRepository_Tests.cs new file mode 100644 index 0000000..f1f20ac --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Samples/SampleRepository_Tests.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Volo.Abp.Modularity; +using Xunit; + +namespace Win_in.Sfs.Scp.WebApi.Samples +{ + /* Write your custom repository tests like that, in this project, as abstract classes. + * Then inherit these abstract classes from EF Core & MongoDB test projects. + * In this way, both database providers are tests with the same set tests. + */ + public abstract class SampleRepository_Tests : WebApiTestBase + where TStartupModule : IAbpModule + { + //private readonly ISampleRepository _sampleRepository; + + protected SampleRepository_Tests() + { + //_sampleRepository = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 0000000..a86d983 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace Win_in.Sfs.Scp.WebApi.Security +{ + [Dependency(ReplaceServices = true)] + public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor + { + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiDataSeedContributor.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiDataSeedContributor.cs new file mode 100644 index 0000000..ff8f6b8 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiDataSeedContributor.cs @@ -0,0 +1,33 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; + +namespace Win_in.Sfs.Scp.WebApi +{ + public class WebApiDataSeedContributor : IDataSeedContributor, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + + public WebApiDataSeedContributor( + IGuidGenerator guidGenerator, ICurrentTenant currentTenant) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + using (_currentTenant.Change(context?.TenantId)) + { + return Task.CompletedTask; + } + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBase.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBase.cs new file mode 100644 index 0000000..ab69e12 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace Win_in.Sfs.Scp.WebApi +{ + /* All test classes are derived from this class, directly or indirectly. */ + public abstract class WebApiTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBaseModule.cs b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBaseModule.cs new file mode 100644 index 0000000..d8544f4 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/WebApiTestBaseModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace Win_in.Sfs.Scp.WebApi +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(WebApiDomainModule) + )] + public class WebApiTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } + } +} diff --git a/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Win_in.Sfs.Scp.WebApi.TestBase.csproj b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Win_in.Sfs.Scp.WebApi.TestBase.csproj new file mode 100644 index 0000000..73ce114 --- /dev/null +++ b/ScpWebApiService/test/Win_in.Sfs.Scp.WebApi.TestBase/Win_in.Sfs.Scp.WebApi.TestBase.csproj @@ -0,0 +1,23 @@ + + + + + + net5.0 + Win_in.Sfs.Scp.WebApi + + + + + + + + + + + + + + + +