This commit is contained in:
tongfei
2024-02-21 11:06:43 +08:00
parent 828323a6b9
commit 3b4b9ca593
5 changed files with 61 additions and 46 deletions

View File

@@ -129,10 +129,13 @@ namespace WMS.Web.Domain.Entitys
if (hasPart)
boxCount = Convert.ToInt32(Math.Ceiling(boxCount_tag));
for (int i = 0; i < boxCount; i++)
for (int i = 1; i <= boxCount; i++)
{
//添加编号生成
var bill = new BoxMarkBillNo();
var bill = new BoxMarkBillNo();
bill.Sort = i;
if (hasPart && i == boxCount)
bill.IsTail = true;
bill.GenerateBillNo(firstBillNo, lastBillNo);
this.BillNos.Add(bill);
@@ -141,8 +144,8 @@ namespace WMS.Web.Domain.Entitys
lastBillNo = bill.LastBillNo;
}
//判断有小数点,那么它就有尾箱,把当前第一条的编号是否是尾箱字段改为true
if (this.BillNos.Count != 0 && hasPart)
this.BillNos[0].IsTail = true;
//if (this.BillNos.Count != 0 && hasPart)
// this.BillNos[0].IsTail = true;
}
}

View File

@@ -43,6 +43,11 @@ namespace WMS.Web.Domain.Entitys
/// </summary>
public bool IsTail { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 生成编号
/// </summary>

View File

@@ -62,7 +62,7 @@ namespace WMS.Web.Domain.Services
var list= await _boxMarkRepositories.GetListInfoBy(model.Id, loginInfo.UserInfo.CompanyId);
var resultList = new List<BoxMarkQueryResponse>();
//var resultList = new List<BoxMarkQueryResponse>();
if (list != null && list.Count != 0)
{
//处理-总数量
@@ -72,31 +72,31 @@ 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<BoxMarkQueryResponse>.ReSuccess(resultList);
return ResultList<BoxMarkQueryResponse>.ReSuccess(list);
}
/// <summary>
@@ -109,7 +109,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)
{
@@ -119,28 +119,28 @@ namespace WMS.Web.Domain.Services
});
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 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 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 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, count);
return (list, count);
}
/// <summary>