优化接口
This commit is contained in:
@@ -450,6 +450,11 @@
|
|||||||
产品数量
|
产品数量
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:WMS.Web.Core.Dto.BoxMarkQueryResponse.Sort">
|
||||||
|
<summary>
|
||||||
|
排序
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:WMS.Web.Core.Dto.GenerateBoxMarkDto">
|
<member name="T:WMS.Web.Core.Dto.GenerateBoxMarkDto">
|
||||||
<summary>
|
<summary>
|
||||||
生成箱唛dto
|
生成箱唛dto
|
||||||
|
|||||||
@@ -108,9 +108,9 @@ namespace WMS.Web.Core.Dto
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public decimal ProductQty { get; set; }
|
public decimal ProductQty { get; set; }
|
||||||
|
|
||||||
///// <summary>
|
/// <summary>
|
||||||
///// 排序
|
/// 排序
|
||||||
///// </summary>
|
/// </summary>
|
||||||
//public int Sort { get; set; }
|
public int Sort { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,8 +61,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
//返回列表-对应刚刚生成的数据和编号集合
|
//返回列表-对应刚刚生成的数据和编号集合
|
||||||
var list= await _boxMarkRepositories.GetListInfoBy(model.Id, loginInfo.UserInfo.CompanyId);
|
var list= await _boxMarkRepositories.GetListInfoBy(model.Id, loginInfo.UserInfo.CompanyId);
|
||||||
|
|
||||||
|
|
||||||
|
var resultList = new List<BoxMarkQueryResponse>();
|
||||||
if (list != null && list.Count != 0)
|
if (list != null && list.Count != 0)
|
||||||
{
|
{
|
||||||
//处理-总数量
|
//处理-总数量
|
||||||
@@ -72,34 +72,31 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//var resultList = new List<BoxMarkQueryResponse>();
|
var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
||||||
//var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
foreach (var id in ids)
|
||||||
//foreach (var id in ids)
|
{
|
||||||
//{
|
|
||||||
|
|
||||||
// var itemDetailId = 0;
|
var itemDetailId = 0;
|
||||||
// foreach (var item in list)
|
foreach (var item in list)
|
||||||
// {
|
{
|
||||||
// if (id == item.Id)
|
if (id == item.Id)
|
||||||
// {
|
{
|
||||||
|
|
||||||
// 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 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ResultList<BoxMarkQueryResponse>.ReSuccess(list);
|
return ResultList<BoxMarkQueryResponse>.ReSuccess(resultList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -112,7 +109,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
var (list, count) = await _boxMarkRepositories.GetPagedList(dto, companyId);
|
var (list, count) = await _boxMarkRepositories.GetPagedList(dto, companyId);
|
||||||
|
|
||||||
//var resultList = new List<BoxMarkQueryResponse>();
|
var resultList = new List<BoxMarkQueryResponse>();
|
||||||
|
|
||||||
if (list != null && list.Count != 0)
|
if (list != null && list.Count != 0)
|
||||||
{
|
{
|
||||||
@@ -122,33 +119,28 @@ namespace WMS.Web.Domain.Services
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
var ids = list.GroupBy(x => x.Id).Select(x => x.Key).ToList();
|
||||||
//foreach (var id in ids)
|
foreach (var id in ids)
|
||||||
//{
|
{
|
||||||
|
var itemDetailId = 0;
|
||||||
// var itemDetailId = 0;
|
foreach (var item in list)
|
||||||
// foreach (var item in list)
|
{
|
||||||
// {
|
if (id == item.Id)
|
||||||
// if (id == item.Id)
|
{
|
||||||
// {
|
var current = resultList.Where(x => x.DetailId == itemDetailId).FirstOrDefault();
|
||||||
|
var newItem = item;
|
||||||
// var current= resultList.Where(x => x.DetailId == itemDetailId).FirstOrDefault();
|
if (current == null)
|
||||||
|
newItem.Sort = 1;
|
||||||
// var newItem = item;
|
else
|
||||||
// if (current == null)
|
newItem.Sort = current.Sort + 1;
|
||||||
// newItem.Sort =1;
|
resultList.Add(newItem);
|
||||||
// else
|
itemDetailId = item.DetailId;
|
||||||
// newItem.Sort = current.Sort+ 1;
|
}
|
||||||
// resultList.Add(newItem);
|
}
|
||||||
// itemDetailId = item.DetailId;
|
}
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (list, count);
|
return (resultList, count);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user