optimize
wet 1 year ago
parent fc0dfaa6b5
commit 8f6b36c28f

@ -404,7 +404,8 @@ namespace Myshipping.Application
CreatedUserId = config.CreatedUserId,
Sort = config.Sort
}).ToList();
var statusloglist = _repStatuslog.AsQueryable().Where(x => (x.Status == "提箱" || x.Status == "返场")).ToList();
var statuslogdetaillist = _statuslogdetail.AsQueryable().ToList();
foreach (var item in list.Items)
{
var sta = _repBookingStatus.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).ToList();
@ -492,11 +493,12 @@ namespace Myshipping.Application
}
item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList();
var statuslog = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id&&(x.Status== "提箱"|| x.Status == "返场")).OrderByDescending(x => x.CreatedTime).ToListAsync();
//获取提箱返场状态
var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
foreach (var it in dto)
{
var detail = await _statuslogdetail.AsQueryable().Where(x => x.PId == it.Id).ToListAsync();
var detail = statuslogdetaillist.Where(x => x.PId == it.Id).ToList();
it.detail = detail.Adapt<List<BookingStatusLogDetailDto>>();
}
item.statuslogs = dto;
@ -733,7 +735,8 @@ namespace Myshipping.Application
CreatedUserId = config.CreatedUserId,
Sort = config.Sort
}).ToList();
var statusloglist = _repStatuslog.AsQueryable().Where(x=> (x.Status == "提箱" || x.Status == "返场")).ToList();
var statuslogdetaillist = _statuslogdetail.AsQueryable().ToList();
foreach (var item in list.Items)
{
var sta = _repBookingStatus.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id).ToList();
@ -821,11 +824,12 @@ namespace Myshipping.Application
}
item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList();
var statuslog = await _repStatuslog.AsQueryable().Filter(null, true).Where(x => x.BookingId == item.Id && (x.Status == "提箱" || x.Status == "返场")).OrderByDescending(x => x.CreatedTime).ToListAsync();
//获取提箱返场状态
var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
foreach (var it in dto)
{
var detail = await _statuslogdetail.AsQueryable().Where(x => x.PId == it.Id).ToListAsync();
var detail = statuslogdetaillist.Where(x => x.PId == it.Id).ToList();
it.detail = detail.Adapt<List<BookingStatusLogDetailDto>>();
}
item.statuslogs = dto;
@ -2163,7 +2167,7 @@ namespace Myshipping.Application
OldValue = "",
NewValue = status,
});
if (!string.IsNullOrWhiteSpace(item.CARRIERID))

Loading…
Cancel
Save