|
@@ -26,13 +26,15 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
|
private readonly IFileRepository _fileRepository;
|
|
|
private readonly ISystemSettingCacheManager _sysSetting;
|
|
|
private readonly IIndustryCaseRepository _industryCaseRepository;
|
|
|
+ private readonly ISnapshotSMSTemplateRepository _snapshotSMSTemplateRepository;
|
|
|
|
|
|
- public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository)
|
|
|
+ public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository, ISnapshotSMSTemplateRepository snapshotSMSTemplateRepository)
|
|
|
{
|
|
|
_industryRepository = industryRepository;
|
|
|
_fileRepository = fileRepository;
|
|
|
_sysSetting = sysSetting;
|
|
|
_industryCaseRepository = industryCaseRepository;
|
|
|
+ _snapshotSMSTemplateRepository = snapshotSMSTemplateRepository;
|
|
|
}
|
|
|
/// <summary>
|
|
|
/// 新增行业
|
|
@@ -154,4 +156,33 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
|
return await _industryCaseRepository.GetAsync(caseId);
|
|
|
}
|
|
|
#endregion
|
|
|
+
|
|
|
+ #region 行业短信模板
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 行业模板集合
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public ISugarQueryable<SnapshotSMSTemplateItemsOutDto> GetSMSTemplates(SnapshotSMSTemplateItemsInDto dto)
|
|
|
+ {
|
|
|
+ var query = _snapshotSMSTemplateRepository.Queryable()
|
|
|
+ .LeftJoin<Industry>((s, i) => s.IndustryId == i.Id)
|
|
|
+ .WhereIF(dto.IndustryName.NotNullOrEmpty(), (s, i) => i.Name.Contains(dto.IndustryName))
|
|
|
+ .Select<SnapshotSMSTemplateItemsOutDto>();
|
|
|
+ return query;
|
|
|
+ }
|
|
|
+
|
|
|
+ /// <summary>
|
|
|
+ /// 添加行业模板
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="dto"></param>
|
|
|
+ /// <returns></returns>
|
|
|
+ public async Task<string> AddSMSTemplateAsync(AddSnapshotSMSTemplateInDto dto)
|
|
|
+ {
|
|
|
+ dto.ValidateObject();
|
|
|
+ var entity = dto.Adapt<SnapshotSMSTemplate>();
|
|
|
+ return await _snapshotSMSTemplateRepository.AddAsync(entity);
|
|
|
+ }
|
|
|
+ #endregion
|
|
|
}
|