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