完成 轨迹模板内容详情 接口
This commit is contained in:
parent
0a3a9b1822
commit
8962bc4055
@ -115,4 +115,15 @@ public class TrackTemplateService : ApplicationService, ITrackTemplateService, I
|
||||
{
|
||||
return await _trackTemplateRepository.GetContentPageAsync(input);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板内容详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetContentDetail")]
|
||||
public async Task<GetContentDetailOutputVO> GetContentDetailAsync(int id)
|
||||
{
|
||||
return await _trackTemplateRepository.GetContentDetailAsync(id);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,42 @@
|
||||
namespace SJZY.Track.Domain.TrackTemplateAggregate.Dtos
|
||||
{
|
||||
public class GetContentDetailOutputVO
|
||||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可删
|
||||
/// </summary>
|
||||
public bool IsCanDelete { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否对外
|
||||
/// </summary>
|
||||
public bool IsExternal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容
|
||||
/// </summary>
|
||||
public string TrackContent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹内容id
|
||||
/// </summary>
|
||||
public int TrackContentId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态
|
||||
/// </summary>
|
||||
public string TrackStatus { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态id
|
||||
/// </summary>
|
||||
public int TrackStatusId { get; set; }
|
||||
}
|
||||
}
|
||||
@ -27,17 +27,17 @@ public class GetContentPageOutputVO
|
||||
/// </summary>
|
||||
public string EnContent { get; set; }
|
||||
|
||||
public long? Id { get; set; }
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否可删
|
||||
/// </summary>
|
||||
public bool? IsCanDelete { get; set; }
|
||||
public bool IsCanDelete { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否对外
|
||||
/// </summary>
|
||||
public bool? IsExternal { get; set; }
|
||||
public bool IsExternal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 所属节点
|
||||
@ -47,7 +47,7 @@ public class GetContentPageOutputVO
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public long? Sort { get; set; }
|
||||
public long Sort { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹标记
|
||||
|
||||
@ -10,5 +10,17 @@ public interface ITrackTemplateRepository : IBasicRepository<TrackTemplateEntity
|
||||
|
||||
Task<UnifyPageResultDto<GetTrackTemplateListVO>> GetPageTrackTemplate(GetPageTrackTemplateVO input);
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板内容列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
Task<UnifyPageResultDto<GetContentPageOutputVO>> GetContentPageAsync(GetContentPageInputVO input);
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板内容详情
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<GetContentDetailOutputVO> GetContentDetailAsync(int id);
|
||||
}
|
||||
@ -60,11 +60,7 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
return pagedList;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹模板内容列表
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
||||
/// <inheritdoc/>
|
||||
public async Task<UnifyPageResultDto<GetContentPageOutputVO>> GetContentPageAsync(GetContentPageInputVO input)
|
||||
{
|
||||
return await AsSugarClient().Queryable<TrackTemplateContentEntity>()
|
||||
@ -89,4 +85,21 @@ public class TrackTemplateRepository : BasicRepository<TrackTemplateEntity>, ITr
|
||||
}, true)
|
||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public async Task<GetContentDetailOutputVO> GetContentDetailAsync(int id)
|
||||
{
|
||||
return await AsSugarClient().Queryable<TrackTemplateContentEntity>()
|
||||
.InnerJoin<TrackContentEntity>((templateContent, trackContent) => templateContent.TrackContentId == trackContent.Id && !trackContent.IsDeleted)
|
||||
.LeftJoin<TrackStatusEntity>((templateContent, trackContent, trackStatus) => trackContent.TrackStatusId == trackStatus.Id && !trackStatus.IsDeleted)
|
||||
.Filter(null, true)
|
||||
.Where(templateContent => templateContent.Id == id && !templateContent.IsDeleted)
|
||||
.Select((templateContent, trackContent, trackStatus) => new GetContentDetailOutputVO
|
||||
{
|
||||
Id = templateContent.Id,
|
||||
TrackContent = trackContent.Code + "-" + trackContent.Content,
|
||||
TrackStatus = trackStatus.Status
|
||||
}, true)
|
||||
.SingleAsync();
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user