optimize
wet 2 years ago
parent d97ca50806
commit 6fb04b9dee

@ -1352,7 +1352,12 @@ namespace Myshipping.Application
await _goodsStatus.InsertAsync(entity);
}
var userid = _rep.Where(x => x.Id == input.BookingId).Select(x => x.CreatedUserId).First();
var order = _rep.Where(x => x.Id == input.BookingId).First();
var userid = order.CreatedUserId;
if (userid != null)
{
@ -1374,7 +1379,7 @@ namespace Myshipping.Application
}).ToListAsync();
var config = _goodsStatusConfig.AsQueryable().Where(config => config.CreatedUserId == userid).ToList().Select(config => new GoodsStatusQuery
var config = _goodsStatusConfig.AsQueryable().Where(config => config.CreatedUserId == userid).ToList().DistinctBy(x => x.StatusName).Select(config => new GoodsStatusQuery
{
ConfigId = config.Id,
@ -1393,14 +1398,35 @@ namespace Myshipping.Application
{
config.RemoveAll(x => x.ConfigId == item.ConfigId);
}
var t = list.Union<GoodsStatusQuery>(config).OrderBy(x => x.Sort).ToList();
if (t!=null) {
var StatusName= t.OrderBy(x => x.FinishTime).Select(x => x.StatusName).First();
order.BSSTATUSNAME = StatusName;
await _rep.AsUpdateable(order).IgnoreColumns(it => new
{
it.ParentId,
it.TenantId,
it.CreatedTime,
it.CreatedUserId,
it.CreatedUserName,
it.TenantName,
it.IsDeleted,
it.BOOKINGNO
}).ExecuteCommandAsync();
return list.Union<GoodsStatusQuery>(config).OrderBy(x => x.Sort).ToList();
}
return t;
}
return null;
}
/// <summary>
/// 获取货物状态
/// </summary>

Loading…
Cancel
Save