|
@@ -27,14 +27,16 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
private readonly ISystemSettingCacheManager _sysSetting;
|
|
private readonly ISystemSettingCacheManager _sysSetting;
|
|
private readonly IIndustryCaseRepository _industryCaseRepository;
|
|
private readonly IIndustryCaseRepository _industryCaseRepository;
|
|
private readonly ISnapshotSMSTemplateRepository _snapshotSMSTemplateRepository;
|
|
private readonly ISnapshotSMSTemplateRepository _snapshotSMSTemplateRepository;
|
|
|
|
+ private readonly IPractitionerRepository _practitionerRepository;
|
|
|
|
|
|
- public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository, ISnapshotSMSTemplateRepository snapshotSMSTemplateRepository)
|
|
|
|
|
|
+ public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository, ISnapshotSMSTemplateRepository snapshotSMSTemplateRepository, IPractitionerRepository practitionerRepository)
|
|
{
|
|
{
|
|
_industryRepository = industryRepository;
|
|
_industryRepository = industryRepository;
|
|
_fileRepository = fileRepository;
|
|
_fileRepository = fileRepository;
|
|
_sysSetting = sysSetting;
|
|
_sysSetting = sysSetting;
|
|
_industryCaseRepository = industryCaseRepository;
|
|
_industryCaseRepository = industryCaseRepository;
|
|
_snapshotSMSTemplateRepository = snapshotSMSTemplateRepository;
|
|
_snapshotSMSTemplateRepository = snapshotSMSTemplateRepository;
|
|
|
|
+ _practitionerRepository = practitionerRepository;
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 新增行业
|
|
/// 新增行业
|
|
@@ -198,5 +200,50 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
dto.Adapt(entity);
|
|
dto.Adapt(entity);
|
|
await _snapshotSMSTemplateRepository.UpdateAsync(entity);
|
|
await _snapshotSMSTemplateRepository.UpdateAsync(entity);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 区域从业人员
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 区域从业人员集合
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ /// <exception cref="NotImplementedException"></exception>
|
|
|
|
+ public ISugarQueryable<PractitionerItemsOutDto> GetPractitionerItemsAsync(PractitionerItemsInDto dto)
|
|
|
|
+ {
|
|
|
|
+ var query = _practitionerRepository.Queryable()
|
|
|
|
+ .WhereIF(dto.Name.NotNullOrEmpty(), m => m.Name.Contains(dto.Name!))
|
|
|
|
+ .WhereIF(dto.SystemAreaName.NotNullOrEmpty(), m => m.SystemAreaName.Contains(dto.SystemAreaName!))
|
|
|
|
+ .WhereIF(dto.PhoneNumber.NotNullOrEmpty(), m => m.PhoneNumber.Contains(dto.PhoneNumber!))
|
|
|
|
+ .Select<PractitionerItemsOutDto>();
|
|
|
|
+
|
|
|
|
+ return query;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 添加区域从业人员
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task<string> AddPractitionerAsync(AddBatchPractitionerInDto dto)
|
|
|
|
+ {
|
|
|
|
+ dto.ValidateObject();
|
|
|
|
+ var entity = dto.Adapt<Practitioner>();
|
|
|
|
+ return await _practitionerRepository.AddAsync(entity);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 删除区域从业人员
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="id"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task DeletePractitionerAsync(string id)
|
|
|
|
+ {
|
|
|
|
+ var entity = await _practitionerRepository.GetAsync(id)
|
|
|
|
+ ?? throw UserFriendlyException.SameMessage($"区域从业人员不存在 {id}");
|
|
|
|
+ entity.IsDeleted = true;
|
|
|
|
+ await _practitionerRepository.UpdateAsync(entity);
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|