Merge remote-tracking branch 'origin/S03-轨迹中台' into test
This commit is contained in:
commit
eb99294b63
@ -0,0 +1,75 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackOrder;
|
||||||
|
|
||||||
|
public class TrackPushRecordOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单Id
|
||||||
|
/// </summary>
|
||||||
|
public int OrderId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 接口通请求Id
|
||||||
|
/// </summary>
|
||||||
|
public Guid RequestId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 信息
|
||||||
|
/// </summary>
|
||||||
|
public string Message { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作类型
|
||||||
|
/// </summary>
|
||||||
|
public string OptionType { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹状态
|
||||||
|
/// </summary>
|
||||||
|
public string TrackStatus { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string TrackCode { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string TrackContent { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生地
|
||||||
|
/// </summary>
|
||||||
|
public string TrackPlace { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生时间
|
||||||
|
/// </summary>
|
||||||
|
public DateTime TrackTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生时区
|
||||||
|
/// </summary>
|
||||||
|
public float TrackTimeZone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生时区
|
||||||
|
/// </summary>
|
||||||
|
public string TrackGTMTimeZone { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否成功
|
||||||
|
/// </summary>
|
||||||
|
public bool IsSuccess { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 推送内容(json)
|
||||||
|
/// </summary>
|
||||||
|
public string PushContent { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>创建人</summary>
|
||||||
|
public string? CreateUser { get; set; }
|
||||||
|
|
||||||
|
/// <summary>创建时间</summary>
|
||||||
|
public DateTime CreateTime { get; set; }
|
||||||
|
}
|
||||||
@ -1,8 +1,10 @@
|
|||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using SJZY.Expand.ABP.Core.PublicMethords;
|
using SJZY.Expand.ABP.Core.PublicMethords;
|
||||||
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
using SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
using SJZY.Track.Application.Contract.Dtos.TrackOrder;
|
||||||
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.Dtos.Order;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
using SJZY.Track.Domain.Enums;
|
using SJZY.Track.Domain.Enums;
|
||||||
using Volo.Abp.AutoMapper;
|
using Volo.Abp.AutoMapper;
|
||||||
@ -34,6 +36,8 @@ public class OrderAutoMapperProfile : Profile
|
|||||||
.ForMember(dest => dest.Content, opt => opt.MapFrom(m => m.TrackContent))
|
.ForMember(dest => dest.Content, opt => opt.MapFrom(m => m.TrackContent))
|
||||||
.ForMember(dest => dest.EnContent, opt => opt.MapFrom(m => m.TrackEnContent))
|
.ForMember(dest => dest.EnContent, opt => opt.MapFrom(m => m.TrackEnContent))
|
||||||
.ForMember(dest => dest.TrackTimeZoneValue, opt => opt.MapFrom(m => m.TrackTimeZone));
|
.ForMember(dest => dest.TrackTimeZoneValue, opt => opt.MapFrom(m => m.TrackTimeZone));
|
||||||
|
|
||||||
|
CreateMap<TrackPushRecordIndex, TrackPushRecordOutput>(MemberList.None);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.1.8"/>
|
<PackageReference Include="SJZY.InterfaceRelay.Application.Contracts" Version="7.1.9"/>
|
||||||
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
<PackageReference Include="Volo.Abp.Http.Client" Version="7.0.2" />
|
||||||
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
<PackageReference Include="Volo.Abp.FluentValidation" Version="7.0.2" />
|
||||||
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8" />
|
<PackageReference Include="SJZY.UserCenter.HttpApi" Version="3.0.3-alpha8" />
|
||||||
|
|||||||
@ -160,8 +160,20 @@ public class TrackOrderService : ApplicationService
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
/// <param name="orderId">订单id</param>
|
/// <param name="orderId">订单id</param>
|
||||||
[HttpGet("GetTrackPushRecords")]
|
[HttpGet("GetTrackPushRecords")]
|
||||||
public async Task<List<TrackPushRecordIndex>> GetTrackPushRecordsAsync(int orderId)
|
public async Task<List<TrackPushRecordOutput>> GetTrackPushRecordsAsync(int orderId)
|
||||||
{
|
{
|
||||||
return await _trackPushRecordsRepository.GetTrackPushRecordsAsync(orderId);
|
var records = await _trackPushRecordsRepository.GetTrackPushRecordsAsync(orderId);
|
||||||
|
|
||||||
|
var res = ObjectMapper.Map<List<TrackPushRecordIndex>, List<TrackPushRecordOutput>>(records);
|
||||||
|
|
||||||
|
res.ForEach(x =>
|
||||||
|
{
|
||||||
|
int hours = (int)x.TrackTimeZone; // 提取整数部分作为小时
|
||||||
|
int minutes = (int)((x.TrackTimeZone - hours) * 60); // 将小数部分乘以 60 转换为分钟
|
||||||
|
x.TrackGTMTimeZone =
|
||||||
|
$"GTM {(x.TrackTimeZone >= 0 ? "+" : "-")}{new TimeSpan(hours, minutes, 0).ToString().RemovePostFix(":00")}";
|
||||||
|
});
|
||||||
|
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user