Browse Source

定时任务替换,按照三大平台拆分

Murphy 3 years ago
parent
commit
d7990e94fb
100 changed files with 3058 additions and 190 deletions
  1. 4 0
      .gitignore
  2. 20 0
      MicroServices/Business/Buissness.UnitTest/Buissness.UnitTest.csproj
  3. 56 0
      MicroServices/Business/Buissness.UnitTest/InitialData/UnitTestInitialDataBuilder.cs
  4. 31 0
      MicroServices/Business/Buissness.UnitTest/ResourceExamineManagement/ProductExamineAppServiceTest.cs
  5. 59 0
      MicroServices/Business/Buissness.UnitTest/UnitTestBase.cs
  6. 20 0
      MicroServices/Business/Buissness.UnitTest/UnitTestModule.cs
  7. 5 0
      MicroServices/Business/Business.Application.Contracts/Business.Application.Contracts.csproj
  8. 7 1
      MicroServices/Business/Business.Application/Business.Application.csproj
  9. 1 3
      MicroServices/Business/Business.Application/BusinessApplicationModule.cs
  10. 0 85
      MicroServices/Business/Business.Application/HangFire/CronType.cs
  11. 2 2
      MicroServices/Business/Business.Application/Quartz/IQuartzJobService.cs
  12. 3 3
      MicroServices/Business/Business.Application/Quartz/QuartzJobService.cs
  13. 34 0
      MicroServices/Business/Business.Application/Quartz/SyncMySQLDataJob.cs
  14. 0 1
      MicroServices/Business/Business.EntityFrameworkCore/Business.EntityFrameworkCore.csproj
  15. 1 9
      MicroServices/Business/Business.Host/Business.Host.csproj
  16. 28 55
      MicroServices/Business/Business.Host/BusinessHostModule.cs
  17. 0 2
      MicroServices/Business/Business.Host/Startup.cs
  18. 6 0
      MicroServices/Business/Business.HttpApi/Business.HttpApi.csproj
  19. 42 0
      MicroServices/Business/Business.HttpApi/Controllers/Kanban/KanbanController.cs
  20. 42 0
      MicroServices/Business/Business.HttpApi/Controllers/QMS/QMSController.cs
  21. 42 0
      MicroServices/Business/Business.HttpApi/Controllers/SIM/AndonController.cs
  22. 42 0
      MicroServices/Business/Business.HttpApi/Controllers/SIM/SIMController.cs
  23. 0 28
      MicroServices/Business/Business.HttpApi/Controllers/ThinkFlowController.cs
  24. 7 1
      MicroServices/Business/Business.sln
  25. 53 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturing.Application.Contracts.csproj
  26. 34 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingApplicationContractsModule.cs
  27. 22 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingManagement/Dto/FileInfoDto.cs
  28. 9 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingManagement/Dto/GetFileInputDto.cs
  29. 18 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingManagement/IDigitalManufacturingAppService.cs
  30. 13 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/cs.json
  31. 8 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/en.json
  32. 8 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/pl.json
  33. 8 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/pt-BR.json
  34. 8 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/tr.json
  35. 8 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/vi.json
  36. 13 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/zh-Hans.json
  37. 8 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/zh-Hant.json
  38. 9 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/StorageResource.cs
  39. 28 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Permissions/DigitalManufacturingPermissionDefinitionProvider.cs
  40. 17 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Permissions/DigitalManufacturingPermissions.cs
  41. 27 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturing.Application.csproj
  42. 14 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturingApplicationAutoMapperProfile.cs
  43. 21 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturingApplicationModule.cs
  44. 129 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturingManagement/DigitalManufacturingAppService.cs
  45. 30 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/DigitalManufacturing.Domain.csproj
  46. 15 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/DigitalManufacturingDomainModule.cs
  47. 19 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/Enums/Enums.cs
  48. 51 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/Models/FileInfo.cs
  49. 31 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/Models/FileManager.cs
  50. 21 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/DigitalManufacturing.EntityFrameworkCore.csproj
  51. 28 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/EntityFrameworkCore/DigitalManufacturingDbContext.cs
  52. 33 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/EntityFrameworkCore/DigitalManufacturingDbContextModelCreatingExtensions.cs
  53. 28 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/EntityFrameworkCore/DigitalManufacturingEntityFrameworkCoreModule.cs
  54. 130 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/DOP/DOPController.cs
  55. 13 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/HomeController.cs
  56. 81 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/Kanban/KanbanController.cs
  57. 81 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/MES/MESController.cs
  58. 132 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/QMS/QMSController.cs
  59. 130 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/SIM/AndonController.cs
  60. 130 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/SIM/SIMController.cs
  61. 130 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/WMS/WMSController.cs
  62. 36 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/DigitalManufacturing.Host.csproj
  63. 11 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/DigitalManufacturing.Host.csproj.user
  64. 210 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/DigitalManufacturingHostModule.cs
  65. 12 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Dockerfile
  66. 24 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/EntityFrameworkCore/DigitalManufacturingMigrationDbContext.cs
  67. 33 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/EntityFrameworkCore/DigitalManufacturingMigrationDbContextFactory.cs
  68. 59 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Program.cs
  69. 21 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Properties/PublishProfiles/FolderProfile.pubxml
  70. 11 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Properties/PublishProfiles/FolderProfile.pubxml.user
  71. 27 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Properties/launchSettings.json
  72. 20 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Startup.cs
  73. 9 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/appsettings.Development.json
  74. 14 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/appsettings.json
  75. BIN
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/wwwroot/Images/479921a2-f7db-41a0-9b07-e5c9ecda3bfa.png
  76. BIN
      MicroServices/DigitalManufacturing/DigitalManufacturing.Host/wwwroot/Images/78f6d650-dcc2-4f53-9251-4264ec9a20f2.png
  77. 49 0
      MicroServices/DigitalManufacturing/DigitalManufacturing.sln
  78. 13 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/cs.json
  79. 8 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/en.json
  80. 8 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/pl.json
  81. 8 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/pt-BR.json
  82. 8 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/tr.json
  83. 8 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/vi.json
  84. 13 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/zh-Hans.json
  85. 8 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/zh-Hant.json
  86. 9 0
      MicroServices/Procurement/Procurement.Application.Contracts/Localization/ProcurementResource.cs
  87. 28 0
      MicroServices/Procurement/Procurement.Application.Contracts/Permissions/ProcurementPermissionDefinitionProvider.cs
  88. 17 0
      MicroServices/Procurement/Procurement.Application.Contracts/Permissions/ProcurementPermissions.cs
  89. 49 0
      MicroServices/Procurement/Procurement.Application.Contracts/Procurement.Application.Contracts.csproj
  90. 34 0
      MicroServices/Procurement/Procurement.Application.Contracts/ProcurementApplicationContractsModule.cs
  91. 22 0
      MicroServices/Procurement/Procurement.Application.Contracts/ProcurementManagement/Dto/FileInfoDto.cs
  92. 9 0
      MicroServices/Procurement/Procurement.Application.Contracts/ProcurementManagement/Dto/GetFileInputDto.cs
  93. 18 0
      MicroServices/Procurement/Procurement.Application.Contracts/ProcurementManagement/IProcurementAppService.cs
  94. 23 0
      MicroServices/Procurement/Procurement.Application/Procurement.Application.csproj
  95. 14 0
      MicroServices/Procurement/Procurement.Application/ProcurementApplicationAutoMapperProfile.cs
  96. 21 0
      MicroServices/Procurement/Procurement.Application/ProcurementApplicationModule.cs
  97. 129 0
      MicroServices/Procurement/Procurement.Application/ProcurementManagement/ProcurementAppService.cs
  98. 19 0
      MicroServices/Procurement/Procurement.Domain/Enums/Enums.cs
  99. 15 0
      MicroServices/Procurement/Procurement.Domain/FileStorageDomainModule.cs
  100. 51 0
      MicroServices/Procurement/Procurement.Domain/Models/FileInfo.cs

+ 4 - 0
.gitignore

@@ -888,3 +888,7 @@ MicroServices/Business/Bussiness.MongoModel/obj/Business.Core.csproj.nuget.dgspe
 MicroServices/Business/Bussiness.MongoModel/obj/Business.Core.csproj.nuget.g.props
 MicroServices/Business/Bussiness.MongoModel/obj/Business.Core.csproj.nuget.g.targets
 MicroServices/Business/Bussiness.MongoModel/obj/Debug/net6.0/Bussiness.MongoModel.csproj.BuildWithSkipAnalyzers
+/MicroServices/Business/Buissness.UnitTest/bin/Debug/net6.0
+/MicroServices/Business/Buissness.UnitTest/obj
+/MicroServices/Business/Business.Test/bin/Debug/net6.0
+/MicroServices/Business/Business.Test/obj/Debug/net6.0

+ 20 - 0
MicroServices/Business/Buissness.UnitTest/Buissness.UnitTest.csproj

@@ -0,0 +1,20 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <ImplicitUsings>enable</ImplicitUsings>
+    <Nullable>enable</Nullable>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Abp.TestBase" Version="8.1.0" />
+    <PackageReference Include="Effort.EF6" Version="2.2.16" />
+    <PackageReference Include="xunit.extensibility.core" Version="2.4.2" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Business.Application\Business.Application.csproj" />
+    <ProjectReference Include="..\Business.EntityFrameworkCore\Business.EntityFrameworkCore.csproj" />
+  </ItemGroup>
+
+</Project>

+ 56 - 0
MicroServices/Business/Buissness.UnitTest/InitialData/UnitTestInitialDataBuilder.cs

@@ -0,0 +1,56 @@
+using Business.EntityFrameworkCore;
+using Business.Models;
+using Bussiness.Model.SIM;
+using Bussiness.Model.SystemData;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Buissness.UnitTest.InitialData
+{
+    public class UnitTestInitialDataBuilder
+    {
+        public void Build(BusinessDbContext context)
+        {
+            //Add some people
+
+            context.Book.AddRange(
+                new Book { Name = "Isaac Asimov", Price=1, Description="111",TenantId=Guid.NewGuid() },
+                new Book { Name = "Thomas More", Price = 2, Description = "222", TenantId = Guid.NewGuid() },
+                new Book { Name = "George Orwell",Price = 3, Description = "333", TenantId = Guid.NewGuid() },
+                new Book { Name = "Douglas Adams", Price = 4, Description = "444", TenantId = Guid.NewGuid() }
+                );
+
+            context.SaveChanges();
+
+            context.sim_base.AddRange(
+               new sim_base { sim_grade = "1", sim_level = 1, rise_cycle = (decimal?)0.5, interval_days = (decimal?)0.6, rise_time = DateTime.Now, factory_id = 10201, org_id = 102, tenant_id = 102 },
+               new sim_base { sim_grade = "2", sim_level = 2, rise_cycle = (decimal?)0.5, interval_days = (decimal?)0.7, rise_time = DateTime.Now, factory_id = 10201, org_id = 102, tenant_id = 102 },
+               new sim_base { sim_grade = "3", sim_level = 3, rise_cycle = (decimal?)0.5, interval_days = (decimal?)0.8, rise_time = DateTime.Now, factory_id = 10201, org_id = 102, tenant_id = 102 },
+               new sim_base { sim_grade = "4", sim_level = 4, rise_cycle = (decimal?)0.5, interval_days = (decimal?)0.9, rise_time = DateTime.Now, factory_id = 10201, org_id = 102, tenant_id = 102 }
+               );
+
+            context.SaveChanges();
+
+            context.sys_code.AddRange( 
+                new sys_code { code_name = "1", code_rule = "ABP1", code_value =1, chinese_name ="测试编码规则", code_date = DateTime.Now },
+                new sys_code { code_name = "2", code_rule = "ABP2", code_value = 1, chinese_name = "测试编码规则", code_date = DateTime.Now },
+                new sys_code { code_name = "3", code_rule = "ABP3", code_value = 1, chinese_name = "测试编码规则", code_date = DateTime.Now },
+                new sys_code { code_name = "4", code_rule = "ABP4", code_value = 1, chinese_name = "测试编码规则", code_date = DateTime.Now }
+                );
+
+            context.SaveChanges();
+
+            context.sys_code_pre.AddRange(
+                new sys_code_pre { code_name = "1", pre_name = context.sys_code.Single(p => p.code_name == "ABP1").code_rule, code_value = 1, code_date = DateTime.Now },
+                new sys_code_pre { code_name = "1", pre_name = context.sys_code.Single(p => p.code_name == "ABP2").code_rule, code_value = 2, code_date = DateTime.Now },
+                new sys_code_pre { code_name = "1", pre_name = context.sys_code.Single(p => p.code_name == "ABP3").code_rule, code_value = 3, code_date = DateTime.Now },
+                new sys_code_pre { code_name = "1", pre_name = context.sys_code.Single(p => p.code_name == "ABP4").code_rule, code_value = 4, code_date = DateTime.Now }
+                );
+
+            context.SaveChanges();
+        }
+    }
+}

+ 31 - 0
MicroServices/Business/Buissness.UnitTest/ResourceExamineManagement/ProductExamineAppServiceTest.cs

@@ -0,0 +1,31 @@
+using Business.Core.MongoDBHelper;
+using Business.ResourceExamineManagement;
+using Business.ResourceExamineManagement.Dto;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Xunit;
+
+namespace Buissness.UnitTest.ResourceExamineManagement
+{
+    public class ProductExamineAppServiceTest: UnitTestBase
+    {
+        private readonly IResourceExamineAppService resourceExamineAppService;
+
+        public ProductExamineAppServiceTest()
+        {
+            //创建被测试的类(SUT(Software Under Test) - 被测系统)
+            resourceExamineAppService = LocalIocManager.Resolve<IResourceExamineAppService>();
+        }
+
+        [Fact]
+        public void ReceiveResult()
+        {
+            var input=new SeorderentryDto { factoryId=10,sorderId=0, tenantId=0 };
+
+        }
+
+    }
+}

+ 59 - 0
MicroServices/Business/Buissness.UnitTest/UnitTestBase.cs

@@ -0,0 +1,59 @@
+using Abp.TestBase;
+using Buissness.UnitTest.InitialData;
+using Business.Core.MongoDBHelper;
+using Business.EntityFrameworkCore;
+using Castle.MicroKernel.Registration;
+using System.Data.Common;
+using Volo.Abp.Modularity;
+
+namespace Buissness.UnitTest
+{
+    /// <summary>
+    /// 这是所有测试类的基础类。
+    /// 它准备了ABP系统,模块和一个假的内存数据库。
+    /// 具有初始数据的种子数据库(<see cref =“SimpleTaskSystemInitialDataBuilder”/>)。
+    /// 提供使用DbContext轻松使用的方法。
+    /// </summary>
+    public abstract class UnitTestBase: AbpIntegratedTestBase<UnitTestModule>
+    {
+        protected UnitTestBase()
+        {
+            //种子初始数据
+            UsingDbContext(context => new UnitTestInitialDataBuilder().Build(context));
+        }
+
+
+        protected override void PreInitialize()
+        {
+            //假DbConnection使用Effort!
+            LocalIocManager.IocContainer.Register(
+                Component.For<DbConnection>()
+                    .UsingFactoryMethod(Effort.DbConnectionFactory.CreateTransient)
+                    .LifestyleSingleton()
+                );
+            base.PreInitialize();
+        }
+
+        public void UsingDbContext(Action<BusinessDbContext> action)
+        {
+            using (var context = LocalIocManager.Resolve<BusinessDbContext>())
+            {
+                action(context);
+                context.SaveChanges();
+            }
+        }
+
+        public T UsingDbContext<T>(Func<BusinessDbContext, T> func)
+        {
+            T result;
+
+            using (var context = LocalIocManager.Resolve<BusinessDbContext>())
+            {
+                result = func(context);
+                context.SaveChanges();
+            }
+
+            return result;
+        }
+    }
+}

+ 20 - 0
MicroServices/Business/Buissness.UnitTest/UnitTestModule.cs

@@ -0,0 +1,20 @@
+using Abp.Modules;
+using Business;
+using Business.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Buissness.UnitTest
+{
+    [DependsOn(
+         typeof(BusinessEntityFrameworkCoreModule),
+         typeof(BusinessApplicationModule)
+     )]
+    public class UnitTestModule: AbpModule
+    {
+
+    }
+}

+ 5 - 0
MicroServices/Business/Business.Application.Contracts/Business.Application.Contracts.csproj

@@ -42,4 +42,9 @@
     <ProjectReference Include="..\Bussiness.MongoModel\Bussiness.MongoModel.csproj" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Folder Include="WMS\" />
+    <Folder Include="MES\" />
+  </ItemGroup>
+
 </Project>

+ 7 - 1
MicroServices/Business/Business.Application/Business.Application.csproj

@@ -11,8 +11,8 @@
 
   <ItemGroup>
     <PackageReference Include="Magicodes.IE.Pdf" Version="2.7.1" />
+    <PackageReference Include="Quartz.AspNetCore" Version="3.6.2" />
     <PackageReference Include="Volo.Abp.AutoMapper" Version="6.0.0" />
-    <PackageReference Include="Volo.Abp.BackgroundJobs.HangFire" Version="6.0.0" />
     <PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="6.0.0" />
 	<PackageReference Include="Volo.Abp.Ddd.Application" Version="6.0.0" />
     <PackageReference Include="Volo.Abp.Identity.HttpApi.Client" Version="6.0.0" />
@@ -28,4 +28,10 @@
     <ProjectReference Include="..\Bussiness.MongoModel\Bussiness.MongoModel.csproj" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Folder Include="MES\" />
+    <Folder Include="QMS\" />
+    <Folder Include="WMS\" />
+  </ItemGroup>
+
 </Project>

+ 1 - 3
MicroServices/Business/Business.Application/BusinessApplicationModule.cs

@@ -1,7 +1,6 @@
 using BaseService.HttpApi.Client;
 using Volo.Abp.Application;
 using Volo.Abp.AutoMapper;
-using Volo.Abp.BackgroundJobs.Hangfire;
 using Volo.Abp.Http.Client.IdentityModel;
 using Volo.Abp.Identity;
 using Volo.Abp.Modularity;
@@ -18,8 +17,7 @@ namespace Business
         typeof(BaseServiceHttpApiClientModule),
         typeof(FormApplicationModule),
         typeof(FlowApplicationModule),
-        typeof(AbpAutoMapperModule),
-        typeof(AbpBackgroundJobsHangfireModule)
+        typeof(AbpAutoMapperModule)
     )]
     public class BusinessApplicationModule : AbpModule
     {

+ 0 - 85
MicroServices/Business/Business.Application/HangFire/CronType.cs

@@ -1,85 +0,0 @@
-using Hangfire;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace Business.HangFire
-{
-    /// <summary>
-    /// Cron类型
-    /// </summary>
-    public static class CronType
-    {
-        /// <summary>
-        /// 周期性为分钟的任务
-        /// </summary>
-        /// <param name="interval">执行周期的间隔,默认为每分钟一次</param>
-        /// <returns></returns>
-        public static string Minute(int interval = 1)
-        {
-            return "1 0/" + interval.ToString() + " * * * ? ";
-        }
-
-        /// <summary>
-        /// 周期性为小时的任务
-        /// </summary>
-        /// <param name="minute">第几分钟开始,默认为第一分钟</param>
-        /// <param name="interval">执行周期的间隔,默认为每小时一次</param>
-        /// <returns></returns>
-        public static string Hour(int minute = 1, int interval = 1)
-        {
-            return "1 " + minute + " 0/" + interval.ToString() + " * * ? ";
-        }
-
-        /// <summary>
-        /// 周期性为天的任务
-        /// </summary>
-        /// <param name="hour">第几小时开始,默认从1点开始</param>
-        /// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
-        /// <param name="interval">执行周期的间隔,默认为每天一次</param>
-        /// <returns></returns>
-        public static string Day(int hour = 1, int minute = 1, int interval = 1)
-        {
-            return "1 " + minute.ToString() + " " + hour.ToString() + " 1/" + interval.ToString() + " * ? ";
-        }
-
-        /// <summary>
-        /// 周期性为周的任务
-        /// </summary>
-        /// <param name="dayOfWeek">星期几开始,默认从星期一点开始</param>
-        /// <param name="hour">第几小时开始,默认从1点开始</param>
-        /// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
-        /// <returns></returns>
-        public static string Week(DayOfWeek dayOfWeek = DayOfWeek.Monday, int hour = 1, int minute = 1)
-        {
-            return Cron.Weekly(dayOfWeek, hour, minute);
-        }
-
-        /// <summary>
-        /// 周期性为月的任务
-        /// </summary>
-        /// <param name="day">几号开始,默认从一号开始</param>
-        /// <param name="hour">第几小时开始,默认从1点开始</param>
-        /// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
-        /// <returns></returns>
-        public static string Month(int day = 1, int hour = 1, int minute = 1)
-        {
-            return Cron.Monthly(day, hour, minute);
-        }
-
-        /// <summary>
-        /// 周期性为年的任务
-        /// </summary>
-        /// <param name="month">几月开始,默认从一月开始</param>
-        /// <param name="day">几号开始,默认从一号开始</param>
-        /// <param name="hour">第几小时开始,默认从1点开始</param>
-        /// <param name="minute">第几分钟开始,默认从第1分钟开始</param>
-        /// <returns></returns>
-        public static string Year(int month = 1, int day = 1, int hour = 1, int minute = 1)
-        {
-            return Cron.Yearly(month, day, hour, minute);
-        }
-    }
-}

+ 2 - 2
MicroServices/Business/Business.Application/HangFire/IHangFireJobService.cs → MicroServices/Business/Business.Application/Quartz/IQuartzJobService.cs

@@ -4,9 +4,9 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace Business.HangFire
+namespace Business.Quartz
 {
-    public interface IHangFireJobService
+    public interface IQuartzJobService
     {
         /// <summary>
         /// 定时同步mysql数据到mongodb中

+ 3 - 3
MicroServices/Business/Business.Application/HangFire/HangFireJobService.cs → MicroServices/Business/Business.Application/Quartz/QuartzJobService.cs

@@ -5,9 +5,9 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 
-namespace Business.HangFire
+namespace Business.Quartz
 {
-    public class HangFireJobService : IHangFireJobService
+    public class QuartzJobService : IQuartzJobService
     {
         /// <summary>
         /// 同步数据到mongodb服务
@@ -17,7 +17,7 @@ namespace Business.HangFire
         /// <summary>
         /// 构造函数
         /// </summary>
-        public HangFireJobService(SyncMySQLDataAppService syncDataAppservice)
+        public QuartzJobService(SyncMySQLDataAppService syncDataAppservice)
         {
             _syncDataAppservice = syncDataAppservice;
         }

+ 34 - 0
MicroServices/Business/Business.Application/Quartz/SyncMySQLDataJob.cs

@@ -0,0 +1,34 @@
+using Business.SyncDataManagement;
+using Quartz;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Business.Quartz
+{
+    public class SyncMySQLDataJob : IJob
+    {
+
+        /// <summary>
+        /// 同步数据到mongodb服务
+        /// </summary>
+        public readonly SyncMySQLDataAppService _syncDataAppservice;
+
+        /// <summary>
+        /// 构造函数
+        /// </summary>
+        public SyncMySQLDataJob(SyncMySQLDataAppService syncDataAppservice)
+        {
+            _syncDataAppservice = syncDataAppservice;
+        }
+        public Task Execute(IJobExecutionContext context)
+        {
+            _syncDataAppservice.SyncBaseDataToMongoDB();
+
+            return Task.CompletedTask;
+        }
+    }
+}

+ 0 - 1
MicroServices/Business/Business.EntityFrameworkCore/Business.EntityFrameworkCore.csproj

@@ -10,7 +10,6 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Hangfire.SqlServer" Version="1.7.29" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.5">
       <PrivateAssets>all</PrivateAssets>
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

+ 1 - 9
MicroServices/Business/Business.Host/Business.Host.csproj

@@ -9,8 +9,6 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="Hangfire.Dashboard.BasicAuthorization" Version="1.0.2" />
-    <PackageReference Include="HuffeyHangFire" Version="1.0.0" />
 	 <PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="6.0.3" />
     <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.3" />
     <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">
@@ -18,6 +16,7 @@
       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
     </PackageReference>
     <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.3" />
+    <PackageReference Include="Quartz.AspNetCore" Version="3.6.2" />
     <PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
     <PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
     <PackageReference Include="Serilog.Sinks.Elasticsearch" Version="8.4.1" />
@@ -38,14 +37,7 @@
 
   <ItemGroup>
     <Folder Include="DataSeeder\" />
-    <Folder Include="Logs\" />
     <Folder Include="wwwroot\" />
   </ItemGroup>
 
-  <ItemGroup>
-    <Reference Include="Hangfire.MySql.Core">
-      <HintPath>..\..\..\..\Hangfire.MySql.Core\Hangfire.MySql\bin\Debug\net5.0\Hangfire.MySql.Core.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-
 </Project>

+ 28 - 55
MicroServices/Business/Business.Host/BusinessHostModule.cs

@@ -1,12 +1,8 @@
 using Autofac.Core;
 using Business.Core.MongoDBHelper;
 using Business.EntityFrameworkCore;
-using Business.HangFire;
 using Business.MultiTenancy;
-using Hangfire;
-using Hangfire.Dashboard.BasicAuthorization;
-using Hangfire.MySql;
-using Hangfire.MySql.Core;
+using Business.Quartz;
 using Microsoft.AspNetCore.Authentication.JwtBearer;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Cors;
@@ -16,13 +12,13 @@ using Microsoft.Extensions.Configuration;
 using Microsoft.Extensions.DependencyInjection;
 using Microsoft.Extensions.Hosting;
 using Microsoft.OpenApi.Models;
+using Quartz;
 using StackExchange.Redis;
 using System;
 using System.Collections.Generic;
 using System.Data;
 using System.IO;
 using System.Linq;
-using System.Security.Cryptography.Pkcs;
 using Volo.Abp;
 using Volo.Abp.AspNetCore.ExceptionHandling;
 using Volo.Abp.AspNetCore.MultiTenancy;
@@ -67,10 +63,10 @@ namespace Business
             //ConfigureRedis(context, configuration, hostingEnvironment);
             ConfigureCors(context, configuration);
             ConfigureSwaggerServices(context, configuration);
-            ConfigureHangfire(context, configuration);
+            ConfigureQuartz(context, configuration);
             //MongoDB依赖注入
             ConfigureMongoDB(configuration);
-            if(hostingEnvironment.IsDevelopment())
+            if (hostingEnvironment.IsDevelopment())
             {
                 Configure<AbpExceptionHandlingOptions>(options =>
                 {
@@ -95,31 +91,31 @@ namespace Business
             });
         }
 
-        private void ConfigureHangfire(ServiceConfigurationContext context, IConfiguration configuration)
+        private void ConfigureQuartz(ServiceConfigurationContext context, IConfiguration configuration)
         {
-            context.Services.AddHangfire(config =>
+            context.Services.AddQuartz(q =>
             {
-                //config.UseStorage(new MySqlStorage(configuration.GetConnectionString("Business"),new MySqlStorageOptions
-                //{
-                //    TransactionIsolationLevel =IsolationLevel.ReadCommitted,
-                //    QueuePollInterval = TimeSpan.FromSeconds(15),
-                //    JobExpirationCheckInterval = TimeSpan.FromHours(1),
-                //    CountersAggregateInterval = TimeSpan.FromMinutes(5),
-                //    PrepareSchemaIfNecessary = true,
-                //    DashboardJobListLimit = 50000,
-                //    TransactionTimeout = TimeSpan.FromMinutes(1),
-                //    TablePrefix = "Hangfire"
-                //}));
-                config.UseStorage(new MySqlStorage(configuration.GetConnectionString("Default"), new MySqlStorageOptions
-                {
-                    QueuePollInterval = TimeSpan.FromSeconds(15),
-                    JobExpirationCheckInterval = TimeSpan.FromHours(1),
-                    CountersAggregateInterval = TimeSpan.FromMinutes(5),
-                    PrepareSchemaIfNecessary = true,
-                    DashboardJobListLimit = 50000,
-                    TransactionTimeout = TimeSpan.FromMinutes(1),
-                }));
+                q.UseMicrosoftDependencyInjectionScopedJobFactory();
+                // Just use the name of your job that you created in the Jobs folder.
+                var jobKey = new JobKey("DemoJob");
+                q.AddJob<SyncMySQLDataJob>(opts => opts.WithIdentity(jobKey));
+
+                q.AddTrigger(opts => opts
+                    .ForJob(jobKey)
+                    .WithIdentity("DemoJob-trigger")
+                    .WithCronSchedule("0 45 11 * * ?")
+                    .WithDescription("定时同步MySQL基础数据到MongoDB"));
             });
+            context.Services.AddQuartzServer(options =>
+            {
+                // when shutting down we want jobs to complete gracefully
+                options.WaitForJobsToComplete = true;
+            });
+            //context.Services.AddQuartzHostedService(options =>
+            //{
+            //    // when shutting down we want jobs to complete gracefully
+            //    options.WaitForJobsToComplete = true;
+            //});
         }
 
         /// <summary>
@@ -129,7 +125,8 @@ namespace Business
         /// <param name="configuration"></param>
         private void ConfigureMongoDB(IConfiguration configuration)
         {
-            Configure<Config>(options => {
+            Configure<Config>(options =>
+            {
                 options.connectstring = configuration.GetConnectionString("MongoDB");
                 options.database = configuration.GetConnectionString("DBName");
             });
@@ -293,30 +290,6 @@ namespace Business
             app.UseAbpSerilogEnrichers();
             app.UseUnitOfWork();
             app.UseConfiguredEndpoints();
-            //app.UseHangfireServer();
-            app.UseHangfireDashboard(options: new DashboardOptions
-            {
-                Authorization = new[]
-                {
-                    new BasicAuthAuthorizationFilter(new BasicAuthAuthorizationFilterOptions
-                    {
-                        RequireSsl = false,
-                        SslRedirect = false,
-                        LoginCaseSensitive = true,
-                        Users = new []
-                        {
-                            new BasicAuthAuthorizationUser
-                            {
-                                Login = configuration["Hangfire:Login"],
-                                PasswordClear =  configuration["Hangfire:Password"]
-                            }
-                        }
-                    })
-                },
-                DashboardTitle = "任务调度中心"
-            });
-
-            RecurringJob.AddOrUpdate<IHangFireJobService>(a=>a.SyncDataMySQLData(),CronType.Day(0,0,1),TimeZoneInfo.Local);
             AsyncHelper.RunSync(async () =>
             {
                 using (var scope = context.ServiceProvider.CreateScope())

+ 0 - 2
MicroServices/Business/Business.Host/Startup.cs

@@ -1,5 +1,4 @@
 using Business.Core.MongoDBHelper;
-using Business.HangFire;
 using Microsoft.AspNetCore.Builder;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.Extensions.DependencyInjection;
@@ -15,7 +14,6 @@ namespace Business
             //MongoDBHelperÒÀÀµ×¢Èë
             services.AddScoped(typeof(IMongoDB<>), typeof(MongoDBTools<>));
             services.AddScoped<Config>();
-            services.AddTransient<IHangFireJobService,HangFireJobService>();
         }
 
         public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)

+ 6 - 0
MicroServices/Business/Business.HttpApi/Business.HttpApi.csproj

@@ -24,4 +24,10 @@
     <ProjectReference Include="..\Business.Application.Contracts\Business.Application.Contracts.csproj" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Folder Include="Controllers\WMS\" />
+    <Folder Include="Controllers\MES\" />
+    <Folder Include="Controllers\DOP\" />
+  </ItemGroup>
+
 </Project>

+ 42 - 0
MicroServices/Business/Business.HttpApi/Controllers/Kanban/KanbanController.cs

@@ -0,0 +1,42 @@
+using Business.ResourceExamineManagement;
+using Business.ResourceExamineManagement.Dto;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace Business.Controllers.Kanban
+{
+    /// <summary>
+    /// 看板&报表
+    /// </summary>
+    [RemoteService]
+    [Area("Business")]
+    [Route("api/business/kanban")]
+    public class KanbanController : AbpController
+    {
+        //private readonly IResourceExamineAppService _ResourceExamineAppService;
+
+        public KanbanController(IResourceExamineAppService ResourceExamineAppService)
+        {
+            //_ResourceExamineAppService = ResourceExamineAppService;
+        }
+
+        /// <summary>
+        /// 待收货看板
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("demo")]
+        public Task<string> Demo()
+        {
+            //收货通知组织、收货通知日期、收货通知单号、收货申请人、单据类型、供应商编码、供应商名称、已等待收货时间、物料编码、物料名称、规格型号、数量
+            throw new NotImplementedException();
+        }
+    }
+}

+ 42 - 0
MicroServices/Business/Business.HttpApi/Controllers/QMS/QMSController.cs

@@ -0,0 +1,42 @@
+using Business.ResourceExamineManagement;
+using Business.ResourceExamineManagement.Dto;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace Business.Controllers.QMS
+{
+    /// <summary>
+    /// QMS示例,具体接口名称和接口设计请参考具体需求文档
+    /// </summary>
+    [RemoteService]
+    [Area("Business")]
+    [Route("api/business/qms")]
+    public class QMSController : AbpController
+    {
+        //private readonly IResourceExamineAppService _ResourceExamineAppService;
+
+        public QMSController(IResourceExamineAppService ResourceExamineAppService)
+        {
+            //_ResourceExamineAppService = ResourceExamineAppService;
+        }
+
+        /// <summary>
+        /// 待收货看板
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("demo")]
+        public Task<string> Demo()
+        {
+            //收货通知组织、收货通知日期、收货通知单号、收货申请人、单据类型、供应商编码、供应商名称、已等待收货时间、物料编码、物料名称、规格型号、数量
+            throw new NotImplementedException();
+        }
+    }
+}

+ 42 - 0
MicroServices/Business/Business.HttpApi/Controllers/SIM/AndonController.cs

@@ -0,0 +1,42 @@
+using Business.ResourceExamineManagement;
+using Business.ResourceExamineManagement.Dto;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace Business.Controllers.SIM
+{
+    /// <summary>
+    /// 安灯系统示例,具体接口名称和接口设计请参考具体需求文档
+    /// </summary>
+    [RemoteService]
+    [Area("Business")]
+    [Route("api/business/andon")]
+    public class AndonController : AbpController
+    {
+        //private readonly IResourceExamineAppService _ResourceExamineAppService;
+
+        public AndonController(IResourceExamineAppService ResourceExamineAppService)
+        {
+            //_ResourceExamineAppService = ResourceExamineAppService;
+        }
+
+        /// <summary>
+        /// 待收货看板
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("demo")]
+        public Task<string> Demo()
+        {
+            //收货通知组织、收货通知日期、收货通知单号、收货申请人、单据类型、供应商编码、供应商名称、已等待收货时间、物料编码、物料名称、规格型号、数量
+            throw new NotImplementedException();
+        }
+    }
+}

+ 42 - 0
MicroServices/Business/Business.HttpApi/Controllers/SIM/SIMController.cs

@@ -0,0 +1,42 @@
+using Business.ResourceExamineManagement;
+using Business.ResourceExamineManagement.Dto;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace Business.Controllers.SIM
+{
+    /// <summary>
+    /// SIM系统示例,具体接口名称和接口设计请参考具体需求文档
+    /// </summary>
+    [RemoteService]
+    [Area("Business")]
+    [Route("api/business/sim")]
+    public class SIMController : AbpController
+    {
+        //private readonly IResourceExamineAppService _ResourceExamineAppService;
+
+        public SIMController(IResourceExamineAppService ResourceExamineAppService)
+        {
+            //_ResourceExamineAppService = ResourceExamineAppService;
+        }
+
+        /// <summary>
+        /// 异常问题升级规则
+        /// </summary>
+        /// <param name="input"></param>
+        /// <returns></returns>
+        [HttpGet]
+        [Route("demo")]
+        public Task<string> Demo()
+        {
+            //升级规则维护
+            throw new NotImplementedException();
+        }
+    }
+}

+ 0 - 28
MicroServices/Business/Business.HttpApi/Controllers/ThinkFlowController.cs

@@ -1,28 +0,0 @@
-using Business.BookManagement;
-using Business.BookManagement.Dto;
-using Business.Permissions;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Mvc;
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-using Volo.Abp;
-using Volo.Abp.Application.Dtos;
-using Volo.Abp.AspNetCore.Mvc;
-
-namespace Business.Controllers
-{
-    [RemoteService]
-    [Area("Business")]
-    [Route("api/business/thinkflow")]
-    [Authorize(BusinessPermissions.ThinkFlow.Default)]
-    public class ThinkFlowController : AbpController
-    {
-        [HttpGet]
-        [Route("index")]
-        public ActionResult Index()
-        {
-            return Redirect("http://localhost:3001/");
-        }
-    }
-}

+ 7 - 1
MicroServices/Business/Business.sln

@@ -25,7 +25,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bussiness.MongoModel", "Bus
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{4523E5A9-9492-49A2-8A1A-46080749D966}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Business.Test", "Business.Test\Business.Test.csproj", "{66017D12-2115-4DC9-B400-E5E57EE2D16E}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Business.Test", "Business.Test\Business.Test.csproj", "{66017D12-2115-4DC9-B400-E5E57EE2D16E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Buissness.UnitTest", "Buissness.UnitTest\Buissness.UnitTest.csproj", "{DFAA3146-7008-4F54-B48B-013E80208376}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -77,6 +79,10 @@ Global
 		{66017D12-2115-4DC9-B400-E5E57EE2D16E}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{66017D12-2115-4DC9-B400-E5E57EE2D16E}.Release|Any CPU.ActiveCfg = Release|Any CPU
 		{66017D12-2115-4DC9-B400-E5E57EE2D16E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{DFAA3146-7008-4F54-B48B-013E80208376}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{DFAA3146-7008-4F54-B48B-013E80208376}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{DFAA3146-7008-4F54-B48B-013E80208376}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{DFAA3146-7008-4F54-B48B-013E80208376}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 53 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturing.Application.Contracts.csproj

@@ -0,0 +1,53 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>DigitalManufacturing</RootNamespace>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
+    <PackageId>XCZ.Procurement.Application.Contracts</PackageId>
+    <Version>0.1.1</Version>
+    <Authors>XCZ</Authors>
+    <Product>Procurement</Product>
+    <Description>Procurement服务Application.Contracts远程依赖</Description>
+    <PackageProjectUrl>https://github.com/WilliamXu96/ABP-MicroService</PackageProjectUrl>
+    <RepositoryUrl>https://github.com/WilliamXu96/ABP-MicroService</RepositoryUrl>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <None Remove="Localization\DigitalManufacturing\cs.json" />
+    <None Remove="Localization\DigitalManufacturing\en.json" />
+    <None Remove="Localization\DigitalManufacturing\pl.json" />
+    <None Remove="Localization\DigitalManufacturing\pt-BR.json" />
+    <None Remove="Localization\DigitalManufacturing\tr.json" />
+    <None Remove="Localization\DigitalManufacturing\vi.json" />
+    <None Remove="Localization\DigitalManufacturing\zh-Hans.json" />
+    <None Remove="Localization\DigitalManufacturing\zh-Hant.json" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <EmbeddedResource Include="Localization\DigitalManufacturing\cs.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\en.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\pl.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\pt-BR.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\tr.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\vi.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\zh-Hans.json" />
+    <EmbeddedResource Include="Localization\DigitalManufacturing\zh-Hant.json" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
+    <PackageReference Include="Volo.Abp.Ddd.Application" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="6.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="DigitalManufacturingManagement\DOP\" />
+    <Folder Include="DigitalManufacturingManagement\Kanban\" />
+    <Folder Include="DigitalManufacturingManagement\MES\" />
+    <Folder Include="DigitalManufacturingManagement\QMS\" />
+    <Folder Include="DigitalManufacturingManagement\SIM\" />
+    <Folder Include="DigitalManufacturingManagement\WMS\" />
+  </ItemGroup>
+
+</Project>

+ 34 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingApplicationContractsModule.cs

@@ -0,0 +1,34 @@
+using Business.Localization;
+using Volo.Abp.Application;
+using Volo.Abp.Localization;
+using Volo.Abp.Modularity;
+using Volo.Abp.PermissionManagement;
+using Volo.Abp.Validation.Localization;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Procurement
+{
+    [DependsOn(
+       typeof(AbpLocalizationModule),
+        typeof(AbpDddApplicationModule),
+        typeof(AbpPermissionManagementApplicationContractsModule)
+    )]
+    public class DigitalManufacturingApplicationContractsModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+            Configure<AbpVirtualFileSystemOptions>(options =>
+            {
+                options.FileSets.AddEmbedded<DigitalManufacturingApplicationContractsModule>("DigitalManufacturing");
+            });
+
+            Configure<AbpLocalizationOptions>(options =>
+            {
+                options.Resources
+                    .Add<DigitalManufacturingResource>("zh-Hans")
+                    .AddBaseTypes(typeof(AbpValidationResource))
+                    .AddVirtualJson("/Localization/DigitalManufacturing");
+            });
+        }
+    }
+}

+ 22 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingManagement/Dto/FileInfoDto.cs

@@ -0,0 +1,22 @@
+using System;
+using Volo.Abp.Application.Dtos;
+
+namespace Procurement.FileManagement.Dto
+{
+    public class FileInfoDto : EntityDto<Guid>
+    {
+        public string Name { get; set; }
+
+        public string RealName { get; set; }
+
+        public string Suffix { get; set; }
+
+        public string Size { get; set; }
+
+        public string Url { get; set; }
+
+        public int Type { get; set; }
+
+        public DateTime CreationTime { get; set; }
+    }
+}

+ 9 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingManagement/Dto/GetFileInputDto.cs

@@ -0,0 +1,9 @@
+using Volo.Abp.Application.Dtos;
+
+namespace Procurement.FileManagement.Dto
+{
+    public class GetFileInputDto : PagedAndSortedResultRequestDto
+    {
+        public string Filter { get; set; }
+    }
+}

+ 18 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/DigitalManufacturingManagement/IDigitalManufacturingAppService.cs

@@ -0,0 +1,18 @@
+using Procurement.FileManagement.Dto;
+using Microsoft.AspNetCore.Http;
+using System.ComponentModel.DataAnnotations;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+
+namespace DigitalManufacturing.DigitalManufacturingManagement
+{
+    public interface IDigitalManufacturingAppService : IApplicationService
+    {
+        Task<PagedResultDto<FileInfoDto>> GetAll(GetFileInputDto input);
+
+        Task<FileInfoDto> Upload([Required] string name, [Required] IFormFile file);
+
+        Task UploadPrivate([Required] string name, [Required] IFormFile file);
+    }
+}

+ 13 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/cs.json

@@ -0,0 +1,13 @@
+{
+  "culture": "cs",
+  "texts": {
+    "Menu:Home": "Úvod",
+    "Welcome": "Vítejte",
+    "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io.",
+    "Edit": "修改",
+    "Delete": "删除",
+    "Create": "新增",
+    "Business": "业务",
+    "DataDictionary": "数据字典"
+  }
+}

+ 8 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/en.json

@@ -0,0 +1,8 @@
+{
+  "culture": "en",
+  "texts": {
+    "Menu:Home": "Home",
+    "Welcome": "Welcome",
+    "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io."
+  }
+}

+ 8 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/pl.json

@@ -0,0 +1,8 @@
+{
+  "culture": "pl",
+  "texts": {
+    "Menu:Home": "Home",
+    "Welcome": "Witaj",
+    "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io."
+  }
+}

+ 8 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/pt-BR.json

@@ -0,0 +1,8 @@
+{
+  "culture": "pt-BR",
+  "texts": {
+    "Menu:Home": "Principal",
+    "Welcome": "Seja bem-vindo!",
+    "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io."
+  }
+}

+ 8 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/tr.json

@@ -0,0 +1,8 @@
+{
+  "culture": "tr",
+  "texts": {
+    "Menu:Home": "Ana sayfa",
+    "Welcome": "Hoşgeldiniz",
+    "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz."
+  }
+}

+ 8 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/vi.json

@@ -0,0 +1,8 @@
+{
+  "culture": "vi",
+  "texts": {
+    "Menu:Home": "Trang chủ",
+    "Welcome": "Chào mừng bạn",
+    "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io."
+  }
+}

+ 13 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/zh-Hans.json

@@ -0,0 +1,13 @@
+{
+  "culture": "zh-Hans",
+  "texts": {
+    "Menu:Home": "首页",
+    "Welcome": "欢迎",
+    "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io.",
+    "Edit": "修改",
+    "Delete": "删除",
+    "Create": "新增",
+    "DigitalManufacturingManagement": "数字化制造平台服务",
+    "File": "存储管理"
+  }
+}

+ 8 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/DigitalManufacturing/zh-Hant.json

@@ -0,0 +1,8 @@
+{
+    "culture": "zh-Hant",
+    "texts": {
+      "Menu:Home": "首頁",
+      "Welcome": "歡迎",
+      "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io."
+    }
+  }

+ 9 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Localization/StorageResource.cs

@@ -0,0 +1,9 @@
+using Volo.Abp.Localization;
+
+namespace Business.Localization
+{
+    [LocalizationResourceName("DigitalManufacturing")]
+    public class DigitalManufacturingResource
+    {
+    }
+}

+ 28 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Permissions/DigitalManufacturingPermissionDefinitionProvider.cs

@@ -0,0 +1,28 @@
+using Business.Localization;
+using Volo.Abp.Authorization.Permissions;
+using Volo.Abp.Localization;
+using Volo.Abp.MultiTenancy;
+
+namespace Procurement.Permissions
+{
+    public class DigitalManufacturingPermissionDefinitionProvider: PermissionDefinitionProvider
+    {
+
+        public override void Define(IPermissionDefinitionContext context)
+        {
+            var digitalManufacturing = context.AddGroup(DigitalManufacturingPermissions.DigitalManufacturingManagement, L("DigitalManufacturingManagement"));
+
+            var DigitalManufacturing = digitalManufacturing.AddPermission(DigitalManufacturingPermissions.File.Default, L("DigitalManufacturing"));
+            DigitalManufacturing.AddChild(DigitalManufacturingPermissions.File.Update, L("Edit"));
+            DigitalManufacturing.AddChild(DigitalManufacturingPermissions.File.Delete, L("Delete"));
+            DigitalManufacturing.AddChild(DigitalManufacturingPermissions.File.Create, L("Create"));
+
+            //Code generation...
+        }
+
+        private static LocalizableString L(string name)
+        {
+            return LocalizableString.Create<DigitalManufacturingResource>(name);
+        }
+    }
+}

+ 17 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application.Contracts/Permissions/DigitalManufacturingPermissions.cs

@@ -0,0 +1,17 @@
+namespace Procurement.Permissions
+{
+    public static class DigitalManufacturingPermissions
+    {
+        public const string DigitalManufacturingManagement = "DigitalManufacturingManagement";
+
+        public static class File
+        {
+            public const string Default = DigitalManufacturingManagement + ".File";
+            public const string Delete = Default + ".Delete";
+            public const string Update = Default + ".Update";
+            public const string Create = Default + ".Create";
+        }
+
+        //Code generation...
+    }
+}

+ 27 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturing.Application.csproj

@@ -0,0 +1,27 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>Procurement</RootNamespace>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.AutoMapper" Version="6.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\DigitalManufacturing.Application.Contracts\DigitalManufacturing.Application.Contracts.csproj" />
+    <ProjectReference Include="..\DigitalManufacturing.Domain\DigitalManufacturing.Domain.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="DigitalManufacturingManagement\DOP\" />
+    <Folder Include="DigitalManufacturingManagement\Kanban\" />
+    <Folder Include="DigitalManufacturingManagement\MES\" />
+    <Folder Include="DigitalManufacturingManagement\QMS\" />
+    <Folder Include="DigitalManufacturingManagement\SIM\" />
+    <Folder Include="DigitalManufacturingManagement\WMS\" />
+  </ItemGroup>
+
+</Project>

+ 14 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturingApplicationAutoMapperProfile.cs

@@ -0,0 +1,14 @@
+using AutoMapper;
+using Procurement.FileManagement.Dto;
+using Procurement.Models;
+
+namespace Procurement
+{
+    public class DigitalManufacturingApplicationAutoMapperProfile : Profile
+    {
+        public DigitalManufacturingApplicationAutoMapperProfile()
+        {
+            CreateMap<FileInfo, FileInfoDto>();
+        }
+    }
+}

+ 21 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturingApplicationModule.cs

@@ -0,0 +1,21 @@
+using Volo.Abp.AutoMapper;
+using Volo.Abp.Modularity;
+
+namespace Procurement
+{
+    [DependsOn(
+        typeof(DigitalManufacturingDomainModule),
+        typeof(DigitalManufacturingApplicationContractsModule),
+        typeof(AbpAutoMapperModule)
+    )]
+    public class DigitalManufacturingApplicationModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+            Configure<AbpAutoMapperOptions>(options =>
+            {
+                options.AddMaps<DigitalManufacturingApplicationModule>();
+            });
+        }
+    }
+}

+ 129 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Application/DigitalManufacturingManagement/DigitalManufacturingAppService.cs

@@ -0,0 +1,129 @@
+using Procurement.Enums;
+using Procurement.FileManagement.Dto;
+using Procurement.Models;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Linq.Dynamic.Core;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Domain.Repositories;
+using FileInfo = Procurement.Models.FileInfo;
+
+namespace DigitalManufacturing.DigitalManufacturingManagement
+{
+    public class DigitalManufacturingAppService : ApplicationService, IDigitalManufacturingAppService
+    {
+        private readonly IRepository<FileInfo, Guid> _repository;
+        private readonly FileManager _fileManager;
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public DigitalManufacturingAppService(IRepository<FileInfo, Guid> repository, FileManager fileManager)
+        {
+            _repository = repository;
+            _fileManager = fileManager;
+        }
+
+        public async Task<PagedResultDto<FileInfoDto>> GetAll(GetFileInputDto input)
+        {
+            var query = (await _repository.GetQueryableAsync()).WhereIf(!string.IsNullOrWhiteSpace(input.Filter), _ => _.Name.Contains(input.Filter));
+
+            var totalCount = await query.CountAsync();
+            var items = await query.OrderBy(input.Sorting ?? "Name")
+                                   .Skip(input.SkipCount)
+                                   .Take(input.MaxResultCount)
+                                   .ToListAsync();
+
+            var dtos = ObjectMapper.Map<List<FileInfo>, List<FileInfoDto>>(items);
+            return new PagedResultDto<FileInfoDto>(totalCount, dtos);
+        }
+
+        public async Task<FileInfoDto> Upload([Required] string name, [Required] IFormFile file)
+        {
+            if (file == null || file.Length == 0) throw new BusinessException("无法上传空文件");
+
+            //限制100M
+            if (file.Length > 104857600)
+            {
+                throw new BusinessException("上传文件过大");
+            }
+            //文件格式
+            var fileExtension = Path.GetExtension(file.FileName);
+            if (!pictureFormatArray.Contains(fileExtension))
+            {
+                throw new BusinessException("上传文件格式错误");
+            }
+
+            var size = "";
+            if (file.Length < 1024)
+                size = file.Length.ToString() + "B";
+            else if (file.Length >= 1024 && file.Length < 1048576)
+                size = ((float)file.Length / 1024).ToString("F2") + "KB";
+            else if (file.Length >= 1048576 && file.Length < 104857600)
+                size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+            else size = file.Length.ToString() + "B";
+
+            string uploadsFolder = Path.Combine(Environment.CurrentDirectory, "wwwroot", "files");
+            if (!Directory.Exists(uploadsFolder))
+            {
+                Directory.CreateDirectory(uploadsFolder);
+            }
+
+            var uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+            string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+            using (var fileStream = new FileStream(filePath, FileMode.Create))
+            {
+                file.CopyTo(fileStream);
+                fileStream.Flush();
+            }
+
+            //TODO:文件md5哈希校验
+            var result = await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/files/" + uniqueFileName, FileType.Image);
+            return ObjectMapper.Map<FileInfo, FileInfoDto>(result);
+        }
+
+        public async Task UploadPrivate([Required] string name, [Required] IFormFile file)
+        {
+            if (file == null || file.Length == 0) throw new BusinessException("无法上传空文件");
+            if (file.Length > 104857600) throw new BusinessException("上传文件过大");
+            var fileExtension = Path.GetExtension(file.FileName);
+            if (!pictureFormatArray.Contains(fileExtension)) throw new BusinessException("上传文件格式错误");
+
+            var size = "";
+            if (file.Length < 1024)
+                size = file.Length.ToString() + "B";
+            else if (file.Length >= 1024 && file.Length < 1048576)
+                size = ((float)file.Length / 1024).ToString("F2") + "KB";
+            else if (file.Length >= 1048576 && file.Length < 104857600)
+                size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+            else size = file.Length.ToString() + "B";
+
+            string uploadsFolder = Path.Combine(Environment.CurrentDirectory, "files");
+            if (!Directory.Exists(uploadsFolder)) Directory.CreateDirectory(uploadsFolder);
+
+            var uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+            string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+            using (var fileStream = new FileStream(filePath, FileMode.Create))
+            {
+                file.CopyTo(fileStream);
+                fileStream.Flush();
+            }
+
+            await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/files/" + uniqueFileName, FileType.Image);
+        }
+
+        public dynamic Download([Required] string name)
+        {
+            var filePath = Path.Combine(Environment.CurrentDirectory, "files", name);
+            if (!File.Exists(filePath)) throw new BusinessException("找不到文件");
+            return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = name };
+        }
+    }
+}

+ 30 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/DigitalManufacturing.Domain.csproj

@@ -0,0 +1,30 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>Procurement</RootNamespace>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <Compile Remove="Localization\**" />
+    <EmbeddedResource Remove="Localization\**" />
+    <None Remove="Localization\**" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Volo.Abp.Ddd.Domain" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.EntityFrameworkCore" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.Localization" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.Validation" Version="6.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="Models\Kanban\" />
+    <Folder Include="Models\QMS\" />
+    <Folder Include="Models\MES\" />
+    <Folder Include="Models\WMS\" />
+    <Folder Include="Models\DOP\" />
+    <Folder Include="Models\SIM\" />
+  </ItemGroup>
+
+</Project>

+ 15 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/DigitalManufacturingDomainModule.cs

@@ -0,0 +1,15 @@
+using Volo.Abp.Localization;
+using Volo.Abp.Modularity;
+
+namespace Procurement
+{
+    [DependsOn(
+        typeof(AbpLocalizationModule)
+    )]
+    public class DigitalManufacturingDomainModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+        }
+    }
+}

+ 19 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/Enums/Enums.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Procurement.Enums
+{
+    public enum FileType
+    {
+        /// <summary>
+        /// 图片
+        /// </summary>
+        Image,
+
+        /// <summary>
+        /// 文件
+        /// </summary>
+        File
+    }
+}

+ 51 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/Models/FileInfo.cs

@@ -0,0 +1,51 @@
+using Procurement.Enums;
+using System;
+using Volo.Abp;
+using Volo.Abp.Domain.Entities.Auditing;
+using Volo.Abp.MultiTenancy;
+
+namespace Procurement.Models
+{
+    public class FileInfo : AuditedAggregateRoot<Guid>, ISoftDelete, IMultiTenant
+    {
+        public Guid? TenantId { get; set; }
+
+        public string Name { get; set; }
+
+        public string RealName { get; set; }
+
+        /// <summary>
+        /// 后缀
+        /// </summary>
+        public string Suffix { get; set; }
+
+        public string Md5Code { get; set; }
+
+        public string Size { get; set; }
+
+        public string Path { get; set; }
+
+        public string Url { get; set; }
+
+        public FileType Type { get; set; }
+
+        public bool IsDeleted { get; set; }
+
+        protected FileInfo()
+        {
+
+        }
+
+        public FileInfo(Guid id, string name, string realName, string suffix, string md5code, string size, string path, string url, FileType type) : base(id)
+        {
+            Name = name;
+            RealName = realName;
+            Suffix = suffix;
+            Md5Code = md5code;
+            Size = size;
+            Path = path;
+            Url = url;
+            Type = type;
+        }
+    }
+}

+ 31 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Domain/Models/FileManager.cs

@@ -0,0 +1,31 @@
+using Procurement.Enums;
+using System;
+using System.Threading.Tasks;
+using Volo.Abp.Domain.Repositories;
+using Volo.Abp.Domain.Services;
+
+namespace Procurement.Models
+{
+    public class FileManager : DomainService
+    {
+        private readonly IRepository<FileInfo, Guid> _repository;
+
+        public FileManager(IRepository<FileInfo, Guid> repository)
+        {
+            _repository = repository;
+        }
+
+        public async Task<FileInfo> Create(string name, string realName, string suffix, string md5, string size, string path, string url, FileType type)
+        {
+            return await _repository.InsertAsync(new FileInfo(GuidGenerator.Create(),
+                                                                                name,
+                                                                            realName,
+                                                                              suffix,
+                                                                                 md5,
+                                                                                size,
+                                                                                path,
+                                                                                 url,
+                                                                                type));
+        }
+    }
+}

+ 21 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/DigitalManufacturing.EntityFrameworkCore.csproj

@@ -0,0 +1,21 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>Procurement</RootNamespace>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.3">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" Version="6.0.0" />
+	  <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" Version="6.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\DigitalManufacturing.Domain\DigitalManufacturing.Domain.csproj" />
+  </ItemGroup>
+
+</Project>

+ 28 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/EntityFrameworkCore/DigitalManufacturingDbContext.cs

@@ -0,0 +1,28 @@
+using Procurement.Models;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Volo.Abp.Data;
+using Volo.Abp.EntityFrameworkCore;
+
+namespace Procurement.EntityFrameworkCore
+{
+    [ConnectionStringName("Default")]
+    public class DigitalManufacturingDbContext : AbpDbContext<DigitalManufacturingDbContext>
+    {
+        public DbSet<FileInfo> FileInfos { get; set; }
+
+        public DigitalManufacturingDbContext(DbContextOptions<DigitalManufacturingDbContext> options):base(options)
+        {
+
+        }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            base.OnModelCreating(modelBuilder);
+
+            modelBuilder.ConfigureProcurement();
+        }
+    }
+}

+ 33 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/EntityFrameworkCore/DigitalManufacturingDbContextModelCreatingExtensions.cs

@@ -0,0 +1,33 @@
+using Procurement.Models;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Volo.Abp;
+using Volo.Abp.EntityFrameworkCore.Modeling;
+
+namespace Procurement.EntityFrameworkCore
+{
+    public static class DigitalManufacturingDbContextModelCreatingExtensions
+    {
+        public static void ConfigureProcurement(this ModelBuilder builder)
+        {
+            Check.NotNull(builder, nameof(builder));
+
+            builder.Entity<FileInfo>(b =>
+            {
+                b.ToTable("file_info");
+
+                b.ConfigureByConvention();
+
+                b.Property(x => x.Name).IsRequired().HasMaxLength(64);
+                b.Property(x => x.RealName).IsRequired().HasMaxLength(64);
+                b.Property(x => x.Size).IsRequired().HasMaxLength(100);
+                b.Property(x => x.Suffix).IsRequired().HasMaxLength(50);
+                b.Property(x => x.Md5Code).IsRequired().HasMaxLength(256);
+                b.Property(x => x.Path).IsRequired().HasMaxLength(256);
+                b.Property(x => x.Url).IsRequired().HasMaxLength(256);
+            });
+        }
+    }
+}

+ 28 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.EntityFrameworkCore/EntityFrameworkCore/DigitalManufacturingEntityFrameworkCoreModule.cs

@@ -0,0 +1,28 @@
+using Microsoft.Extensions.DependencyInjection;
+using Volo.Abp.EntityFrameworkCore;
+using Volo.Abp.Modularity;
+using Volo.Abp.PermissionManagement.EntityFrameworkCore;
+
+namespace Procurement.EntityFrameworkCore
+{
+    [DependsOn(
+        typeof(DigitalManufacturingDomainModule),
+        typeof(AbpEntityFrameworkCoreModule),
+        typeof(AbpPermissionManagementEntityFrameworkCoreModule)
+    )]
+    public class DigitalManufacturingEntityFrameworkCoreModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+            Configure<AbpDbContextOptions>(options =>
+            {
+                options.UseMySQL();
+            });
+
+            context.Services.AddAbpDbContext<DigitalManufacturingDbContext>(options =>
+            {
+                options.AddDefaultRepositories(includeAllEntities: true);
+            });
+        }
+    }
+}

+ 130 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/DOP/DOPController.cs

@@ -0,0 +1,130 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class DOPController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public DOPController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/feed")]
+        //备料管理
+        public async Task<ActionResult> Feed([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/stock")]
+        //库存管理
+        public async Task<ActionResult> Stock([Required] string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 13 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/HomeController.cs

@@ -0,0 +1,13 @@
+using Microsoft.AspNetCore.Mvc;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace Procurement.Controllers
+{
+    public class HomeController : AbpController
+    {
+        public ActionResult Index()
+        {
+            return Redirect("/swagger");
+        }
+    }
+}

+ 81 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/Kanban/KanbanController.cs

@@ -0,0 +1,81 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class KanbanController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public KanbanController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/kanban/addreport")]
+        //待收货看板
+        //收货通知组织、收货通知日期、收货通知单号、收货申请人、单据类型、供应商编码、供应商名称、已等待收货时间、物料编码、物料名称、规格型号、数量
+        public async Task<ActionResult> Feed([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 81 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/MES/MESController.cs

@@ -0,0 +1,81 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class MESController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public MESController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/mes/addreport")]
+        //待收货看板
+        //收货通知组织、收货通知日期、收货通知单号、收货申请人、单据类型、供应商编码、供应商名称、已等待收货时间、物料编码、物料名称、规格型号、数量
+        public async Task<ActionResult> Feed([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 132 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/QMS/QMSController.cs

@@ -0,0 +1,132 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class QMSController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public QMSController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/qms/materialtracing")]
+        //物料追溯
+        //通过一个物料可以查询到关联物料的使用情况
+        public async Task<ActionResult> MaterialTracing([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/qms/inspection ")]
+        //移动检验
+        //所有检验方案支持移动端检验
+        public async Task<ActionResult> Inspection([Required] string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 130 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/SIM/AndonController.cs

@@ -0,0 +1,130 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class WMSController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public WMSController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/andon/addreport")]
+        //异常提报
+        public async Task<ActionResult> Feed([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/andon/addrule")]
+        //升级规则维护
+        public async Task<ActionResult> Stock([Required] string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 130 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/SIM/SIMController.cs

@@ -0,0 +1,130 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class SIMController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public SIMController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/sim/andon/addreport")]
+        //异常提报
+        public async Task<ActionResult> Feed([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/sim/addrule")]
+        //提出需要支持的事项
+        public async Task<ActionResult> Stock([Required] string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 130 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Controllers/WMS/WMSController.cs

@@ -0,0 +1,130 @@
+using Procurement.Enums;
+using Procurement.Models;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using System;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.AspNetCore.Mvc;
+
+namespace DigitalManufacturing.Controllers
+{
+    public class AndonController : AbpController
+    {
+        private readonly IWebHostEnvironment _hostEnvironment;
+        private readonly FileManager _fileManager;
+
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public AndonController(
+            IWebHostEnvironment hostEnvironment,
+            FileManager fileManager)
+        {
+            _hostEnvironment = hostEnvironment;
+            _fileManager = fileManager;
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/wms/feed")]
+        //备料管理
+        public async Task<ActionResult> Feed([Required]string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+
+        [HttpPost]
+        [Route("api/digitalmanufacturing/wms/stock")]
+        //库存管理
+        public async Task<ActionResult> Stock([Required] string name, IFormFile file)
+        {
+            string uniqueFileName = null;
+
+            if (file != null)
+            {
+                //限制100M
+                if (file.Length > 104857600)
+                {
+                    return new BadRequestObjectResult("上传文件过大");
+                }
+                //文件格式
+                var fileExtension = Path.GetExtension(file.FileName);
+                if (!pictureFormatArray.Contains(fileExtension))
+                {
+                    return new BadRequestObjectResult("上传文件格式错误");
+                }
+
+                var size = "";
+                if (file.Length < 1024)
+                    size = file.Length.ToString() + "B";
+                else if (file.Length >= 1024 && file.Length < 1048576)
+                    size = ((float)file.Length / 1024).ToString("F2") + "KB";
+                else if (file.Length >= 1048576 && file.Length < 104857600)
+                    size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+                else size = file.Length.ToString() + "B";
+
+                string uploadsFolder = Path.Combine(_hostEnvironment.WebRootPath, "Images");
+                if (!Directory.Exists(uploadsFolder))
+                {
+                    Directory.CreateDirectory(uploadsFolder);
+                }
+
+                uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+                string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+                using (var fileStream = new FileStream(filePath, FileMode.Create))
+                {
+                    file.CopyTo(fileStream);
+                    fileStream.Flush();
+                }
+
+                //TODO:文件md5哈希校验
+                await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/Images/" + uniqueFileName, FileType.Image);
+            }
+            return Ok(uniqueFileName);
+        }
+    }
+}

+ 36 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/DigitalManufacturing.Host.csproj

@@ -0,0 +1,36 @@
+<Project Sdk="Microsoft.NET.Sdk.Web">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>Procurement</RootNamespace>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
+    <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="6.0.3" />
+    <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="6.0.5">
+      <PrivateAssets>all</PrivateAssets>
+      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+    </PackageReference>
+    <PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="6.0.3" />
+    <PackageReference Include="Serilog.AspNetCore" Version="5.0.0" />
+    <PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
+    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.3.0" />
+    <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.AspNetCore.Serilog" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.Autofac" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.Caching" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.EntityFrameworkCore.MySQL" Version="6.0.2" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\DigitalManufacturing.Application\DigitalManufacturing.Application.csproj" />
+    <ProjectReference Include="..\DigitalManufacturing.EntityFrameworkCore\DigitalManufacturing.EntityFrameworkCore.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="wwwroot\Images\" />
+  </ItemGroup>
+
+</Project>

+ 11 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/DigitalManufacturing.Host.csproj.user

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
+    <DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ActiveDebugProfile>DigitalManufacturing.Host</ActiveDebugProfile>
+    <NameOfLastUsedPublishProfile>FolderProfile</NameOfLastUsedPublishProfile>
+    <ShowAllFiles>false</ShowAllFiles>
+  </PropertyGroup>
+</Project>

+ 210 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/DigitalManufacturingHostModule.cs

@@ -0,0 +1,210 @@
+using Procurement.EntityFrameworkCore;
+using Microsoft.AspNetCore.Authentication.JwtBearer;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Cors;
+using Microsoft.AspNetCore.DataProtection;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Hosting;
+using Microsoft.OpenApi.Models;
+using StackExchange.Redis;
+using System;
+using System.IO;
+using System.Linq;
+using Volo.Abp;
+using Volo.Abp.AspNetCore.MultiTenancy;
+using Volo.Abp.AspNetCore.Mvc;
+using Volo.Abp.AspNetCore.Serilog;
+using Volo.Abp.Autofac;
+using Volo.Abp.Caching;
+using Volo.Abp.Data;
+using Volo.Abp.EntityFrameworkCore.MySQL;
+using Volo.Abp.Localization;
+using Volo.Abp.Modularity;
+using Volo.Abp.MultiTenancy;
+using Volo.Abp.Threading;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Procurement
+{
+    [DependsOn(
+        typeof(AbpAutofacModule),
+        typeof(AbpEntityFrameworkCoreMySQLModule),
+        typeof(DigitalManufacturingApplicationModule),
+        typeof(DigitalManufacturingEntityFrameworkCoreModule),
+        typeof(AbpAspNetCoreMultiTenancyModule),
+        typeof(AbpAspNetCoreSerilogModule),
+        typeof(AbpAspNetCoreMvcModule)
+    )]
+    public class ProcurementHostModule : AbpModule
+    {
+        private const string DefaultCorsPolicyName = "Default";
+
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+            var configuration = context.Services.GetConfiguration();
+            var hostingEnvironment = context.Services.GetHostingEnvironment();
+
+            ConfigureConventionalControllers();
+            ConfigureMultiTenancy();
+            ConfigureAuthentication(context, configuration);
+            ConfigureLocalization();
+            ConfigureCache(configuration);
+            ConfigureVirtualFileSystem(context);
+            ConfigureCors(context, configuration);
+            //ConfigureRedis(context, configuration, hostingEnvironment);
+            ConfigureSwaggerServices(context);
+        }
+
+        private void ConfigureConventionalControllers()
+        {
+            Configure<AbpAspNetCoreMvcOptions>(options =>
+            {
+                options.ConventionalControllers.Create(typeof(DigitalManufacturingApplicationModule).Assembly, opts =>
+                {
+                    opts.RootPath = "digitalmanufacturing";
+                });
+            });
+        }
+
+        private void ConfigureMultiTenancy()
+        {
+            Configure<AbpMultiTenancyOptions>(options =>
+            {
+                options.IsEnabled = true;
+            });
+        }
+
+        private void ConfigureCache(IConfiguration configuration)
+        {
+            Configure<AbpDistributedCacheOptions>(options =>
+            {
+                options.KeyPrefix = "DigitalManufacturing:";
+            });
+        }
+
+        private void ConfigureCors(ServiceConfigurationContext context, IConfiguration configuration)
+        {
+            context.Services.AddCors(options =>
+            {
+                options.AddPolicy(DefaultCorsPolicyName, builder =>
+                {
+                    builder
+                        .WithOrigins(
+                            configuration["App:CorsOrigins"]
+                                .Split(",", StringSplitOptions.RemoveEmptyEntries)
+                                .Select(o => o.RemovePostFix("/"))
+                                .ToArray()
+                        )
+                        .WithAbpExposedHeaders()
+                        .SetIsOriginAllowedToAllowWildcardSubdomains()
+                        .AllowAnyHeader()
+                        .AllowAnyMethod()
+                        .AllowCredentials();
+                });
+            });
+        }
+
+        private void ConfigureVirtualFileSystem(ServiceConfigurationContext context)
+        {
+            var hostingEnvironment = context.Services.GetHostingEnvironment();
+
+            if (hostingEnvironment.IsDevelopment())
+            {
+                Configure<AbpVirtualFileSystemOptions>(options =>
+                {
+                    options.FileSets.ReplaceEmbeddedByPhysical<DigitalManufacturingDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}DigitalManufacturing.Domain"));
+                    options.FileSets.ReplaceEmbeddedByPhysical<DigitalManufacturingApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}DigitalManufacturing.Application.Contracts"));
+                    options.FileSets.ReplaceEmbeddedByPhysical<DigitalManufacturingApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}DigitalManufacturing.Application"));
+                });
+            }
+        }
+
+        private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration)
+        {
+            context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
+                .AddJwtBearer(options =>
+                {
+                    options.Authority = configuration["AuthServer:Authority"];
+                    options.RequireHttpsMetadata = false;
+                    options.Audience = "BusinessService";
+                });
+        }
+
+        private static void ConfigureSwaggerServices(ServiceConfigurationContext context)
+        {
+            context.Services.AddSwaggerGen(
+                options =>
+                {
+                    options.SwaggerDoc("v1", new OpenApiInfo { Title = "DigitalManufacturing Service API", Version = "v1" });
+                    options.DocInclusionPredicate((docName, description) => true);
+                });
+        }
+
+        private void ConfigureLocalization()
+        {
+            Configure<AbpLocalizationOptions>(options =>
+            {
+                options.Languages.Add(new LanguageInfo("cs", "cs", "Čeština"));
+                options.Languages.Add(new LanguageInfo("en", "en", "English"));
+                options.Languages.Add(new LanguageInfo("pt-BR", "pt-BR", "Português"));
+                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", "繁體中文"));
+            });
+        }
+
+        private void ConfigureRedis(
+            ServiceConfigurationContext context,
+            IConfiguration configuration,
+            IWebHostEnvironment hostingEnvironment)
+        {
+            context.Services.AddStackExchangeRedisCache(options =>
+            {
+                options.Configuration = configuration["Redis:Configuration"];
+            });
+
+            if (!hostingEnvironment.IsDevelopment())
+            {
+                var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]);
+                context.Services
+                    .AddDataProtection()
+                    .PersistKeysToStackExchangeRedis(redis, "DataProtection-Keys");
+            }
+        }
+
+        public override void OnApplicationInitialization(ApplicationInitializationContext context)
+        {
+            var app = context.GetApplicationBuilder();
+
+            app.UseCorrelationId();
+            app.UseStaticFiles();
+            app.UseRouting();
+            app.UseCors(DefaultCorsPolicyName);
+            app.UseAuthentication();
+            app.UseAbpClaimsMap();
+            app.UseMultiTenancy();
+
+            app.UseAbpRequestLocalization();
+            app.UseSwagger();
+            app.UseSwaggerUI(options =>
+            {
+                options.SwaggerEndpoint("/swagger/v1/swagger.json", "DigitalManufacturing Service API");
+            });
+            app.UseAuditing();
+            app.UseAbpSerilogEnrichers();
+            app.UseConfiguredEndpoints();
+
+            AsyncHelper.RunSync(async () =>
+            {
+                using (var scope = context.ServiceProvider.CreateScope())
+                {
+                    await scope.ServiceProvider
+                        .GetRequiredService<IDataSeeder>()
+                        .SeedAsync();
+                }
+            });
+        }
+    }
+}

+ 12 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Dockerfile

@@ -0,0 +1,12 @@
+FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
+WORKDIR /app
+
+WORKDIR /src
+COPY . .
+RUN dotnet restore
+RUN dotnet publish -c Release -o publish
+
+FROM mcr.microsoft.com/dotnet/aspnet:6.0
+WORKDIR /app
+COPY --from=build /src/publish ./
+ENTRYPOINT ["dotnet", "DigitalManufacturing.Host.dll"]

+ 24 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/EntityFrameworkCore/DigitalManufacturingMigrationDbContext.cs

@@ -0,0 +1,24 @@
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Volo.Abp.EntityFrameworkCore;
+
+namespace Procurement.EntityFrameworkCore
+{
+    public class DigitalManufacturingMigrationDbContext : AbpDbContext<DigitalManufacturingMigrationDbContext>
+    {
+        public DigitalManufacturingMigrationDbContext(DbContextOptions<DigitalManufacturingMigrationDbContext> options) : base(options)
+        {
+
+        }
+
+        protected override void OnModelCreating(ModelBuilder modelBuilder)
+        {
+            base.OnModelCreating(modelBuilder);
+
+            modelBuilder.ConfigureProcurement();
+        }
+    }
+}

+ 33 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/EntityFrameworkCore/DigitalManufacturingMigrationDbContextFactory.cs

@@ -0,0 +1,33 @@
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Design;
+using Microsoft.Extensions.Configuration;
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace Procurement.EntityFrameworkCore
+{
+    public class DigitalManufacturingMigrationDbContextFactory : IDesignTimeDbContextFactory<DigitalManufacturingMigrationDbContext>
+    {
+        public DigitalManufacturingMigrationDbContext CreateDbContext(string[] args)
+        {
+            var configuration = BuildConfiguration();
+
+            var builder = new DbContextOptionsBuilder<DigitalManufacturingMigrationDbContext>()
+                .UseMySql(configuration.GetConnectionString("Default"),MySqlServerVersion.LatestSupportedServerVersion);
+
+            return new DigitalManufacturingMigrationDbContext(builder.Options);
+        }
+
+        private static IConfigurationRoot BuildConfiguration()
+        {
+            var builder = new ConfigurationBuilder()
+                .SetBasePath(Directory.GetCurrentDirectory())
+                .AddJsonFile("appsettings.json", optional: false);
+
+            return builder.Build();
+        }
+    }
+}

+ 59 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.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 Procurement
+{
+    public class Program
+    {
+        public static int Main(string[] args)
+        {
+            var configuration = new ConfigurationBuilder()
+                .SetBasePath(Directory.GetCurrentDirectory())
+                .AddJsonFile("appsettings.json")
+                .AddEnvironmentVariables()
+                .Build();
+
+            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"))
+                .WriteTo.Console()
+                .CreateLogger();
+
+            try
+            {
+                Log.Information("Starting Procurement.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)
+                .ConfigureWebHostDefaults(webBuilder =>
+                {
+                    webBuilder.UseStartup<Startup>();
+                })
+                .UseAutofac()
+                .UseSerilog();
+    }
+}

+ 21 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Properties/PublishProfiles/FolderProfile.pubxml

@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
+自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。 
+-->
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <WebPublishMethod>FileSystem</WebPublishMethod>
+    <PublishProvider>FileSystem</PublishProvider>
+    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
+    <LastUsedPlatform>Any CPU</LastUsedPlatform>
+    <SiteUrlToLaunchAfterPublish />
+    <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
+    <ExcludeApp_Data>False</ExcludeApp_Data>
+    <TargetFramework>netcoreapp3.1</TargetFramework>
+    <ProjectGuid>266c12a1-4903-4282-bb37-14a4d0dae706</ProjectGuid>
+    <SelfContained>false</SelfContained>
+    <publishUrl>bin\Release\netcoreapp3.1\publish\</publishUrl>
+    <DeleteExistingFiles>True</DeleteExistingFiles>
+  </PropertyGroup>
+</Project>

+ 11 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Properties/PublishProfiles/FolderProfile.pubxml.user

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+此文件由 Web 项目的发布/打包过程使用。可以通过编辑此 MSBuild 文件
+自定义此过程的行为。为了解与此相关的更多内容,请访问 https://go.microsoft.com/fwlink/?LinkID=208121。 
+-->
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <TimeStampOfAssociatedLegacyPublishXmlFile />
+    <_PublishTargetUrl>D:\Code\ABP-MicroService\MicroServices\FileSystem\FileSystem.Host\bin\Release\netcoreapp3.1\publish\</_PublishTargetUrl>
+  </PropertyGroup>
+</Project>

+ 27 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Properties/launchSettings.json

@@ -0,0 +1,27 @@
+{
+  "iisSettings": {
+    "windowsAuthentication": false, 
+    "anonymousAuthentication": true, 
+    "iisExpress": {
+      "applicationUrl": "http://localhost:59958",
+      "sslPort": 44340
+    }
+  },
+  "profiles": {
+    "IIS Express": {
+      "commandName": "IISExpress",
+      "launchBrowser": true,
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    },
+    "DigitalManufacturing.Host": {
+      "commandName": "Project",
+      "launchBrowser": true,
+      "applicationUrl": "http://localhost:59958",
+      "environmentVariables": {
+        "ASPNETCORE_ENVIRONMENT": "Development"
+      }
+    }
+  }
+}

+ 20 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/Startup.cs

@@ -0,0 +1,20 @@
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+
+namespace Procurement
+{
+    public class Startup
+    {
+        public void ConfigureServices(IServiceCollection services)
+        {
+            services.AddApplication<ProcurementHostModule>();
+        }
+
+        public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory)
+        {
+            app.InitializeApplication();
+        }
+    }
+}

+ 9 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/appsettings.Development.json

@@ -0,0 +1,9 @@
+{
+  "Logging": {
+    "LogLevel": {
+      "Default": "Information",
+      "Microsoft": "Warning",
+      "Microsoft.Hosting.Lifetime": "Information"
+    }
+  }
+}

+ 14 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/appsettings.json

@@ -0,0 +1,14 @@
+{
+  "App": {
+    "CorsOrigins": "http://localhost:9527"
+  },
+  "ConnectionStrings": {
+    "Default": "Server=123.60.180.165;Database=dopbiz;Uid=root; Pwd=5heng=uN;Allow User Variables=True;sslMode=None;"
+  },
+  "Redis": {
+    "Configuration": "192.168.1.191"
+  },
+  "AuthServer": {
+    "Authority": "http://localhost:53362"
+  }
+}

BIN
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/wwwroot/Images/479921a2-f7db-41a0-9b07-e5c9ecda3bfa.png


BIN
MicroServices/DigitalManufacturing/DigitalManufacturing.Host/wwwroot/Images/78f6d650-dcc2-4f53-9251-4264ec9a20f2.png


+ 49 - 0
MicroServices/DigitalManufacturing/DigitalManufacturing.sln

@@ -0,0 +1,49 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.4.33205.214
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalManufacturing.Host", "DigitalManufacturing.Host\DigitalManufacturing.Host.csproj", "{266C12A1-4903-4282-BB37-14A4D0DAE706}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalManufacturing.Domain", "DigitalManufacturing.Domain\DigitalManufacturing.Domain.csproj", "{E6FDAA00-9410-43B7-84A1-F4624328C7D7}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalManufacturing.Application.Contracts", "DigitalManufacturing.Application.Contracts\DigitalManufacturing.Application.Contracts.csproj", "{3AAD41A3-449F-41F0-9260-A6781C97B0C6}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalManufacturing.Application", "DigitalManufacturing.Application\DigitalManufacturing.Application.csproj", "{542D366D-9BE5-473E-966A-6F324972558E}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DigitalManufacturing.EntityFrameworkCore", "DigitalManufacturing.EntityFrameworkCore\DigitalManufacturing.EntityFrameworkCore.csproj", "{1938B13A-4806-487A-A374-1C66D750F133}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{266C12A1-4903-4282-BB37-14A4D0DAE706}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{266C12A1-4903-4282-BB37-14A4D0DAE706}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{266C12A1-4903-4282-BB37-14A4D0DAE706}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{266C12A1-4903-4282-BB37-14A4D0DAE706}.Release|Any CPU.Build.0 = Release|Any CPU
+		{E6FDAA00-9410-43B7-84A1-F4624328C7D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{E6FDAA00-9410-43B7-84A1-F4624328C7D7}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{E6FDAA00-9410-43B7-84A1-F4624328C7D7}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{E6FDAA00-9410-43B7-84A1-F4624328C7D7}.Release|Any CPU.Build.0 = Release|Any CPU
+		{3AAD41A3-449F-41F0-9260-A6781C97B0C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{3AAD41A3-449F-41F0-9260-A6781C97B0C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{3AAD41A3-449F-41F0-9260-A6781C97B0C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{3AAD41A3-449F-41F0-9260-A6781C97B0C6}.Release|Any CPU.Build.0 = Release|Any CPU
+		{542D366D-9BE5-473E-966A-6F324972558E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{542D366D-9BE5-473E-966A-6F324972558E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{542D366D-9BE5-473E-966A-6F324972558E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{542D366D-9BE5-473E-966A-6F324972558E}.Release|Any CPU.Build.0 = Release|Any CPU
+		{1938B13A-4806-487A-A374-1C66D750F133}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{1938B13A-4806-487A-A374-1C66D750F133}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{1938B13A-4806-487A-A374-1C66D750F133}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{1938B13A-4806-487A-A374-1C66D750F133}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {CAAF5A4A-B83D-4CCD-BF50-58035AD87837}
+	EndGlobalSection
+EndGlobal

+ 13 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/cs.json

@@ -0,0 +1,13 @@
+{
+  "culture": "cs",
+  "texts": {
+    "Menu:Home": "Úvod",
+    "Welcome": "Vítejte",
+    "LongWelcomeMessage": "Vítejte v aplikaci. Toto je startovací projekt založený na ABP frameworku. Pro více informací, navštivte abp.io.",
+    "Edit": "修改",
+    "Delete": "删除",
+    "Create": "新增",
+    "Business": "业务",
+    "DataDictionary": "数据字典"
+  }
+}

+ 8 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/en.json

@@ -0,0 +1,8 @@
+{
+  "culture": "en",
+  "texts": {
+    "Menu:Home": "Home",
+    "Welcome": "Welcome",
+    "LongWelcomeMessage": "Welcome to the application. This is a startup project based on the ABP framework. For more information, visit abp.io."
+  }
+}

+ 8 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/pl.json

@@ -0,0 +1,8 @@
+{
+  "culture": "pl",
+  "texts": {
+    "Menu:Home": "Home",
+    "Welcome": "Witaj",
+    "LongWelcomeMessage": "Witaj w aplikacji. To jest inicjalny projekt bazujący na ABP framework. Po więcej informacji odwiedź stronę abp.io."
+  }
+}

+ 8 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/pt-BR.json

@@ -0,0 +1,8 @@
+{
+  "culture": "pt-BR",
+  "texts": {
+    "Menu:Home": "Principal",
+    "Welcome": "Seja bem-vindo!",
+    "LongWelcomeMessage": "Bem-vindo a esta aplicação. Este é um projeto inicial baseado no ABP framework. Para mais informações, visite abp.io."
+  }
+}

+ 8 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/tr.json

@@ -0,0 +1,8 @@
+{
+  "culture": "tr",
+  "texts": {
+    "Menu:Home": "Ana sayfa",
+    "Welcome": "Hoşgeldiniz",
+    "LongWelcomeMessage": "Uygulamaya hoşgeldiniz. Bu, ABP framework'ü üzerine bina edilmiş bir başlangıç projesidir. Daha fazla bilgi için abp.io adresini ziyaret edebilirsiniz."
+  }
+}

+ 8 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/vi.json

@@ -0,0 +1,8 @@
+{
+  "culture": "vi",
+  "texts": {
+    "Menu:Home": "Trang chủ",
+    "Welcome": "Chào mừng bạn",
+    "LongWelcomeMessage": "Chào mừng bạn đến ứng dụng. Đây là một dự án khởi nghiệp dựa trên khung ABP. Để biết thêm thông tin, hãy truy cập abp.io."
+  }
+}

+ 13 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/zh-Hans.json

@@ -0,0 +1,13 @@
+{
+  "culture": "zh-Hans",
+  "texts": {
+    "Menu:Home": "首页",
+    "Welcome": "欢迎",
+    "LongWelcomeMessage": "欢迎来到该应用程序. 这是一个基于ABP框架的启动项目. 有关更多信息, 请访问 abp.io.",
+    "Edit": "修改",
+    "Delete": "删除",
+    "Create": "新增",
+    "StorageManagement": "存储服务",
+    "File": "存储管理"
+  }
+}

+ 8 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/Procurement/zh-Hant.json

@@ -0,0 +1,8 @@
+{
+    "culture": "zh-Hant",
+    "texts": {
+      "Menu:Home": "首頁",
+      "Welcome": "歡迎",
+      "LongWelcomeMessage": "歡迎來到此應用程式. 這是一個基於ABP框架的起始專案. 有關更多訊息, 請瀏覽 abp.io."
+    }
+  }

+ 9 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Localization/ProcurementResource.cs

@@ -0,0 +1,9 @@
+using Volo.Abp.Localization;
+
+namespace Business.Localization
+{
+    [LocalizationResourceName("Procurement")]
+    public class ProcurementResource
+    {
+    }
+}

+ 28 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Permissions/ProcurementPermissionDefinitionProvider.cs

@@ -0,0 +1,28 @@
+using Business.Localization;
+using Volo.Abp.Authorization.Permissions;
+using Volo.Abp.Localization;
+using Volo.Abp.MultiTenancy;
+
+namespace Procurement.Permissions
+{
+    public class ProcurementPermissionDefinitionProvider: PermissionDefinitionProvider
+    {
+
+        public override void Define(IPermissionDefinitionContext context)
+        {
+            var storage = context.AddGroup(ProcurementPermissions.ProcurementManagement, L("StorageManagement"));
+
+            var file = storage.AddPermission(ProcurementPermissions.File.Default, L("File"));
+            file.AddChild(ProcurementPermissions.File.Update, L("Edit"));
+            file.AddChild(ProcurementPermissions.File.Delete, L("Delete"));
+            file.AddChild(ProcurementPermissions.File.Create, L("Create"));
+
+            //Code generation...
+        }
+
+        private static LocalizableString L(string name)
+        {
+            return LocalizableString.Create<ProcurementResource>(name);
+        }
+    }
+}

+ 17 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Permissions/ProcurementPermissions.cs

@@ -0,0 +1,17 @@
+namespace Procurement.Permissions
+{
+    public static class ProcurementPermissions
+    {
+        public const string ProcurementManagement = "ProcurementManagement";
+
+        public static class File
+        {
+            public const string Default = ProcurementManagement + ".File";
+            public const string Delete = Default + ".Delete";
+            public const string Update = Default + ".Update";
+            public const string Create = Default + ".Create";
+        }
+
+        //Code generation...
+    }
+}

+ 49 - 0
MicroServices/Procurement/Procurement.Application.Contracts/Procurement.Application.Contracts.csproj

@@ -0,0 +1,49 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>Procurement</RootNamespace>
+    <GeneratePackageOnBuild>True</GeneratePackageOnBuild>
+    <PackageId>XCZ.Procurement.Application.Contracts</PackageId>
+    <Version>0.1.1</Version>
+    <Authors>XCZ</Authors>
+    <Product>Procurement</Product>
+    <Description>Procurement服务Application.Contracts远程依赖</Description>
+    <PackageProjectUrl>https://github.com/WilliamXu96/ABP-MicroService</PackageProjectUrl>
+    <RepositoryUrl>https://github.com/WilliamXu96/ABP-MicroService</RepositoryUrl>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <None Remove="Localization\Procurement\cs.json" />
+    <None Remove="Localization\Procurement\en.json" />
+    <None Remove="Localization\Procurement\pl.json" />
+    <None Remove="Localization\Procurement\pt-BR.json" />
+    <None Remove="Localization\Procurement\tr.json" />
+    <None Remove="Localization\Procurement\vi.json" />
+    <None Remove="Localization\Procurement\zh-Hans.json" />
+    <None Remove="Localization\Procurement\zh-Hant.json" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <EmbeddedResource Include="Localization\Procurement\cs.json" />
+    <EmbeddedResource Include="Localization\Procurement\en.json" />
+    <EmbeddedResource Include="Localization\Procurement\pl.json" />
+    <EmbeddedResource Include="Localization\Procurement\pt-BR.json" />
+    <EmbeddedResource Include="Localization\Procurement\tr.json" />
+    <EmbeddedResource Include="Localization\Procurement\vi.json" />
+    <EmbeddedResource Include="Localization\Procurement\zh-Hans.json" />
+    <EmbeddedResource Include="Localization\Procurement\zh-Hant.json" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Microsoft.AspNetCore.Http.Features" Version="5.0.17" />
+    <PackageReference Include="Volo.Abp.Ddd.Application" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.PermissionManagement.Application.Contracts" Version="6.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="ProcurementManagement\WMS\" />
+    <Folder Include="ProcurementManagement\SRM\" />
+  </ItemGroup>
+
+</Project>

+ 34 - 0
MicroServices/Procurement/Procurement.Application.Contracts/ProcurementApplicationContractsModule.cs

@@ -0,0 +1,34 @@
+using Business.Localization;
+using Volo.Abp.Application;
+using Volo.Abp.Localization;
+using Volo.Abp.Modularity;
+using Volo.Abp.PermissionManagement;
+using Volo.Abp.Validation.Localization;
+using Volo.Abp.VirtualFileSystem;
+
+namespace Procurement
+{
+    [DependsOn(
+       typeof(AbpLocalizationModule),
+        typeof(AbpDddApplicationModule),
+        typeof(AbpPermissionManagementApplicationContractsModule)
+    )]
+    public class ProcurementApplicationContractsModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+            Configure<AbpVirtualFileSystemOptions>(options =>
+            {
+                options.FileSets.AddEmbedded<ProcurementApplicationContractsModule>("Procurement");
+            });
+
+            Configure<AbpLocalizationOptions>(options =>
+            {
+                options.Resources
+                    .Add<ProcurementResource>("zh-Hans")
+                    .AddBaseTypes(typeof(AbpValidationResource))
+                    .AddVirtualJson("/Localization/Storage");
+            });
+        }
+    }
+}

+ 22 - 0
MicroServices/Procurement/Procurement.Application.Contracts/ProcurementManagement/Dto/FileInfoDto.cs

@@ -0,0 +1,22 @@
+using System;
+using Volo.Abp.Application.Dtos;
+
+namespace Procurement.FileManagement.Dto
+{
+    public class FileInfoDto : EntityDto<Guid>
+    {
+        public string Name { get; set; }
+
+        public string RealName { get; set; }
+
+        public string Suffix { get; set; }
+
+        public string Size { get; set; }
+
+        public string Url { get; set; }
+
+        public int Type { get; set; }
+
+        public DateTime CreationTime { get; set; }
+    }
+}

+ 9 - 0
MicroServices/Procurement/Procurement.Application.Contracts/ProcurementManagement/Dto/GetFileInputDto.cs

@@ -0,0 +1,9 @@
+using Volo.Abp.Application.Dtos;
+
+namespace Procurement.FileManagement.Dto
+{
+    public class GetFileInputDto : PagedAndSortedResultRequestDto
+    {
+        public string Filter { get; set; }
+    }
+}

+ 18 - 0
MicroServices/Procurement/Procurement.Application.Contracts/ProcurementManagement/IProcurementAppService.cs

@@ -0,0 +1,18 @@
+using Procurement.FileManagement.Dto;
+using Microsoft.AspNetCore.Http;
+using System.ComponentModel.DataAnnotations;
+using System.Threading.Tasks;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+
+namespace Procurement.FileManagement
+{
+    public interface IProcurementAppService : IApplicationService
+    {
+        Task<PagedResultDto<FileInfoDto>> GetAll(GetFileInputDto input);
+
+        Task<FileInfoDto> Upload([Required] string name, [Required] IFormFile file);
+
+        Task UploadPrivate([Required] string name, [Required] IFormFile file);
+    }
+}

+ 23 - 0
MicroServices/Procurement/Procurement.Application/Procurement.Application.csproj

@@ -0,0 +1,23 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+  <PropertyGroup>
+    <TargetFramework>net6.0</TargetFramework>
+    <RootNamespace>Procurement</RootNamespace>
+  </PropertyGroup>
+
+  <ItemGroup>
+    <PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="6.0.0" />
+    <PackageReference Include="Volo.Abp.AutoMapper" Version="6.0.0" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <ProjectReference Include="..\Procurement.Application.Contracts\Procurement.Application.Contracts.csproj" />
+    <ProjectReference Include="..\Procurement.Domain\Procurement.Domain.csproj" />
+  </ItemGroup>
+
+  <ItemGroup>
+    <Folder Include="ProcurementManagement\WMS\" />
+    <Folder Include="ProcurementManagement\SRM\" />
+  </ItemGroup>
+
+</Project>

+ 14 - 0
MicroServices/Procurement/Procurement.Application/ProcurementApplicationAutoMapperProfile.cs

@@ -0,0 +1,14 @@
+using AutoMapper;
+using Procurement.FileManagement.Dto;
+using Procurement.Models;
+
+namespace Procurement
+{
+    public class ProcurementApplicationAutoMapperProfile : Profile
+    {
+        public ProcurementApplicationAutoMapperProfile()
+        {
+            CreateMap<FileInfo, FileInfoDto>();
+        }
+    }
+}

+ 21 - 0
MicroServices/Procurement/Procurement.Application/ProcurementApplicationModule.cs

@@ -0,0 +1,21 @@
+using Volo.Abp.AutoMapper;
+using Volo.Abp.Modularity;
+
+namespace Procurement
+{
+    [DependsOn(
+        typeof(ProcurementDomainModule),
+        typeof(ProcurementApplicationContractsModule),
+        typeof(AbpAutoMapperModule)
+    )]
+    public class ProcurementApplicationModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+            Configure<AbpAutoMapperOptions>(options =>
+            {
+                options.AddMaps<ProcurementApplicationModule>();
+            });
+        }
+    }
+}

+ 129 - 0
MicroServices/Procurement/Procurement.Application/ProcurementManagement/ProcurementAppService.cs

@@ -0,0 +1,129 @@
+using Procurement.Enums;
+using Procurement.FileManagement.Dto;
+using Procurement.Models;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
+using System;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+using System.IO;
+using System.Linq;
+using System.Linq.Dynamic.Core;
+using System.Threading.Tasks;
+using Volo.Abp;
+using Volo.Abp.Application.Dtos;
+using Volo.Abp.Application.Services;
+using Volo.Abp.Domain.Repositories;
+using FileInfo = Procurement.Models.FileInfo;
+
+namespace Procurement.FileManagement
+{
+    public class ProcurementAppService : ApplicationService, IProcurementAppService
+    {
+        private readonly IRepository<FileInfo, Guid> _repository;
+        private readonly FileManager _fileManager;
+        string[] pictureFormatArray = { ".png", ".jpg", ".jpeg", ".gif", ".PNG", ".JPG", ".JPEG", ".GIF" };
+
+        public ProcurementAppService(IRepository<FileInfo, Guid> repository, FileManager fileManager)
+        {
+            _repository = repository;
+            _fileManager = fileManager;
+        }
+
+        public async Task<PagedResultDto<FileInfoDto>> GetAll(GetFileInputDto input)
+        {
+            var query = (await _repository.GetQueryableAsync()).WhereIf(!string.IsNullOrWhiteSpace(input.Filter), _ => _.Name.Contains(input.Filter));
+
+            var totalCount = await query.CountAsync();
+            var items = await query.OrderBy(input.Sorting ?? "Name")
+                                   .Skip(input.SkipCount)
+                                   .Take(input.MaxResultCount)
+                                   .ToListAsync();
+
+            var dtos = ObjectMapper.Map<List<FileInfo>, List<FileInfoDto>>(items);
+            return new PagedResultDto<FileInfoDto>(totalCount, dtos);
+        }
+
+        public async Task<FileInfoDto> Upload([Required] string name, [Required] IFormFile file)
+        {
+            if (file == null || file.Length == 0) throw new BusinessException("无法上传空文件");
+
+            //限制100M
+            if (file.Length > 104857600)
+            {
+                throw new BusinessException("上传文件过大");
+            }
+            //文件格式
+            var fileExtension = Path.GetExtension(file.FileName);
+            if (!pictureFormatArray.Contains(fileExtension))
+            {
+                throw new BusinessException("上传文件格式错误");
+            }
+
+            var size = "";
+            if (file.Length < 1024)
+                size = file.Length.ToString() + "B";
+            else if (file.Length >= 1024 && file.Length < 1048576)
+                size = ((float)file.Length / 1024).ToString("F2") + "KB";
+            else if (file.Length >= 1048576 && file.Length < 104857600)
+                size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+            else size = file.Length.ToString() + "B";
+
+            string uploadsFolder = Path.Combine(Environment.CurrentDirectory, "wwwroot", "files");
+            if (!Directory.Exists(uploadsFolder))
+            {
+                Directory.CreateDirectory(uploadsFolder);
+            }
+
+            var uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+            string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+            using (var fileStream = new FileStream(filePath, FileMode.Create))
+            {
+                file.CopyTo(fileStream);
+                fileStream.Flush();
+            }
+
+            //TODO:文件md5哈希校验
+            var result = await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/files/" + uniqueFileName, FileType.Image);
+            return ObjectMapper.Map<FileInfo, FileInfoDto>(result);
+        }
+
+        public async Task UploadPrivate([Required] string name, [Required] IFormFile file)
+        {
+            if (file == null || file.Length == 0) throw new BusinessException("无法上传空文件");
+            if (file.Length > 104857600) throw new BusinessException("上传文件过大");
+            var fileExtension = Path.GetExtension(file.FileName);
+            if (!pictureFormatArray.Contains(fileExtension)) throw new BusinessException("上传文件格式错误");
+
+            var size = "";
+            if (file.Length < 1024)
+                size = file.Length.ToString() + "B";
+            else if (file.Length >= 1024 && file.Length < 1048576)
+                size = ((float)file.Length / 1024).ToString("F2") + "KB";
+            else if (file.Length >= 1048576 && file.Length < 104857600)
+                size = ((float)file.Length / 1024 / 1024).ToString("F2") + "MB";
+            else size = file.Length.ToString() + "B";
+
+            string uploadsFolder = Path.Combine(Environment.CurrentDirectory, "files");
+            if (!Directory.Exists(uploadsFolder)) Directory.CreateDirectory(uploadsFolder);
+
+            var uniqueFileName = Guid.NewGuid().ToString() + fileExtension;
+            string filePath = Path.Combine(uploadsFolder, uniqueFileName);
+            using (var fileStream = new FileStream(filePath, FileMode.Create))
+            {
+                file.CopyTo(fileStream);
+                fileStream.Flush();
+            }
+
+            await _fileManager.Create(name, uniqueFileName, fileExtension, "", size, filePath, "/files/" + uniqueFileName, FileType.Image);
+        }
+
+        public dynamic Download([Required] string name)
+        {
+            var filePath = Path.Combine(Environment.CurrentDirectory, "files", name);
+            if (!File.Exists(filePath)) throw new BusinessException("找不到文件");
+            return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = name };
+        }
+    }
+}

+ 19 - 0
MicroServices/Procurement/Procurement.Domain/Enums/Enums.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Procurement.Enums
+{
+    public enum FileType
+    {
+        /// <summary>
+        /// 图片
+        /// </summary>
+        Image,
+
+        /// <summary>
+        /// 文件
+        /// </summary>
+        File
+    }
+}

+ 15 - 0
MicroServices/Procurement/Procurement.Domain/FileStorageDomainModule.cs

@@ -0,0 +1,15 @@
+using Volo.Abp.Localization;
+using Volo.Abp.Modularity;
+
+namespace Procurement
+{
+    [DependsOn(
+        typeof(AbpLocalizationModule)
+    )]
+    public class ProcurementDomainModule : AbpModule
+    {
+        public override void ConfigureServices(ServiceConfigurationContext context)
+        {
+        }
+    }
+}

+ 51 - 0
MicroServices/Procurement/Procurement.Domain/Models/FileInfo.cs

@@ -0,0 +1,51 @@
+using Procurement.Enums;
+using System;
+using Volo.Abp;
+using Volo.Abp.Domain.Entities.Auditing;
+using Volo.Abp.MultiTenancy;
+
+namespace Procurement.Models
+{
+    public class FileInfo : AuditedAggregateRoot<Guid>, ISoftDelete, IMultiTenant
+    {
+        public Guid? TenantId { get; set; }
+
+        public string Name { get; set; }
+
+        public string RealName { get; set; }
+
+        /// <summary>
+        /// 后缀
+        /// </summary>
+        public string Suffix { get; set; }
+
+        public string Md5Code { get; set; }
+
+        public string Size { get; set; }
+
+        public string Path { get; set; }
+
+        public string Url { get; set; }
+
+        public FileType Type { get; set; }
+
+        public bool IsDeleted { get; set; }
+
+        protected FileInfo()
+        {
+
+        }
+
+        public FileInfo(Guid id, string name, string realName, string suffix, string md5code, string size, string path, string url, FileType type) : base(id)
+        {
+            Name = name;
+            RealName = realName;
+            Suffix = suffix;
+            Md5Code = md5code;
+            Size = size;
+            Path = path;
+            Url = url;
+            Type = type;
+        }
+    }
+}

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