Merge remote-tracking branch 'origin/S03-轨迹中台' into test
This commit is contained in:
commit
2d948c1b27
@ -0,0 +1,20 @@
|
||||
namespace SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
|
||||
public class TrackPushInput
|
||||
{
|
||||
public string OrderNo { get; set; } = null!;
|
||||
|
||||
public List<TrackItem> Data { get; set; } = new();
|
||||
}
|
||||
|
||||
public class TrackItem
|
||||
{
|
||||
public string Location { get; set; } = null!;
|
||||
public DateTime Date { get; set; }
|
||||
public double TimeZone { get; set; }
|
||||
public string? Description { get; set; }
|
||||
public string? DescriptionCn { get; set; }
|
||||
public string? Code { get; set; }
|
||||
public string? Status { get; set; }
|
||||
public string? Extra { get; set; }
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
using DotNetCore.CAP;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||
using SJZY.InterfaceRelay.Application.Contracts;
|
||||
using SJZY.Track.Application.Contract.Dtos.TrackPush;
|
||||
@ -152,33 +152,33 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
private async Task DoAddAsync(TrackPushEvent @event,
|
||||
TrackPushContentConfigDto config, TrackPushRecordIndex log)
|
||||
{
|
||||
var track = new
|
||||
var track = new TrackItem
|
||||
{
|
||||
// 推真实的发生地和发生时间(时间是计算后的)
|
||||
location = @event.TrackPlace,
|
||||
date = @event.TrackTime.AddHours(
|
||||
Location = @event.TrackPlace,
|
||||
Date = @event.TrackTime.AddHours(
|
||||
config.TrackTimeZone ?? @event.TrackTimeZone - @event.TrackTimeZone),
|
||||
timeZone = config.TrackTimeZone ?? @event.TrackTimeZone,
|
||||
description = config.TrackEnContentValue,
|
||||
description_cn = config.TrackContentValue,
|
||||
code = config.TrackContentCodeValue,
|
||||
status = config.TrackStatusValue,
|
||||
extra = config.ExpandFieldsValue
|
||||
TimeZone = config.TrackTimeZone ?? @event.TrackTimeZone,
|
||||
Description = config.TrackEnContentValue,
|
||||
DescriptionCn = config.TrackContentValue,
|
||||
Code = config.TrackContentCodeValue,
|
||||
Status = config.TrackStatusValue,
|
||||
Extra = config.ExpandFieldsValue
|
||||
};
|
||||
|
||||
JObject body = JObject.FromObject(new
|
||||
var body = new TrackPushInput()
|
||||
{
|
||||
orderNo = @event.OrderNo,
|
||||
data = new[] { track }
|
||||
});
|
||||
OrderNo = @event.OrderNo,
|
||||
};
|
||||
body.Data.Add(track);
|
||||
|
||||
if (config.IsAllPush)
|
||||
{
|
||||
var history = await _trackPushRecordsRepository.GetLatestTrackPushRecordAsync(@event.OrderId);
|
||||
if (history != default)
|
||||
{
|
||||
body = JObject.Parse(history.PushContent);
|
||||
((JArray)body["data"]!).Add(JObject.FromObject(track));
|
||||
body = JsonConvert.DeserializeObject<TrackPushInput>(history.PushContent);
|
||||
body!.Data.Add(track);
|
||||
}
|
||||
}
|
||||
|
||||
@ -186,6 +186,7 @@ public class TrackPushEventHandler : ITransientDependency, ICapSubscribe
|
||||
config.ServiceProviderCode, body);
|
||||
|
||||
log.PushContent = body.ToJson();
|
||||
|
||||
log.IsSuccess = res.Code == InterfaceRelayConst.SuccessCode;
|
||||
log.RequestId = res.RequestId;
|
||||
log.Message = res.Msg;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user