Merge remote-tracking branch 'origin/S01-轨迹中台' into S01-轨迹中台
This commit is contained in:
commit
cf76f52ecc
@ -57,4 +57,15 @@ public class TrackPushService : ApplicationService, ITransientDependency
|
|||||||
{
|
{
|
||||||
return await _trackPushConfigRepository.GetDetailAsync(id);
|
return await _trackPushConfigRepository.GetDetailAsync(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送配置内容详情
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet("GetContentDetail")]
|
||||||
|
public async Task<GetTrackPushContentDetailOutputVO> GetContentDetailAsync(int id)
|
||||||
|
{
|
||||||
|
return await _trackPushConfigRepository.GetContentDetailAsync(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -13,4 +13,5 @@ public interface ITrackDetailsRepository
|
|||||||
Task<List<TrackDetailsIndex>> GetListAsync(int orderType, List<string> orderNos);
|
Task<List<TrackDetailsIndex>> GetListAsync(int orderType, List<string> orderNos);
|
||||||
|
|
||||||
Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input);
|
Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input);
|
||||||
|
Task<List<TrackDetailsIndex>> GetListAsync(int orderId);
|
||||||
}
|
}
|
||||||
@ -10,4 +10,6 @@ public interface ITrackPushConfigRepository : IBasicRepository<TrackPushConfigEn
|
|||||||
Task<UnifyPageResultDto<GetTrackPushContentPageOutputVO>> GetContentPageAsync(GetTrackPushContentPageInputVO input);
|
Task<UnifyPageResultDto<GetTrackPushContentPageOutputVO>> GetContentPageAsync(GetTrackPushContentPageInputVO input);
|
||||||
|
|
||||||
Task<GetTrackPushConfigDetailOutputVO> GetDetailAsync(int id);
|
Task<GetTrackPushConfigDetailOutputVO> GetDetailAsync(int id);
|
||||||
|
|
||||||
|
Task<GetTrackPushContentDetailOutputVO> GetContentDetailAsync(int id);
|
||||||
}
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
namespace SJZY.Track.Domain.Dtos.TrackPush;
|
||||||
|
|
||||||
|
public class GetTrackPushContentDetailOutputVO
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送扩展字段
|
||||||
|
/// </summary>
|
||||||
|
public string ExpandFieldsValue { get; set; }
|
||||||
|
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送单号类型
|
||||||
|
/// </summary>
|
||||||
|
public int OrderNoType { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹排序
|
||||||
|
/// </summary>
|
||||||
|
public int Sort { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContentCodeValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackContentId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContentValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string TrackEnContentValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹推送配置id
|
||||||
|
/// </summary>
|
||||||
|
public int TrackPullConfigId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatusValue { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送轨迹时区
|
||||||
|
/// </summary>
|
||||||
|
public string TrackTimeZone { get; set; }
|
||||||
|
}
|
||||||
@ -73,6 +73,21 @@ internal class TrackDetailsRepository : ElasticSearchContextAbstract<TrackDetail
|
|||||||
return data.Documents.ToList();
|
return data.Documents.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<TrackDetailsIndex>> GetListAsync(int orderId)
|
||||||
|
{
|
||||||
|
var data = await Context.SearchAsync<TrackDetailsIndex>(x => x
|
||||||
|
.Source(s => s.Includes(fd => fd
|
||||||
|
.Field(f => f.TrackStatus)
|
||||||
|
.Field(f => f.TrackCode)
|
||||||
|
.Field(f => f.TrackContent)
|
||||||
|
.Field(f => f.TrackPlace)
|
||||||
|
.Field(f => f.TrackTime)
|
||||||
|
.Field(f => f.TraceTimeZone)
|
||||||
|
)).Query(q => q.Terms(t => t.Field(f => f.OrderId).Terms(orderId))));
|
||||||
|
|
||||||
|
return data?.Documents?.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input)
|
public async Task<(List<TrackDetailsIndex> list, long total)> GetListAsync(TrackDetailsQueryInput input)
|
||||||
{
|
{
|
||||||
if (input.OrderNos.Count < 1) return default;
|
if (input.OrderNos.Count < 1) return default;
|
||||||
|
|||||||
@ -69,4 +69,17 @@ public class TrackPushConfigRepository : BasicRepository<TrackPushConfigEntity>,
|
|||||||
}, true)
|
}, true)
|
||||||
.SingleAsync();
|
.SingleAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<GetTrackPushContentDetailOutputVO> GetContentDetailAsync(int id)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<TrackPushContentConfigEntity>()
|
||||||
|
.InnerJoin<TrackContentEntity>((pushContent, trackContent) => pushContent.TrackContentId == trackContent.Id)
|
||||||
|
.Where(pushContent => pushContent.Id == id)
|
||||||
|
.Select((pushContent, trackContent) => new GetTrackPushContentDetailOutputVO
|
||||||
|
{
|
||||||
|
Id = pushContent.Id,
|
||||||
|
Code = trackContent.Code + "-" + trackContent.Content,
|
||||||
|
}, true)
|
||||||
|
.SingleAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user