Parcourir la source

添加从业人员基础数据

qinchaoyue il y a 4 mois
Parent
commit
8ffb350293

+ 23 - 1
src/Hotline.Api/Controllers/Snapshot/IndustryController.cs

@@ -1,13 +1,16 @@
 using Amazon.Runtime.Internal.Transform;
 using Hotline.Application.Snapshot;
 using Hotline.Caching.Interfaces;
+using Hotline.Configurations;
 using Hotline.Repository.SqlSugar.Extensions;
+using Hotline.Settings;
 using Hotline.Share.Dtos;
 using Hotline.Share.Dtos.Snapshot;
 using Hotline.Share.Tools;
 using Hotline.Snapshot;
 using Hotline.Snapshot.Interfaces;
 using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
 
 namespace Hotline.Api.Controllers.Snapshot;
 
@@ -19,12 +22,16 @@ public class IndustryController : BaseController
     private readonly IIndustryRepository _industryRepository;
     private readonly ISystemDicDataCacheManager _systemDicDataCacheManager;
     private readonly IIndustryApplication _industryApplication;
+    private readonly ISystemAreaDomainService _systemAreaDomainService;
+    private readonly IOptionsSnapshot<AppConfiguration> _appOptions;
 
-    public IndustryController(IIndustryRepository industryRepository, IIndustryApplication industryApplication, ISystemDicDataCacheManager systemDicDataCacheManager)
+    public IndustryController(IIndustryRepository industryRepository, IIndustryApplication industryApplication, ISystemDicDataCacheManager systemDicDataCacheManager, ISystemAreaDomainService systemAreaDomainService, IOptionsSnapshot<AppConfiguration> appOptions)
     {
         _industryRepository = industryRepository;
         _industryApplication = industryApplication;
         _systemDicDataCacheManager = systemDicDataCacheManager;
+        _systemAreaDomainService = systemAreaDomainService;
+        _appOptions = appOptions;
     }
 
     /// <summary>
@@ -203,5 +210,20 @@ public class IndustryController : BaseController
     [HttpDelete("practitioner/{id}")]
     public async Task<PractitionerItemsOutDto> GetPractitionerAsync(string id)
         => await _industryApplication.GetPractitionerAsync(id);
+
+    /// <summary>
+    /// 添加从业人员基础数据
+    /// </summary>
+    /// <returns></returns>
+    [HttpGet("practitioner/basedata")]
+    public async Task<Dictionary<string, object>> GetPractitionerDataBaseAsync()
+    {
+        var parentId = "";
+        if (_appOptions.Value.IsZiGong) parentId = _appOptions.Value.ZiGong.AreaCode;
+        return new Dictionary<string, object>
+        {
+            { "area", await _systemAreaDomainService.GetAreaTree(parentId: parentId)}
+        };
+    }
     #endregion
 }

+ 1 - 1
src/Hotline.Api/config/appsettings.Development.json

@@ -1,7 +1,7 @@
 {
   "AllowedHosts": "*",
   "AppConfiguration": {
-    "AppScope": "YiBin",
+    "AppScope": "ZiGong",
     "YiBin": {
       "AreaCode": "511500",
       "CallCenterType": "TianRun", //XunShi、WeiErXin、TianRun、XingTang

+ 0 - 1
src/Hotline.Application/Snapshot/IndustryApplication.cs

@@ -256,7 +256,6 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
         return (await _practitionerRepository.GetAsync(id)).Adapt<PractitionerItemsOutDto>();
     }
 
-
     /// <summary>
     /// 删除区域从业人员
     /// </summary>