Merge pull request '完成 轨迹内容映射详情 接口' (#6) from S01-轨迹中台 into dev
Reviewed-on: http://192.168.80.50:3000/Dotnet/SJZY.Track.Api/pulls/6
This commit is contained in:
commit
6a5775819f
@ -149,5 +149,16 @@ namespace SJZY.Track.Application.Services.TrackContents
|
|||||||
{
|
{
|
||||||
return await _trackContentRepository.GetMapPageAsync(input);
|
return await _trackContentRepository.GetMapPageAsync(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容映射详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("GetMapDetail")]
|
||||||
|
public async Task<GetTrackContentMapDetailOutputVO> GetMapDetailAsync(int id)
|
||||||
|
{
|
||||||
|
return await _trackContentRepository.GetMapDetailAsync(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,4 +9,6 @@ public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
|||||||
Task<UnifyPageResultDto<GetTrackContentListVO>> GetPageTrackContent(GetPageTrackContentVO input);
|
Task<UnifyPageResultDto<GetTrackContentListVO>> GetPageTrackContent(GetPageTrackContentVO input);
|
||||||
|
|
||||||
Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync(GetTrackContentMapPageInputVO input);
|
Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync(GetTrackContentMapPageInputVO input);
|
||||||
|
|
||||||
|
Task<GetTrackContentMapDetailOutputVO> GetMapDetailAsync(int id);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,46 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetTrackContentMapDetailOutputVO
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统
|
||||||
|
/// </summary>
|
||||||
|
public string MapSubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int MapSubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string MapTrackContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 映射轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int MapTrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 源轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
|
}
|
||||||
@ -117,4 +117,25 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
})
|
})
|
||||||
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
.ToPagedListAsync(input.PageIndex, input.PageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<GetTrackContentMapDetailOutputVO> GetMapDetailAsync(int id)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackContentMapEntity>()
|
||||||
|
.InnerJoin<TrackContentEntity>((contentMap, sourceContent) => contentMap.TrackContentId == sourceContent.Id && !sourceContent.IsDeleted)
|
||||||
|
.InnerJoin<TrackContentEntity>((contentMap, sourceContent, targetContent) => contentMap.MapTrackContentId == targetContent.Id && !targetContent.IsDeleted)
|
||||||
|
.LeftJoin<VSystemEntity>((contentMap, sourceContent, targetContent, sourceSystem) => contentMap.SubSystemId == sourceSystem.Id && !sourceSystem.IsDeleted)
|
||||||
|
.LeftJoin<VSystemEntity>((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => contentMap.MapSubSystemId == targetSystem.Id && !targetSystem.IsDeleted)
|
||||||
|
.Filter(null, true)
|
||||||
|
.Where(contentMap => !contentMap.IsDeleted)
|
||||||
|
.Select((contentMap, sourceContent, targetContent, sourceSystem, targetSystem) => new GetTrackContentMapDetailOutputVO
|
||||||
|
{
|
||||||
|
Id = contentMap.Id,
|
||||||
|
SubSystemId = contentMap.SubSystemId,
|
||||||
|
SubSystem = sourceSystem.CnName,
|
||||||
|
TrackContent = contentMap.TrackContentCode + "-" + sourceContent.Content,
|
||||||
|
MapSubSystem = targetSystem.CnName,
|
||||||
|
MapTrackContent = contentMap.MapTrackContentCode + "-" + targetContent.Content
|
||||||
|
}, true)
|
||||||
|
.SingleAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user