|
|
|
@ -731,14 +731,14 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var mlist = await _rep.AsQueryable().Filter(null, true).Where(x => x.Id == input.Id).FirstAsync();
|
|
|
|
|
var rightlist= await _right.GetDataScopeList(MenuConst.MenuBookingOrder,true);
|
|
|
|
|
var rightlist = await _right.GetDataScopeList(MenuConst.MenuBookingOrder, true);
|
|
|
|
|
if (!(
|
|
|
|
|
mlist.OPID == UserManager.UserId.ToString() ||
|
|
|
|
|
mlist.DOCID == UserManager.UserId.ToString() ||
|
|
|
|
|
mlist.CUSTSERVICEID == UserManager.UserId.ToString() ||
|
|
|
|
|
mlist.ROUTEID == UserManager.UserId.ToString() ||
|
|
|
|
|
mlist.CreatedUserId.ToString() == UserManager.UserId.ToString() ||
|
|
|
|
|
UserManager.DjyUserId == "d85fd590-d9f6-4410-93a1-f6fac77b606e"||
|
|
|
|
|
UserManager.DjyUserId == "d85fd590-d9f6-4410-93a1-f6fac77b606e" ||
|
|
|
|
|
rightlist.Contains((long)mlist.CreatedUserId)
|
|
|
|
|
))
|
|
|
|
|
{
|
|
|
|
@ -7655,7 +7655,12 @@ namespace Myshipping.Application
|
|
|
|
|
public async Task<dynamic> GetAllData(long bookingId)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var traceTime = false;
|
|
|
|
|
var ticks = DateTime.Now;
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation($"{bookingId} GetAllData Stage 0 ");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BookingAllData allData = new BookingAllData();
|
|
|
|
|
if (bookingId == 0)
|
|
|
|
@ -7670,6 +7675,13 @@ namespace Myshipping.Application
|
|
|
|
|
var filelist = await _bookingfile.AsQueryable().Filter(null, true).Where(u => u.BookingId == bookingId).ToListAsync();
|
|
|
|
|
allData.file = filelist;
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 1 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var statuslog = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == bookingId).OrderByDescending(x => x.CreatedTime).ToListAsync();
|
|
|
|
|
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
|
|
|
|
|
var statuslogdetail = await _statuslogdetail.AsQueryable().ToListAsync();
|
|
|
|
@ -7680,6 +7692,13 @@ namespace Myshipping.Application
|
|
|
|
|
}
|
|
|
|
|
allData.statuslog = dto;
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 2 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
List<BookingLogDto> list = new List<BookingLogDto>();
|
|
|
|
|
var main = await _bookinglog.AsQueryable().Where(u => u.BookingId == bookingId).ToListAsync();
|
|
|
|
|
list = main.Adapt<List<BookingLogDto>>();
|
|
|
|
@ -7695,6 +7714,13 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
allData.log = list;
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 3 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var order = _rep.Where(x => x.Id == bookingId).First();
|
|
|
|
|
var userid = order.CreatedUserId;
|
|
|
|
|
var username = order.CreatedUserName;
|
|
|
|
@ -7702,6 +7728,12 @@ namespace Myshipping.Application
|
|
|
|
|
{
|
|
|
|
|
_GoodsConfig.InitGoodsStatusConfig(Convert.ToInt64(userid), username);
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 4 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var GoodsStatus = await _goodsStatus.AsQueryable().LeftJoin(_goodsStatusConfig.AsQueryable(),
|
|
|
|
|
(goods, config) => config.Id == goods.ConfigId).Where((goods, config) => config.CreatedUserId == userid && goods.bookingId == bookingId).
|
|
|
|
@ -7721,6 +7753,13 @@ namespace Myshipping.Application
|
|
|
|
|
Sort = config.Sort
|
|
|
|
|
}).ToListAsync();
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 5 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var config = _goodsStatusConfig.AsQueryable().Where(config => config.CreatedUserId == userid).ToList().Select(config => new GoodsStatusQuery
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -7736,6 +7775,13 @@ namespace Myshipping.Application
|
|
|
|
|
Sort = config.Sort
|
|
|
|
|
}).ToList();
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 6 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach (var item in GoodsStatus)
|
|
|
|
|
{
|
|
|
|
|
config.RemoveAll(x => x.ConfigId == item.ConfigId);
|
|
|
|
@ -7745,6 +7791,13 @@ namespace Myshipping.Application
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allData.GoodsStatus = GoodsStatus.Union<GoodsStatusQuery>(config).OrderBy(x => x.Sort).ToList();
|
|
|
|
|
|
|
|
|
|
if (traceTime)
|
|
|
|
|
{
|
|
|
|
|
var et = DateTime.Now - ticks;
|
|
|
|
|
ticks = DateTime.Now;
|
|
|
|
|
_logger.LogInformation($"GetAllData Stage 7 {et.TotalMilliseconds}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|