fix:推送轨迹对接接口通
This commit is contained in:
parent
04946a395d
commit
c7a1d91753
@ -12,6 +12,11 @@ public class TrackPushEvent
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统代码
|
||||
/// </summary>
|
||||
public string SubSystemCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
/// </summary>
|
||||
|
||||
@ -7,6 +7,11 @@ public class TrackUpsertEvent
|
||||
/// </summary>
|
||||
public int SubSystemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 子系统code
|
||||
/// </summary>
|
||||
public string SubSystemCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户id
|
||||
/// </summary>
|
||||
|
||||
@ -6,6 +6,7 @@ using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
using SJZY.Track.Application.Contract.Events;
|
||||
using SJZY.Track.Application.Contract.Services;
|
||||
using SJZY.Track.Application.Helpers;
|
||||
using SJZY.Track.Application.Track2InterfaceRelay;
|
||||
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||
@ -149,15 +150,19 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
|
||||
if (items.Count == 0) return;
|
||||
|
||||
string asciiString = Base64Helper.SerializeObject(OptionType.新增.ToString());
|
||||
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||
InterfaceRelayConst.PushTrackInterfaceCode,
|
||||
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
||||
attach: asciiString);
|
||||
|
||||
if (r.Code != InterfaceRelayConst.SuccessCode)
|
||||
using (Track2InterfaceRelaySubSystemContext.Use(
|
||||
new Track2InterfaceRelaySubSystemContext(@event.SubSystemCode)))
|
||||
{
|
||||
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
||||
var asciiString = Base64Helper.SerializeObject(OptionType.新增.ToString());
|
||||
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||
InterfaceRelayConst.PushTrackInterfaceCode,
|
||||
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
||||
attach: asciiString);
|
||||
|
||||
if (r.Code != InterfaceRelayConst.SuccessCode)
|
||||
{
|
||||
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -189,15 +194,19 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
|
||||
if (items.Count == 0) return;
|
||||
|
||||
string asciiString = Base64Helper.SerializeObject(OptionType.修改.ToString());
|
||||
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||
InterfaceRelayConst.TrackUpdateInterfaceCode,
|
||||
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
||||
attach: asciiString);
|
||||
|
||||
if (r.Code != InterfaceRelayConst.SuccessCode)
|
||||
using (Track2InterfaceRelaySubSystemContext.Use(
|
||||
new Track2InterfaceRelaySubSystemContext(@event.SubSystemCode)))
|
||||
{
|
||||
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
||||
var asciiString = Base64Helper.SerializeObject(OptionType.修改.ToString());
|
||||
var r = await _httpClientProxy.Service.BatchForwardThenPushToQueueAsync(
|
||||
InterfaceRelayConst.TrackUpdateInterfaceCode,
|
||||
_pushConfigs.First().ServiceProviderCode, items, GlobalConst.TrackPushCompletedSubscribe,
|
||||
attach: asciiString);
|
||||
|
||||
if (r.Code != InterfaceRelayConst.SuccessCode)
|
||||
{
|
||||
throw new BusinessException(message: $"requestId: {r.RequestId}; {r.Msg}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -178,6 +178,7 @@ public class TrackUpsertEventHandler : ITransientDependency, ICapSubscribe
|
||||
{
|
||||
OptionType = @event.IsAdd ? OptionType.新增 : OptionType.修改,
|
||||
SubSystemId = @event.SubSystemId,
|
||||
SubSystemCode = trackContent.SubSystemCode,
|
||||
CustomId = @event.CustomId,
|
||||
OrderIds = canNextOrderIds.ToArray(),
|
||||
TrackCode = @event.TrackCode,
|
||||
|
||||
@ -54,6 +54,11 @@ public partial class TrackService : ApplicationService, ITrackService
|
||||
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();
|
||||
if (userInfo.Code != GlobalConst.SuccessCode || userInfo.Data is null)
|
||||
{
|
||||
|
||||
@ -2,6 +2,11 @@ namespace SJZY.Track.Domain.Dtos.TrackContents;
|
||||
|
||||
public class TrackContentVO
|
||||
{
|
||||
/// <summary>
|
||||
/// 子系统代码
|
||||
/// </summary>
|
||||
public string SubSystemCode { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 轨迹状态Id
|
||||
/// </summary>
|
||||
|
||||
@ -80,14 +80,16 @@ public class ProvideQueries : ISugarRepository, IProvideQueries, ITransientDepen
|
||||
{
|
||||
return await Context.Queryable<TrackContentEntity>()
|
||||
.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)
|
||||
.Select((x, y) => new TrackContentVO
|
||||
.Select((x, y, z) => new TrackContentVO
|
||||
{
|
||||
SubSystemCode = z.Key,
|
||||
TrackStatusId = x.TrackStatusId,
|
||||
TrackStatus = y.Status,
|
||||
TrackContent = x.Content,
|
||||
TrackEnContent = x.EnContent,
|
||||
IsCompleted = y.IsCompleted
|
||||
IsCompleted = y.IsCompleted,
|
||||
})
|
||||
.FirstAsync();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user