去掉排序
This commit is contained in:
@@ -108,9 +108,9 @@ namespace WMS.Web.Core.Dto
|
||||
/// </summary>
|
||||
public decimal ProductQty { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 排序
|
||||
/// </summary>
|
||||
public int Sort { get; set; }
|
||||
///// <summary>
|
||||
///// 排序
|
||||
///// </summary>
|
||||
//public int Sort { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,43 +61,45 @@ namespace WMS.Web.Domain.Services
|
||||
//返回列表-对应刚刚生成的数据和编号集合
|
||||
var list= await _boxMarkRepositories.GetListInfoBy(model.Id, loginInfo.UserInfo.CompanyId);
|
||||
|
||||
//处理-批次生成的排序和总数量
|
||||
var resultList = new List<BoxMarkQueryResponse>();
|
||||
|
||||
|
||||
if (list != null && list.Count != 0)
|
||||
{
|
||||
//处理-总数量
|
||||
list.ForEach(x =>
|
||||
{
|
||||
x.BoxSortCount = this.GetSortCount(x.ProductQty, x.CratingQty);
|
||||
|
||||
});
|
||||
|
||||
var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
||||
foreach (var id in ids)
|
||||
{
|
||||
//var resultList = new List<BoxMarkQueryResponse>();
|
||||
//var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
||||
//foreach (var id in ids)
|
||||
//{
|
||||
|
||||
var itemDetailId = 0;
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (id == item.Id)
|
||||
{
|
||||
// var itemDetailId = 0;
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// if (id == item.Id)
|
||||
// {
|
||||
|
||||
var current = resultList.Where(x => x.DetailId == itemDetailId).FirstOrDefault();
|
||||
// var current = resultList.Where(x => x.DetailId == itemDetailId).FirstOrDefault();
|
||||
|
||||
var newItem = item;
|
||||
if (current == null)
|
||||
newItem.Sort = 1;
|
||||
else
|
||||
newItem.Sort = current.Sort + 1;
|
||||
resultList.Add(newItem);
|
||||
itemDetailId = item.DetailId;
|
||||
}
|
||||
}
|
||||
}
|
||||
// var newItem = item;
|
||||
// if (current == null)
|
||||
// newItem.Sort = 1;
|
||||
// else
|
||||
// newItem.Sort = current.Sort + 1;
|
||||
// resultList.Add(newItem);
|
||||
// itemDetailId = item.DetailId;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ResultList<BoxMarkQueryResponse>.ReSuccess(resultList);
|
||||
return ResultList<BoxMarkQueryResponse>.ReSuccess(list);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -110,7 +112,7 @@ namespace WMS.Web.Domain.Services
|
||||
{
|
||||
var (list, count) = await _boxMarkRepositories.GetPagedList(dto, companyId);
|
||||
|
||||
var resultList = new List<BoxMarkQueryResponse>();
|
||||
//var resultList = new List<BoxMarkQueryResponse>();
|
||||
|
||||
if (list != null && list.Count != 0)
|
||||
{
|
||||
@@ -120,33 +122,33 @@ namespace WMS.Web.Domain.Services
|
||||
|
||||
});
|
||||
|
||||
var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
||||
foreach (var id in ids)
|
||||
{
|
||||
//var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
||||
//foreach (var id in ids)
|
||||
//{
|
||||
|
||||
var itemDetailId = 0;
|
||||
foreach (var item in list)
|
||||
{
|
||||
if (id == item.Id)
|
||||
{
|
||||
// var itemDetailId = 0;
|
||||
// foreach (var item in list)
|
||||
// {
|
||||
// if (id == item.Id)
|
||||
// {
|
||||
|
||||
var current= resultList.Where(x => x.DetailId == itemDetailId).FirstOrDefault();
|
||||
// var current= resultList.Where(x => x.DetailId == itemDetailId).FirstOrDefault();
|
||||
|
||||
var newItem = item;
|
||||
if (current == null)
|
||||
newItem.Sort =1;
|
||||
else
|
||||
newItem.Sort = current.Sort+ 1;
|
||||
resultList.Add(newItem);
|
||||
itemDetailId = item.DetailId;
|
||||
}
|
||||
}
|
||||
}
|
||||
// var newItem = item;
|
||||
// if (current == null)
|
||||
// newItem.Sort =1;
|
||||
// else
|
||||
// newItem.Sort = current.Sort+ 1;
|
||||
// resultList.Add(newItem);
|
||||
// itemDetailId = item.DetailId;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return (resultList, count);
|
||||
return (list, count);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user