添加当前登陆人子系统校验逻辑
This commit is contained in:
parent
4f376c75a3
commit
531e14538b
@ -12,8 +12,4 @@ public class GetDetailTimelineInput
|
||||
/// </summary>
|
||||
public int SystemId{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否
|
||||
/// </summary>
|
||||
public bool IsClient { get; set; }
|
||||
}
|
||||
|
||||
@ -40,7 +40,7 @@ public class GetDetailTimelineOutput
|
||||
/// <summary>
|
||||
/// 文件 osskey 集合
|
||||
/// </summary>
|
||||
public List<string> Files { get; set; }
|
||||
public List<FileItem> Files { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 是否高亮
|
||||
@ -72,3 +72,21 @@ public class GetDetailTimelineOutput
|
||||
/// </summary>
|
||||
public string? TrackPlaceNation { get; set; }
|
||||
}
|
||||
|
||||
public class FileItem
|
||||
{
|
||||
/// <summary>
|
||||
/// 文件osskey
|
||||
/// </summary>
|
||||
public string OssKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件名称
|
||||
/// </summary>
|
||||
public string FileName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 文件url
|
||||
/// </summary>
|
||||
public string Url { get; set; }
|
||||
}
|
||||
|
||||
@ -242,7 +242,6 @@ public class TrackContentService : ApplicationService
|
||||
//获取轨迹详情
|
||||
var trackDetails = await _trackDetailsEsRepository.GetListAsync(orderId);
|
||||
|
||||
|
||||
//获取当前子系统下所有的轨迹内容
|
||||
var contentList = await _trackContentRepository.GetListBySystemIdAsync(input.SystemId);
|
||||
if (contentList == null)
|
||||
|
||||
@ -186,6 +186,10 @@ public class TrackOrderService : ApplicationService
|
||||
if (input.SystemId <= 0)
|
||||
return new UnifyResultDto<List<GetDetailTimelineOutput>>(false, "子系统id不合法");
|
||||
|
||||
var system = await _orderRepository.GetSystemInfoById(input.SystemId);
|
||||
if (system == null)
|
||||
return new UnifyResultDto<List<GetDetailTimelineOutput>>(false, "未找到制定id的子系统");
|
||||
|
||||
var trackStatus = await _trackStatusRepository.GetListAsync(m => m.SubSystemId == input.SystemId);
|
||||
|
||||
var trackDetails = await _trackDetailsEsRepository.GetListAsync(order.Id);
|
||||
@ -198,8 +202,8 @@ public class TrackOrderService : ApplicationService
|
||||
//是否完结
|
||||
isCompleted = currentTrackStatus?.IsCompleted == true;
|
||||
|
||||
//如果是客户端,且轨迹内容不对外则跳过这条轨迹内容
|
||||
if (input.IsClient && item.IsVisibility)
|
||||
//如果是内部系统,且轨迹内容不对外则跳过这条轨迹内容
|
||||
if (system.SystemProperty == 1 && item.IsVisibility)
|
||||
continue;
|
||||
|
||||
res.Data.Add(new GetDetailTimelineOutput()
|
||||
@ -207,11 +211,11 @@ public class TrackOrderService : ApplicationService
|
||||
IsHighlight = true,
|
||||
IsShowHover = true,
|
||||
Remark = item.Remarks == null || item.Remarks == "--" ? "" : item.Remarks,
|
||||
TrackTimeZone = $"GMT{(item.TrackTimeZone >= 0 ? "+" : "-")}{item.TrackTimeZone}",
|
||||
TrackTimeZone = $"GMT {(item.TrackTimeZone >= 0 ? "+" : "-")}{GetTimeZoneStr(item.TrackTimeZone)}",
|
||||
TrackTime = ToUnixTimestamp(item.TrackTime),
|
||||
TrackPlace = item.TrackPlace,
|
||||
EnContent = item.TrackEnContent,
|
||||
Files = string.IsNullOrEmpty(item.Files) || item.Files == "--" ? new List<string>() : item.Files.Split(",").ToList(),
|
||||
//Files = string.IsNullOrEmpty(item.Files) || item.Files == "--" ? new List<string>() : item.Files.Split(",").ToList(),
|
||||
Content = item.TrackContent,
|
||||
TrackCode = item.TrackCode,
|
||||
TrackPlaceNation = item.TrackPlaceNation,
|
||||
@ -238,11 +242,23 @@ public class TrackOrderService : ApplicationService
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
private string GetTimeZoneStr(float timeZone)
|
||||
{
|
||||
var time = timeZone.ToString().Split('.');
|
||||
if (time.Length > 1 && time[1] != "0") //如果时区有小数点
|
||||
{
|
||||
return time[0] + ":30";
|
||||
}
|
||||
else
|
||||
{
|
||||
return time[0] + ":00";
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 根据轨迹id删除单条轨迹
|
||||
/// </summary>
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using SJZY.Track.Domain.Dtos.Order;
|
||||
using SJZY.Track.Domain.VEntities;
|
||||
|
||||
namespace SJZY.Track.Domain.Aggregates.OrderAggregate;
|
||||
|
||||
@ -131,4 +132,11 @@ public interface IOrderRepository : IBasicRepository<OrderEntity>
|
||||
Task<int> UpdateOrderPullConfigForServiceProviderAsync(UpdateOrderPullConfigsInputVo inputVo);
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据id获取子系统信息
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
Task<VSystemEntity> GetSystemInfoById(int id);
|
||||
}
|
||||
|
||||
@ -163,6 +163,11 @@ public class OrderRepository : BasicRepository<OrderEntity>, IOrderRepository, I
|
||||
return res.Select(x => (x.Key, x.Id)).ToList();
|
||||
}
|
||||
|
||||
public Task<VSystemEntity> GetSystemInfoById(int id)
|
||||
{
|
||||
return Context.Queryable<VSystemEntity>().FirstAsync(m => m.IsDeleted == false && m.Id == id);
|
||||
}
|
||||
|
||||
private int UpdateOrderQuestionType(int questionType, IEnumerable<int> ids)
|
||||
{
|
||||
var idsString = string.Join(",", ids);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user