Pārlūkot izejas kodu

商邀AI 基础数据接口新增 行业、规模 等基础数据

Lyyyi 1 nedēļu atpakaļ
vecāks
revīzija
aef0edb6bc

+ 5 - 3
OASystem/OASystem.Api/Controllers/ResourceController.cs

@@ -2293,16 +2293,18 @@ Inner Join Sys_Department as d With(Nolock) On u.DepId=d.Id Where m.Id={0} ", _m
         public async Task<IActionResult> InvitationAIInit()
         {
             var itemNames = await GeneralMethod.InvitationAIInvName();
-
             var unitNames = await GeneralMethod.InvitationAIClientName();
-
             var countries = await GeneralMethod.InvitationAICountryName();
+            var industryNodes = IndustryNode.BuildInitialData().Select(x => x.NameCn).ToList();
+            var orgScales = OrgScale.BuildInitialData().Select(x => x.Name).ToList();
 
             return Ok(JsonView(true, $"查询成功!", new
             {
                 itemNames,
                 unitNames,
-                countries
+                countries,
+                industryNodes,
+                orgScales
             }));
         }
 

+ 8 - 8
OASystem/OASystem.Domain/Entities/Resource/Res_InvitationAI.cs

@@ -338,24 +338,24 @@ namespace OASystem.Domain.Entities.Resource
     /// </summary>
     public class OrgScale
     {
-        public string Label { get; init; }
+        public string Name { get; init; }
         public int MinStaff { get; init; }
         public int MaxStaff { get; init; }
 
-        public static List<OrgScale> GetScales() => new()
+        public static List<OrgScale> BuildInitialData() => new()
         {
-            new() { Label = "微型 (1-10人)", MinStaff = 1, MaxStaff = 10 },
-            new() { Label = "小型 (11-50人)", MinStaff = 11, MaxStaff = 50 },
-            new() { Label = "中型 (51-200人)", MinStaff = 51, MaxStaff = 200 },
-            new() { Label = "大型 (201-1000人)", MinStaff = 201, MaxStaff = 1000 },
-            new() { Label = "超大型 (1000人以上)", MinStaff = 1001, MaxStaff = int.MaxValue }
+            new() { Name = "微型 (1-10人)", MinStaff = 1, MaxStaff = 10 },
+            new() { Name = "小型 (11-50人)", MinStaff = 11, MaxStaff = 50 },
+            new() { Name = "中型 (51-200人)", MinStaff = 51, MaxStaff = 200 },
+            new() { Name = "大型 (201-1000人)", MinStaff = 201, MaxStaff = 1000 },
+            new() { Name = "超大型 (1000人以上)", MinStaff = 1001, MaxStaff = int.MaxValue }
         };
 
         /// <summary>
         /// 根据人数自动匹配规模标签
         /// </summary>
         public static string GetLabel(int count) =>
-            GetScales().FirstOrDefault(s => count >= s.MinStaff && count <= s.MaxStaff)?.Label ?? "未知规模";
+            BuildInitialData().FirstOrDefault(s => count >= s.MinStaff && count <= s.MaxStaff)?.Label ?? "未知规模";
     }
 
     #endregion