fix:推送轨迹对接接口通
This commit is contained in:
parent
04946a395d
commit
c7a1d91753
@ -12,6 +12,11 @@ public class TrackPushEvent
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统代码
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystemCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客户id
|
/// 客户id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -7,6 +7,11 @@ public class TrackUpsertEvent
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统code
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystemCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 客户id
|
/// 客户id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -6,6 +6,7 @@ using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
|||||||
using SJZY.Track.Application.Contract.Events;
|
using SJZY.Track.Application.Contract.Events;
|
||||||
using SJZY.Track.Application.Contract.Services;
|
using SJZY.Track.Application.Contract.Services;
|
||||||
using SJZY.Track.Application.Helpers;
|
using SJZY.Track.Application.Helpers;
|
||||||
|
using SJZY.Track.Application.Track2InterfaceRelay;
|
||||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
@ -149,7 +150,10 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
|
|
||||||
if (items.Count == 0) return;
|
if (items.Count == 0) return;
|
||||||
|
|
||||||
string asciiString = Base64Helper.SerializeObject(OptionType.新增.ToString());
|
using (Track2InterfaceRelaySubSystemContext.Use(
|
||||||
|
new Track2InterfaceRelaySubSystemContext(@event.SubSystemCode)))
|
||||||
|
{
|
||||||
|
var asciiString = Base64Helper.SerializeObject(OptionType.新增.ToString());
|
||||||
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||||
InterfaceRelayConst.PushTrackInterfaceCode,
|
InterfaceRelayConst.PushTrackInterfaceCode,
|
||||||
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
||||||
@ -160,6 +164,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task DoUpdateAsync(TrackPushEvent @event)
|
private async Task DoUpdateAsync(TrackPushEvent @event)
|
||||||
{
|
{
|
||||||
@ -189,7 +194,10 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
|
|
||||||
if (items.Count == 0) return;
|
if (items.Count == 0) return;
|
||||||
|
|
||||||
string asciiString = Base64Helper.SerializeObject(OptionType.修改.ToString());
|
using (Track2InterfaceRelaySubSystemContext.Use(
|
||||||
|
new Track2InterfaceRelaySubSystemContext(@event.SubSystemCode)))
|
||||||
|
{
|
||||||
|
var asciiString = Base64Helper.SerializeObject(OptionType.修改.ToString());
|
||||||
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||||
InterfaceRelayConst.TrackUpdateInterfaceCode,
|
InterfaceRelayConst.TrackUpdateInterfaceCode,
|
||||||
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
||||||
@ -200,6 +208,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private TrackUpdateInput BuiltUpdateItem(TrackPushContentConfigDto config, TrackPushRecordIndex log)
|
private TrackUpdateInput BuiltUpdateItem(TrackPushContentConfigDto config, TrackPushRecordIndex log)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -178,6 +178,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
|||||||
{
|
{
|
||||||
OptionType = @event.IsAdd ? OptionType.新增 : OptionType.修改,
|
OptionType = @event.IsAdd ? OptionType.新增 : OptionType.修改,
|
||||||
SubSystemId = @event.SubSystemId,
|
SubSystemId = @event.SubSystemId,
|
||||||
|
SubSystemCode = trackContent.SubSystemCode,
|
||||||
CustomId = @event.CustomId,
|
CustomId = @event.CustomId,
|
||||||
OrderIds = canNextOrderIds.ToArray(),
|
OrderIds = canNextOrderIds.ToArray(),
|
||||||
TrackCode = @event.TrackCode,
|
TrackCode = @event.TrackCode,
|
||||||
|
|||||||
@ -54,6 +54,11 @@ public partial class TrackService : ApplicationService, ITrackService
|
|||||||
throw new BusinessException(message: $"订单:{input.OrderNo}不存在");
|
throw new BusinessException(message: $"订单:{input.OrderNo}不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (input.TrackTime < DateTime.Now.AddYears(-100) || input.TrackTime > DateTime.Now.AddYears(100))
|
||||||
|
{
|
||||||
|
throw new BusinessException(message: "轨迹时间不合法");
|
||||||
|
}
|
||||||
|
|
||||||
var userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync();
|
var userInfo = await _requestCurrentUserService.Service.GetCurrentUserBasicInfoAsync();
|
||||||
if (userInfo.Code != GlobalConst.SuccessCode || userInfo.Data is null)
|
if (userInfo.Code != GlobalConst.SuccessCode || userInfo.Data is null)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,6 +2,11 @@ namespace SJZY.Track.Domain.Dtos.TrackContents;
|
|||||||
|
|
||||||
public class TrackContentVO
|
public class TrackContentVO
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统代码
|
||||||
|
/// </summary>
|
||||||
|
public string SubSystemCode { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹状态Id
|
/// 轨迹状态Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -80,14 +80,16 @@ public class ProvideQueries : ISugarRepository, IProvideQueries, ITransientDepen
|
|||||||
{
|
{
|
||||||
return await Context.Queryable<TrackContentEntity>()
|
return await Context.Queryable<TrackContentEntity>()
|
||||||
.LeftJoin<TrackStatusEntity>((x, y) => x.TrackStatusId == y.Id)
|
.LeftJoin<TrackStatusEntity>((x, y) => x.TrackStatusId == y.Id)
|
||||||
|
.LeftJoin<VSystemEntity>((x, y, z) => x.SubSystemId == z.Id)
|
||||||
.Where(x => x.SubSystemId == subSystemId && x.Code == trackCode)
|
.Where(x => x.SubSystemId == subSystemId && x.Code == trackCode)
|
||||||
.Select((x, y) => new TrackContentVO
|
.Select((x, y, z) => new TrackContentVO
|
||||||
{
|
{
|
||||||
|
SubSystemCode = z.Key,
|
||||||
TrackStatusId = x.TrackStatusId,
|
TrackStatusId = x.TrackStatusId,
|
||||||
TrackStatus = y.Status,
|
TrackStatus = y.Status,
|
||||||
TrackContent = x.Content,
|
TrackContent = x.Content,
|
||||||
TrackEnContent = x.EnContent,
|
TrackEnContent = x.EnContent,
|
||||||
IsCompleted = y.IsCompleted
|
IsCompleted = y.IsCompleted,
|
||||||
})
|
})
|
||||||
.FirstAsync();
|
.FirstAsync();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user