|
@@ -25,14 +25,15 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
private readonly IIndustryRepository _industryRepository;
|
|
private readonly IIndustryRepository _industryRepository;
|
|
private readonly IFileRepository _fileRepository;
|
|
private readonly IFileRepository _fileRepository;
|
|
private readonly ISystemSettingCacheManager _sysSetting;
|
|
private readonly ISystemSettingCacheManager _sysSetting;
|
|
|
|
+ private readonly IIndustryCaseRepository _industryCaseRepository;
|
|
|
|
|
|
- public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting)
|
|
|
|
|
|
+ public IndustryApplication(IIndustryRepository industryRepository, IFileRepository fileRepository, ISystemSettingCacheManager sysSetting, IIndustryCaseRepository industryCaseRepository)
|
|
{
|
|
{
|
|
_industryRepository = industryRepository;
|
|
_industryRepository = industryRepository;
|
|
_fileRepository = fileRepository;
|
|
_fileRepository = fileRepository;
|
|
_sysSetting = sysSetting;
|
|
_sysSetting = sysSetting;
|
|
|
|
+ _industryCaseRepository = industryCaseRepository;
|
|
}
|
|
}
|
|
-
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// 新增行业
|
|
/// 新增行业
|
|
/// </summary>
|
|
/// </summary>
|
|
@@ -103,4 +104,33 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
dto.Adapt(entity);
|
|
dto.Adapt(entity);
|
|
await _industryRepository.UpdateAsync(entity, requestAborted);
|
|
await _industryRepository.UpdateAsync(entity, requestAborted);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ #region 行业线索
|
|
|
|
+ public ISugarQueryable<IndustryCaseItemOutDto> GetIndustryCaseItems(IndustryCaseItemInDto dto)
|
|
|
|
+ {
|
|
|
|
+ var query = _industryCaseRepository.Queryable()
|
|
|
|
+ .LeftJoin<Industry>((c, i) => c.IndustryId == i.Id)
|
|
|
|
+ .WhereIF(dto.IndustryName.NotNullOrEmpty(), (c, i) => i.Name.Contains(dto.IndustryName))
|
|
|
|
+ .WhereIF(dto.CaseName.NotNullOrEmpty(), (c, i) => c.Name.Contains(dto.CaseName))
|
|
|
|
+ .Select<IndustryCaseItemOutDto>((c, i) =>
|
|
|
|
+ new IndustryCaseItemOutDto {
|
|
|
|
+ IndustryId = i.Id,
|
|
|
|
+ IndustryName = i.Name});
|
|
|
|
+ return query;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 添加行业线索
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task<string> AddIndustryCaseAsync(AddIndustryCaseDto dto)
|
|
|
|
+ {
|
|
|
|
+ dto.ValidateObject();
|
|
|
|
+ var entity = dto.Adapt<IndustryCase>();
|
|
|
|
+ entity.CitizenReadPackAmount = entity.CitizenReadPackAmount * 100;
|
|
|
|
+ entity.GuiderReadPackAmount = entity.GuiderReadPackAmount * 100;
|
|
|
|
+ return await _industryCaseRepository.AddAsync(entity);
|
|
|
|
+ }
|
|
|
|
+ #endregion
|
|
}
|
|
}
|