|
@@ -119,7 +119,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
.LeftJoin<Industry>((c, i) => c.IndustryId == i.Id)
|
|
.LeftJoin<Industry>((c, i) => c.IndustryId == i.Id)
|
|
.WhereIF(dto.IndustryName.NotNullOrEmpty(), (c, i) => i.Name.Contains(dto.IndustryName))
|
|
.WhereIF(dto.IndustryName.NotNullOrEmpty(), (c, i) => i.Name.Contains(dto.IndustryName))
|
|
.WhereIF(dto.CaseName.NotNullOrEmpty(), (c, i) => c.Name.Contains(dto.CaseName))
|
|
.WhereIF(dto.CaseName.NotNullOrEmpty(), (c, i) => c.Name.Contains(dto.CaseName))
|
|
- .OrderByDescending(m => m.CreationTime)
|
|
|
|
|
|
+ .OrderByDescending((c, i) => c.CreationTime)
|
|
.Select<IndustryCaseItemOutDto>((c, i) =>
|
|
.Select<IndustryCaseItemOutDto>((c, i) =>
|
|
new IndustryCaseItemOutDto {
|
|
new IndustryCaseItemOutDto {
|
|
Id = c.Id,
|
|
Id = c.Id,
|
|
@@ -215,6 +215,7 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
{
|
|
{
|
|
return await _snapshotSMSTemplateRepository.Queryable()
|
|
return await _snapshotSMSTemplateRepository.Queryable()
|
|
.LeftJoin<Industry>((s, i) => s.IndustryId == i.Id)
|
|
.LeftJoin<Industry>((s, i) => s.IndustryId == i.Id)
|
|
|
|
+ .Where((s, i) => s.Id == id)
|
|
.Select<SnapshotSMSTemplateItemsOutDto>()
|
|
.Select<SnapshotSMSTemplateItemsOutDto>()
|
|
.FirstAsync();
|
|
.FirstAsync();
|
|
}
|
|
}
|
|
@@ -283,7 +284,9 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
public async Task UpdatePractitionerAsync(UpdatePractitionerInDto dto)
|
|
public async Task UpdatePractitionerAsync(UpdatePractitionerInDto dto)
|
|
{
|
|
{
|
|
dto.ValidateObject();
|
|
dto.ValidateObject();
|
|
- var entity = dto.Adapt<Practitioner>();
|
|
|
|
|
|
+
|
|
|
|
+ var entity = await _practitionerRepository.GetAsync(dto.Id) ?? throw UserFriendlyException.SameMessage($"从业人员不存在 {dto.Id}");
|
|
|
|
+ dto.Adapt(entity);
|
|
await _practitionerRepository.UpdateAsync(entity);
|
|
await _practitionerRepository.UpdateAsync(entity);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -341,5 +344,18 @@ public class IndustryApplication : IIndustryApplication, IScopeDependency
|
|
{
|
|
{
|
|
return await _volunteerRepository.GetAsync(id);
|
|
return await _volunteerRepository.GetAsync(id);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 修改志愿者
|
|
|
|
+ /// </summary>
|
|
|
|
+ /// <param name="dto"></param>
|
|
|
|
+ /// <returns></returns>
|
|
|
|
+ public async Task UpdateVolunteerAsync(UpdateVolunteerInDto dto)
|
|
|
|
+ {
|
|
|
|
+ dto.ValidateObject();
|
|
|
|
+ var entity = await _volunteerRepository.GetAsync(dto.Id) ?? throw UserFriendlyException.SameMessage($"志愿者不存在 {dto.Id}");
|
|
|
|
+ dto.Adapt(entity);
|
|
|
|
+ await _volunteerRepository.UpdateAsync(entity);
|
|
|
|
+ }
|
|
#endregion
|
|
#endregion
|
|
}
|
|
}
|