optimize
wet 1 year ago
parent 7de6f5a348
commit ce5a60c160

@ -392,18 +392,18 @@ namespace Myshipping.Application
Sort = config.Sort Sort = config.Sort
}).ToList(); }).ToList();
var itconfigs = _goodsStatusConfig.AsQueryable().Select(config => new //var itconfigs = _goodsStatusConfig.AsQueryable().Select(config => new
{ //{
bookingid = "", // bookingid = "",
ConfigId = config.Id, // ConfigId = config.Id,
SystemCode = config.SystemCode, // SystemCode = config.SystemCode,
StatusName = config.StatusName, // StatusName = config.StatusName,
FinishTime = "", // FinishTime = "",
ExtData = "", // ExtData = "",
Remark = "", // Remark = "",
CreatedUserId = config.CreatedUserId, // CreatedUserId = config.CreatedUserId,
Sort = config.Sort // Sort = config.Sort
}).ToList(); //}).ToList();
var statusloglist = _repStatuslog.AsQueryable().Where(x => (x.Status == "提箱" || x.Status == "返场")).ToList(); var statusloglist = _repStatuslog.AsQueryable().Where(x => (x.Status == "提箱" || x.Status == "返场")).ToList();
var statuslogdetaillist = _statuslogdetail.AsQueryable().ToList(); var statuslogdetaillist = _statuslogdetail.AsQueryable().ToList();
foreach (var item in list.Items) foreach (var item in list.Items)
@ -475,24 +475,24 @@ namespace Myshipping.Application
Sort = x.Sort Sort = x.Sort
}).ToList(); }).ToList();
var itconfig = itconfigs.Where(x => x.CreatedUserId == item.CreatedUserId).OrderBy(x => x.Sort). //var itconfig = itconfigs.Where(x => x.CreatedUserId == item.CreatedUserId).OrderBy(x => x.Sort).
Select(x => new GoodsStatusList // Select(x => new GoodsStatusList
{ // {
ConfigId = x.ConfigId, // ConfigId = x.ConfigId,
StatusName = x.StatusName, // StatusName = x.StatusName,
SystemCode = x.SystemCode, // SystemCode = x.SystemCode,
FinishTime = null, // FinishTime = null,
ExtData = x.ExtData, // ExtData = x.ExtData,
Remark = x.Remark, // Remark = x.Remark,
Sort = x.Sort // Sort = x.Sort
}).ToList(); // }).ToList();
foreach (var ii in itgoods) //foreach (var ii in itgoods)
{ //{
itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId); // itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId);
} //}
item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList(); item.GoodsStatusList = itgoods;
//获取提箱返场状态 //获取提箱返场状态
var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList(); var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>(); var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
@ -723,18 +723,18 @@ namespace Myshipping.Application
Sort = config.Sort Sort = config.Sort
}).ToList(); }).ToList();
var itconfigs = _goodsStatusConfig.AsQueryable().Select(config => new //var itconfigs = _goodsStatusConfig.AsQueryable().Select(config => new
{ //{
bookingid = "", // bookingid = "",
ConfigId = config.Id, // ConfigId = config.Id,
SystemCode = config.SystemCode, // SystemCode = config.SystemCode,
StatusName = config.StatusName, // StatusName = config.StatusName,
FinishTime = "", // FinishTime = "",
ExtData = "", // ExtData = "",
Remark = "", // Remark = "",
CreatedUserId = config.CreatedUserId, // CreatedUserId = config.CreatedUserId,
Sort = config.Sort // Sort = config.Sort
}).ToList(); //}).ToList();
var statusloglist = _repStatuslog.AsQueryable().Where(x=> (x.Status == "提箱" || x.Status == "返场")).ToList(); var statusloglist = _repStatuslog.AsQueryable().Where(x=> (x.Status == "提箱" || x.Status == "返场")).ToList();
var statuslogdetaillist = _statuslogdetail.AsQueryable().ToList(); var statuslogdetaillist = _statuslogdetail.AsQueryable().ToList();
foreach (var item in list.Items) foreach (var item in list.Items)
@ -806,24 +806,24 @@ namespace Myshipping.Application
Sort = x.Sort Sort = x.Sort
}).ToList(); }).ToList();
var itconfig = itconfigs.Where(x => x.CreatedUserId == item.CreatedUserId).OrderBy(x => x.Sort). //var itconfig = itconfigs.Where(x => x.CreatedUserId == item.CreatedUserId).OrderBy(x => x.Sort).
Select(x => new GoodsStatusList // Select(x => new GoodsStatusList
{ // {
ConfigId = x.ConfigId, // ConfigId = x.ConfigId,
StatusName = x.StatusName, // StatusName = x.StatusName,
SystemCode = x.SystemCode, // SystemCode = x.SystemCode,
FinishTime = null, // FinishTime = null,
ExtData = x.ExtData, // ExtData = x.ExtData,
Remark = x.Remark, // Remark = x.Remark,
Sort = x.Sort // Sort = x.Sort
}).ToList(); // }).ToList();
foreach (var ii in itgoods) //foreach (var ii in itgoods)
{ //{
itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId); // itconfig.RemoveAll(x => x.ConfigId == ii.ConfigId);
} //}
item.GoodsStatusList = itgoods.Union<GoodsStatusList>(itconfig).OrderBy(x => x.Sort).ToList(); item.GoodsStatusList = itgoods;
//获取提箱返场状态 //获取提箱返场状态
var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList(); var statuslog = statusloglist.Where(x => x.BookingId == item.Id).OrderByDescending(x => x.CreatedTime).ToList();
var dto = statuslog.Adapt<List<BookingStatusLogDto>>(); var dto = statuslog.Adapt<List<BookingStatusLogDto>>();
@ -2206,7 +2206,11 @@ namespace Myshipping.Application
throw Oops.Bah(html.Message); throw Oops.Bah(html.Message);
} }
} }
/// <summary>
/// 即时刷新运踪
/// </summary>
/// <param name="Ids"></param>
/// <returns></returns>
[HttpPost("/BookingOrder/RefreshBillTrace")] [HttpPost("/BookingOrder/RefreshBillTrace")]
public async Task RefreshBillTrace(string Ids) { public async Task RefreshBillTrace(string Ids) {

Loading…
Cancel
Save