|
@@ -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
|
|
|
}
|