|
@@ -70,7 +70,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
|
.WhereIF(dto.ApproveOrgName.NotNullOrEmpty(), m => m.ApproveOrgName.Contains(dto.ApproveOrgName))
|
|
|
.OrderByDescending(m => m.CreationTime)
|
|
|
.Select<IndustryItemsOutDto>();
|
|
|
-
|
|
|
+
|
|
|
|
|
|
return query;
|
|
|
}
|
|
@@ -83,14 +83,6 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
|
var files = await _fileRepository.GetByKeyAsync(id, CancellationToken.None);
|
|
|
var outDto = industry.Adapt<IndustryDetailOutDto>();
|
|
|
outDto.Files = files.Adapt<IList<IndustryFileDto>>();
|
|
|
- if (outDto.BackgroundImgUrl.NotNullOrEmpty())
|
|
|
- outDto.BackgroundImgUrl = fileDownloadApi + outDto.BackgroundImgUrl;
|
|
|
- if (outDto.BannerImgUrl.NotNullOrEmpty())
|
|
|
- outDto.BannerImgUrl = fileDownloadApi + outDto.BannerImgUrl;
|
|
|
- if (outDto.CareCellImgUrl.NotNullOrEmpty())
|
|
|
- outDto.CareCellImgUrl = fileDownloadApi + outDto.CareCellImgUrl;
|
|
|
- if (outDto.CellImgUrl.NotNullOrEmpty())
|
|
|
- outDto.CellImgUrl = fileDownloadApi + outDto.CellImgUrl;
|
|
|
return outDto;
|
|
|
}
|
|
|
|
|
@@ -118,18 +110,20 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
|
|
|
|
#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))
|
|
|
.OrderByDescending((c, i) => c.CreationTime)
|
|
|
- .Select<IndustryCaseItemOutDto>((c, i) =>
|
|
|
- new IndustryCaseItemOutDto {
|
|
|
+ .Select<IndustryCaseItemOutDto>((c, i) =>
|
|
|
+ new IndustryCaseItemOutDto
|
|
|
+ {
|
|
|
Id = c.Id,
|
|
|
Name = c.Name,
|
|
|
- IndustryId = i.Id,
|
|
|
- IndustryName = i.Name}, true);
|
|
|
+ IndustryId = i.Id,
|
|
|
+ IndustryName = i.Name
|
|
|
+ }, true);
|
|
|
return query;
|
|
|
}
|
|
|
|
|
@@ -155,7 +149,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
|
public async Task UpdateIndustryCaseAsync(UpdateIndustryCaseDto dto)
|
|
|
{
|
|
|
dto.ValidateObject();
|
|
|
- var entity = await _industryCaseRepository.GetAsync(dto.Id)
|
|
|
+ var entity = await _industryCaseRepository.GetAsync(dto.Id)
|
|
|
?? throw UserFriendlyException.SameMessage($"行业线索不存在 {dto.Id}");
|
|
|
dto.Adapt(entity);
|
|
|
await _industryCaseRepository.UpdateAsync(entity);
|