新增获取可用轨迹内容接口
This commit is contained in:
parent
07663e2ab0
commit
895238782d
@ -7,7 +7,7 @@
|
|||||||
"Apollo": {
|
"Apollo": {
|
||||||
"AppId": "SJZY.Track.Configuration",
|
"AppId": "SJZY.Track.Configuration",
|
||||||
"Env": "DEV",
|
"Env": "DEV",
|
||||||
"Namespace": "test",
|
"Namespace": "dev",
|
||||||
"MetaServer": "http://apollo-service-test-apollo-configservice.apollo.svc.cluster.local:8080",
|
"MetaServer": "http://apollo-service-test-apollo-configservice.apollo.svc.cluster.local:8080",
|
||||||
"ConfigServer": [
|
"ConfigServer": [
|
||||||
"http://apollo-service-test-apollo-configservice.apollo.svc.cluster.local:8080"
|
"http://apollo-service-test-apollo-configservice.apollo.svc.cluster.local:8080"
|
||||||
|
|||||||
@ -0,0 +1,19 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
|
||||||
|
public class GetDetailTimelineInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单编号
|
||||||
|
/// </summary>
|
||||||
|
public string OrderNumber { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SystemId{ get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否客户端,false时展示所有轨迹,true时只展示对外的轨迹
|
||||||
|
/// </summary>
|
||||||
|
public bool IsCustomeClient { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,54 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.ProvideServices;
|
||||||
|
|
||||||
|
public class GetDetailTimelineOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹编码
|
||||||
|
/// </summary>
|
||||||
|
public string TrackCode { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹英文内容
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生地
|
||||||
|
/// </summary>
|
||||||
|
public string TrackPlace { get; set; } = null!;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生时间
|
||||||
|
/// </summary>
|
||||||
|
public long TrackTime { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹时间前缀
|
||||||
|
/// </summary>
|
||||||
|
public string TrackTimePrefix { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹发生时区
|
||||||
|
/// </summary>
|
||||||
|
public string TrackTimeZone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 备注
|
||||||
|
/// </summary>
|
||||||
|
public string Remark { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 文件 osskey 集合
|
||||||
|
/// </summary>
|
||||||
|
public List<string> Files { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否高亮
|
||||||
|
/// </summary>
|
||||||
|
public bool IsHighlight { get; set; }
|
||||||
|
}
|
||||||
@ -46,6 +46,26 @@ public class EditTrackContentInput
|
|||||||
/// 是否对外
|
/// 是否对外
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool IsExternal { get; set; }
|
public bool IsExternal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可重复
|
||||||
|
/// </summary>
|
||||||
|
public bool IsRepeatable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否允许手动修改
|
||||||
|
/// </summary>
|
||||||
|
public bool IsAllowManuallyUpdate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否允许手动创建
|
||||||
|
/// </summary>
|
||||||
|
public bool IsAllowManuallyCreate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否同步轨迹订单上的预计到达时间
|
||||||
|
/// </summary>
|
||||||
|
public bool IsChangeOrderEdd { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GetTrackContentDetailDto
|
public class GetTrackContentDetailDto
|
||||||
|
|||||||
@ -0,0 +1,25 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetAvailableContentInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单号
|
||||||
|
/// </summary>
|
||||||
|
public string? OrderNo { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 操作类型 1=创建 2=修改
|
||||||
|
/// </summary>
|
||||||
|
public TrackOptionType TrackOptionType { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum TrackOptionType
|
||||||
|
{
|
||||||
|
创建 = 1,
|
||||||
|
修改 = 2
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetAvailableContentOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Id
|
||||||
|
/// </summary>
|
||||||
|
public int Id { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容代码
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容英文
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否对外
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExternal { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetTrackContentByCodeInput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统id
|
||||||
|
/// </summary>
|
||||||
|
public int SystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 轨迹内容code
|
||||||
|
/// </summary>
|
||||||
|
public string Code { get; set; }
|
||||||
|
}
|
||||||
@ -0,0 +1,19 @@
|
|||||||
|
namespace SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
|
|
||||||
|
public class GetTrackContentByCodeOutput
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 中文内容
|
||||||
|
/// </summary>
|
||||||
|
public string Content { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 英文内容
|
||||||
|
/// </summary>
|
||||||
|
public string EnContent { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否对外
|
||||||
|
/// </summary>
|
||||||
|
public bool IsExternal { get; set; }
|
||||||
|
}
|
||||||
@ -2,9 +2,12 @@ using System.Linq.Expressions;
|
|||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
using SJZY.Expand.ABP.Core.Localization;
|
using SJZY.Expand.ABP.Core.Localization;
|
||||||
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.TrackContents;
|
using SJZY.Track.Application.Contract.Dtos.TrackContents;
|
||||||
using SJZY.Track.Application.Localization;
|
using SJZY.Track.Application.Localization;
|
||||||
|
using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackFlagAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.TrackContents;
|
using SJZY.Track.Domain.Dtos.TrackContents;
|
||||||
@ -23,17 +26,23 @@ public class TrackContentService : ApplicationService
|
|||||||
private readonly ITrackContentRepository _trackContentRepository;
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
private readonly IBasicQuery<TrackFlagEntity> _trackFlagBasicQuery;
|
private readonly IBasicQuery<TrackFlagEntity> _trackFlagBasicQuery;
|
||||||
private readonly IBasicQuery<TrackStatusEntity> _trackStatusBasicQuery;
|
private readonly IBasicQuery<TrackStatusEntity> _trackStatusBasicQuery;
|
||||||
|
private readonly IOrderRepository _orderRepository;
|
||||||
|
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
||||||
|
|
||||||
public TrackContentService(
|
public TrackContentService(
|
||||||
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
IStringLocalizer<TrackLocalizationResource> stringLocalizer,
|
||||||
ITrackContentRepository trackContentRepository,
|
ITrackContentRepository trackContentRepository,
|
||||||
IBasicQuery<TrackStatusEntity> trackStatusBasicQuery,
|
IBasicQuery<TrackStatusEntity> trackStatusBasicQuery,
|
||||||
IBasicQuery<TrackFlagEntity> trackFlagBasicQuery)
|
IBasicQuery<TrackFlagEntity> trackFlagBasicQuery,
|
||||||
|
IOrderRepository orderRepository,
|
||||||
|
ITrackDetailsEsRepository trackDetailsEsRepository)
|
||||||
{
|
{
|
||||||
_stringLocalizer = stringLocalizer;
|
_stringLocalizer = stringLocalizer;
|
||||||
_trackContentRepository = trackContentRepository;
|
_trackContentRepository = trackContentRepository;
|
||||||
_trackStatusBasicQuery = trackStatusBasicQuery;
|
_trackStatusBasicQuery = trackStatusBasicQuery;
|
||||||
_trackFlagBasicQuery = trackFlagBasicQuery;
|
_trackFlagBasicQuery = trackFlagBasicQuery;
|
||||||
|
_orderRepository = orderRepository;
|
||||||
|
_trackDetailsEsRepository = trackDetailsEsRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -96,8 +105,7 @@ public class TrackContentService : ApplicationService
|
|||||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost("GetList")]
|
[HttpPost("GetList")]
|
||||||
public async Task<UnifyPageResultDto<GetTrackContentListDto>> GetPageTrackContent(
|
public async Task<UnifyPageResultDto<GetTrackContentListDto>> GetPageTrackContent(GetPageTrackContentInput input)
|
||||||
GetPageTrackContentInput input)
|
|
||||||
{
|
{
|
||||||
var vo = ObjectMapper.Map<GetPageTrackContentInput, GetPageTrackContentVO>(input);
|
var vo = ObjectMapper.Map<GetPageTrackContentInput, GetPageTrackContentVO>(input);
|
||||||
var resultDto = await _trackContentRepository.GetPageTrackContent(vo);
|
var resultDto = await _trackContentRepository.GetPageTrackContent(vo);
|
||||||
@ -181,6 +189,95 @@ public class TrackContentService : ApplicationService
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 根据轨迹内容code获取轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetTrackContentByCode")]
|
||||||
|
public async Task<UnifyResultDto<GetTrackContentByCodeOutput>> GetTrackContentByCodeAsync([FromBody] GetTrackContentByCodeInput input)
|
||||||
|
{
|
||||||
|
if (input.SystemId <= 0)
|
||||||
|
return new UnifyResultDto<GetTrackContentByCodeOutput>(false, "子系统Id必须大于等于0");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(input.Code))
|
||||||
|
return new UnifyResultDto<GetTrackContentByCodeOutput>(false, "轨迹内容code不能为空");
|
||||||
|
|
||||||
|
var content = await _trackContentRepository.GetByCodeAsync(input.SystemId, input.Code);
|
||||||
|
if (content == null)
|
||||||
|
return new UnifyResultDto<GetTrackContentByCodeOutput>(false, "在当前子系统中未找到指定code的轨迹内容");
|
||||||
|
|
||||||
|
var res = new UnifyResultDto<GetTrackContentByCodeOutput>(true)
|
||||||
|
{
|
||||||
|
Data = new GetTrackContentByCodeOutput
|
||||||
|
{
|
||||||
|
Content = content.Content,
|
||||||
|
EnContent = content.EnContent,
|
||||||
|
IsExternal = content.IsExternal
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 创建轨迹时获取可用的轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetAvailableContent")]
|
||||||
|
public async Task<UnifyResultDto<List<GetAvailableContentOutput>>> GetAvailableContent(GetAvailableContentInput input)
|
||||||
|
{
|
||||||
|
if (input.SystemId <= 0)
|
||||||
|
return new UnifyResultDto<List<GetAvailableContentOutput>>(false, "系统id需大于0!");
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(input.OrderNo))
|
||||||
|
return new UnifyResultDto<List<GetAvailableContentOutput>>(false, "单号不能为空!");
|
||||||
|
|
||||||
|
//获取当前订单下已有的轨迹内容
|
||||||
|
var orderId = await _orderRepository.GetFirstAsync(x => x.OrderNo == input.OrderNo && x.SubSystemId == input.SystemId, x => x.Id);
|
||||||
|
if (orderId == default)
|
||||||
|
throw new BusinessException(message: "订单不存在!");
|
||||||
|
|
||||||
|
//获取轨迹详情
|
||||||
|
var trackDetails = await _trackDetailsEsRepository.GetListAsync(orderId);
|
||||||
|
|
||||||
|
|
||||||
|
//获取当前子系统下所有的轨迹内容
|
||||||
|
var contentList = await _trackContentRepository.GetListBySystemIdAsync(input.SystemId);
|
||||||
|
if (contentList == null)
|
||||||
|
throw new BusinessException(message: "当前子系统下未找到任何可用的轨迹内容!");
|
||||||
|
|
||||||
|
|
||||||
|
var res = new UnifyResultDto<List<GetAvailableContentOutput>>(true)
|
||||||
|
{
|
||||||
|
Data = new List<GetAvailableContentOutput>()
|
||||||
|
};
|
||||||
|
|
||||||
|
foreach (var item in contentList)
|
||||||
|
{
|
||||||
|
if (!item.IsRepeatable && trackDetails?.Any(m => m.TrackCode == item.Code) == true) //跳过已存在轨迹内容
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!item.IsAllowManuallyCreate && input.TrackOptionType == TrackOptionType.创建) //跳过不允许手动创建的轨迹内容
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!item.IsAllowManuallyUpdate && input.TrackOptionType == TrackOptionType.修改) //跳过不允许手动创建的轨迹内容
|
||||||
|
continue;
|
||||||
|
|
||||||
|
res.Data.Add(new GetAvailableContentOutput()
|
||||||
|
{
|
||||||
|
IsExternal = item.IsExternal,
|
||||||
|
EnContent = item.EnContent,
|
||||||
|
Content = item.Content,
|
||||||
|
Code = item.Code,
|
||||||
|
Id = item.Id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
#region 私有方法
|
#region 私有方法
|
||||||
|
|
||||||
private async Task<UnifyResultDto> AddAsync(EditTrackContentInput input)
|
private async Task<UnifyResultDto> AddAsync(EditTrackContentInput input)
|
||||||
|
|||||||
@ -4,6 +4,7 @@ using SJZY.Track.Domain.Aggregates.OrderAggregate;
|
|||||||
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackContentAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackDetailsAggregate;
|
||||||
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
using SJZY.Track.Domain.Aggregates.TrackPushAggregate;
|
||||||
|
using SJZY.Track.Domain.Aggregates.TrackStatusAggregate;
|
||||||
using SJZY.Track.Domain.Dtos.Order;
|
using SJZY.Track.Domain.Dtos.Order;
|
||||||
|
|
||||||
namespace SJZY.Track.Application.Services.TrackOrders;
|
namespace SJZY.Track.Application.Services.TrackOrders;
|
||||||
@ -18,6 +19,7 @@ public class TrackOrderService : ApplicationService
|
|||||||
private readonly IOrderOperationRecordEsRepository _orderOperationRecordEsRepository;
|
private readonly IOrderOperationRecordEsRepository _orderOperationRecordEsRepository;
|
||||||
private readonly IOrderRepository _orderRepository;
|
private readonly IOrderRepository _orderRepository;
|
||||||
private readonly ITrackContentRepository _trackContentRepository;
|
private readonly ITrackContentRepository _trackContentRepository;
|
||||||
|
private readonly ITrackStatusRepository _trackStatusRepository;
|
||||||
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
private readonly ITrackDetailsEsRepository _trackDetailsEsRepository;
|
||||||
private readonly ITrackPushRecordEsRepository _trackPushRecordEsRepository;
|
private readonly ITrackPushRecordEsRepository _trackPushRecordEsRepository;
|
||||||
|
|
||||||
@ -26,13 +28,15 @@ public class TrackOrderService : ApplicationService
|
|||||||
ITrackDetailsEsRepository trackDetailsEsRepository,
|
ITrackDetailsEsRepository trackDetailsEsRepository,
|
||||||
ITrackContentRepository trackContentRepository,
|
ITrackContentRepository trackContentRepository,
|
||||||
ITrackPushRecordEsRepository trackPushRecordEsRepository,
|
ITrackPushRecordEsRepository trackPushRecordEsRepository,
|
||||||
IOrderOperationRecordEsRepository orderOperationRecordEsRepository)
|
IOrderOperationRecordEsRepository orderOperationRecordEsRepository,
|
||||||
|
ITrackStatusRepository trackStatusRepository)
|
||||||
{
|
{
|
||||||
_orderRepository = orderRepository;
|
_orderRepository = orderRepository;
|
||||||
_trackDetailsEsRepository = trackDetailsEsRepository;
|
_trackDetailsEsRepository = trackDetailsEsRepository;
|
||||||
_trackContentRepository = trackContentRepository;
|
_trackContentRepository = trackContentRepository;
|
||||||
_trackPushRecordEsRepository = trackPushRecordEsRepository;
|
_trackPushRecordEsRepository = trackPushRecordEsRepository;
|
||||||
_orderOperationRecordEsRepository = orderOperationRecordEsRepository;
|
_orderOperationRecordEsRepository = orderOperationRecordEsRepository;
|
||||||
|
_trackStatusRepository = trackStatusRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 轨迹订单列表
|
#region 轨迹订单列表
|
||||||
@ -164,6 +168,73 @@ public class TrackOrderService : ApplicationService
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 按时间轴获取轨迹内容
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="input"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost("GetDetailTimeline")]
|
||||||
|
public async Task<UnifyResultDto<List<GetDetailTimelineOutput>>> GetDetailTimeline(GetDetailTimelineInput input)
|
||||||
|
{
|
||||||
|
var res = new UnifyResultDto<List<GetDetailTimelineOutput>>(true);
|
||||||
|
|
||||||
|
var order = await _orderRepository.GetFirstAsync(m => m.OrderNo == input.OrderNumber);
|
||||||
|
if (order == null)
|
||||||
|
return new UnifyResultDto<List<GetDetailTimelineOutput>>(false, "订单不存在");
|
||||||
|
|
||||||
|
if (input.SystemId <= 0)
|
||||||
|
return new UnifyResultDto<List<GetDetailTimelineOutput>>(false, "子系统id不合法");
|
||||||
|
|
||||||
|
var trackStatus = await _trackStatusRepository.GetListAsync(m => m.SubSystemId == input.SystemId);
|
||||||
|
|
||||||
|
var trackDetails = await _trackDetailsEsRepository.GetListAsync(order.Id);
|
||||||
|
res.Data = new List<GetDetailTimelineOutput>();
|
||||||
|
var isCompleted = false;
|
||||||
|
foreach (var item in trackDetails)
|
||||||
|
{
|
||||||
|
//是否完结
|
||||||
|
isCompleted = trackStatus.Any(m => m.IsCompleted && m.Code == item.TrackStatus);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
res.Data.Add(new GetDetailTimelineOutput()
|
||||||
|
{
|
||||||
|
IsHighlight = true,
|
||||||
|
Files = new List<string>(),
|
||||||
|
//Remark = item.Remark,
|
||||||
|
//TrackTimeZone = item.TrackTimeZone,
|
||||||
|
TrackTime = ToUnixTimestamp(item.TrackTime),
|
||||||
|
TrackPlace = item.TrackPlace,
|
||||||
|
EnContent = item.TrackEnContent,
|
||||||
|
Content = item.TrackContent,
|
||||||
|
TrackCode = item.TrackCode
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//如果轨迹状态没完结则追加最后一个默认节点
|
||||||
|
if (!isCompleted)
|
||||||
|
{
|
||||||
|
res.Data.Add(new GetDetailTimelineOutput()
|
||||||
|
{
|
||||||
|
Content = "签收",
|
||||||
|
IsHighlight = false,
|
||||||
|
TrackTimeZone = $"GMT{(order.DestinationTimeZone >= 0 ? "+" : "-")}{order.DestinationTimeZone}",
|
||||||
|
TrackTime = ToUnixTimestamp(order.EstimatedDeliveryDate),
|
||||||
|
TrackTimePrefix = "预计签收时间:",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long ToUnixTimestamp(DateTime time)
|
||||||
|
{
|
||||||
|
//var sTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
||||||
|
var sTime = TimeZoneInfo.ConvertTime(new DateTime(1970, 1, 1), TimeZoneInfo.Utc, TimeZoneInfo.Local);
|
||||||
|
return (long) (time - sTime).TotalMilliseconds;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 根据轨迹id删除单条轨迹
|
/// 根据轨迹id删除单条轨迹
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -172,6 +172,18 @@ public class OrderEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
|||||||
|
|
||||||
[SugarColumn(IsIgnore = true)] public List<OrderPullStatusEntity> OrderPullStatus { get; set; }
|
[SugarColumn(IsIgnore = true)] public List<OrderPullStatusEntity> OrderPullStatus { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 目的地时区
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "DestinationTimeZone")]
|
||||||
|
public float DestinationTimeZone { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 预计到达时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "EstimatedDeliveryDate")]
|
||||||
|
public DateTime EstimatedDeliveryDate { get; set; }
|
||||||
|
|
||||||
public void ResetTrackInfo()
|
public void ResetTrackInfo()
|
||||||
{
|
{
|
||||||
IsCompleted = false;
|
IsCompleted = false;
|
||||||
|
|||||||
@ -26,4 +26,6 @@ public interface ITrackContentRepository : IBasicRepository<TrackContentEntity>
|
|||||||
Expression<Func<TrackContentMapEntity, bool>> whereExpression);
|
Expression<Func<TrackContentMapEntity, bool>> whereExpression);
|
||||||
|
|
||||||
Task<bool> GetTemplateIsExist(int trackContentId);
|
Task<bool> GetTemplateIsExist(int trackContentId);
|
||||||
|
Task<TrackContentEntity> GetByCodeAsync(int systemId, string code);
|
||||||
|
Task<List<TrackContentEntity>> GetListBySystemIdAsync(int systemId);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,12 @@ public class TrackContentEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
|||||||
[SugarColumn(ColumnName = "SubSystemId")]
|
[SugarColumn(ColumnName = "SubSystemId")]
|
||||||
public int SubSystemId { get; set; }
|
public int SubSystemId { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 子系统名称
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsIgnore = true)]
|
||||||
|
public string SubSystem { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 轨迹标记id,多个逗号分隔
|
/// 轨迹标记id,多个逗号分隔
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -53,4 +59,28 @@ public class TrackContentEntity : IFullAuditedBasicEntitys, IAggregateRoot
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
[SugarColumn(ColumnName = "IsExternal")]
|
[SugarColumn(ColumnName = "IsExternal")]
|
||||||
public bool IsExternal { get; set; }
|
public bool IsExternal { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否可重复
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsRepeatable")]
|
||||||
|
public bool IsRepeatable { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否允许手动修改
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsAllowManuallyUpdate")]
|
||||||
|
public bool IsAllowManuallyUpdate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否允许手动创建
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsAllowManuallyCreate")]
|
||||||
|
public bool IsAllowManuallyCreate { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 是否同步轨迹订单上的预计到达时间
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "IsChangeOrderEdd")]
|
||||||
|
public bool IsChangeOrderEdd { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,6 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync(
|
public async Task<UnifyPageResultDto<GetTrackContentMapPageOutputVO>> GetMapPageAsync(
|
||||||
GetTrackContentMapPageInputVO input)
|
GetTrackContentMapPageInputVO input)
|
||||||
{
|
{
|
||||||
@ -220,4 +219,27 @@ public class TrackContentRepository : BasicRepository<TrackContentEntity>, ITrac
|
|||||||
return await Context.Updateable<TrackContentMapEntity>().SetColumns(columns).Where(whereExpression)
|
return await Context.Updateable<TrackContentMapEntity>().SetColumns(columns).Where(whereExpression)
|
||||||
.ExecuteCommandAsync() > 0;
|
.ExecuteCommandAsync() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<TrackContentEntity> GetByCodeAsync(int systemId, string code)
|
||||||
|
{
|
||||||
|
return Context.Queryable<TrackContentEntity>().FirstAsync(m => m.SubSystemId == systemId && m.Code == code);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<List<TrackContentEntity>> GetListBySystemIdAsync(int systemId)
|
||||||
|
{
|
||||||
|
return Context.Queryable<TrackContentEntity>()
|
||||||
|
.Where(content => content.SubSystemId == systemId && !content.IsDeleted)
|
||||||
|
.Select((content) => new TrackContentEntity
|
||||||
|
{
|
||||||
|
Id = content.Id,
|
||||||
|
Code = content.Code,
|
||||||
|
IsExternal = content.IsExternal,
|
||||||
|
EnContent = content.EnContent,
|
||||||
|
Content = content.Content,
|
||||||
|
IsRepeatable = content.IsRepeatable,
|
||||||
|
IsAllowManuallyCreate = content.IsAllowManuallyCreate,
|
||||||
|
IsAllowManuallyUpdate = content.IsAllowManuallyUpdate,
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user