tt
This commit is contained in:
@@ -148,7 +148,7 @@ namespace WMS.Web.Domain.Services
|
||||
//1.先判断:箱号已经绑定了入库任务单中;备注:业务说法就是箱是否收货了
|
||||
var tast = await _inStockTaskRepositories.GetBy(boxBillNo);
|
||||
if (tast == null)
|
||||
return Result<BoxInStockTaskDto>.ReFailure(ResultCodes.Box_NoBind_Task_Data);
|
||||
return Result<BoxInStockTaskDto>.ReFailure(ResultCodes.Box_NoBind_Task_Data);
|
||||
|
||||
//2.找到箱对应的物料信息
|
||||
var box = await _boxRepositories.GetByNo(boxBillNo);
|
||||
@@ -157,7 +157,7 @@ namespace WMS.Web.Domain.Services
|
||||
|
||||
//2.1判断箱是否上架过了
|
||||
var isExist = await _inStockRepositories.IsExistBy(box.Id);
|
||||
if(isExist)
|
||||
if (isExist)
|
||||
return Result<BoxInStockTaskDto>.ReFailure(ResultCodes.BoxIsTrueShelf);
|
||||
|
||||
//3.组装返回数据
|
||||
@@ -168,7 +168,7 @@ namespace WMS.Web.Domain.Services
|
||||
foreach (var item in box.Details)
|
||||
{
|
||||
//这里找任务单的物料条件:物料ID和应入库数量大于收货数量,防止有同样的物料数据,收货的时候 会有收货数量,只要找到没有收完的就行了
|
||||
var current_task_Det= tast.Details.Where(x => x.MaterialId == item.MaterialId && x.AccruedQty>x.ReceiveQty).FirstOrDefault();
|
||||
var current_task_Det = tast.Details.Where(x => x.MaterialId == item.MaterialId && x.AccruedQty > x.ReceiveQty).FirstOrDefault();
|
||||
//3.2映射返回明细对象
|
||||
var box_task_detail = new BoxDetailsInStockTaskDto();
|
||||
box_task_detail.SupplierId = current_task_Det == null ? 0 : current_task_Det.SupplierId;
|
||||
@@ -204,7 +204,7 @@ namespace WMS.Web.Domain.Services
|
||||
|
||||
|
||||
//序列号集:箱里面的
|
||||
var serialNumbers = await _serialNumbersRepositories.GetEntityListByBoxIds(dto.Details.GroupBy(x=>x.BoxId).Select(x => x.Key).ToList());
|
||||
var serialNumbers = await _serialNumbersRepositories.GetEntityListByBoxIds(dto.Details.GroupBy(x => x.BoxId).Select(x => x.Key).ToList());
|
||||
|
||||
//赋值序列号
|
||||
entity.Details.ForEach(x =>
|
||||
@@ -222,8 +222,8 @@ namespace WMS.Web.Domain.Services
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
|
||||
//同步金蝶后,反写任务单的已交数量
|
||||
var taskId= dto.Details.GroupBy(x => x.TaskId).Select(x=>x.Key).FirstOrDefault();
|
||||
var task= await _inStockTaskRepositories.Get(taskId);
|
||||
var taskId = dto.Details.GroupBy(x => x.TaskId).Select(x => x.Key).FirstOrDefault();
|
||||
var task = await _inStockTaskRepositories.Get(taskId);
|
||||
if (task != null)
|
||||
{
|
||||
task.Details.ForEach(x =>
|
||||
@@ -231,8 +231,8 @@ namespace WMS.Web.Domain.Services
|
||||
x.DeliveredQty = x.ReceiveQty;
|
||||
});
|
||||
task.Shelf(loginInfo.UserInfo.StaffId);
|
||||
task =await _inStockTaskRepositories.Update(task,isTransaction);
|
||||
if(task==null)
|
||||
task = await _inStockTaskRepositories.Update(task, isTransaction);
|
||||
if (task == null)
|
||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||
}
|
||||
|
||||
@@ -286,8 +286,8 @@ namespace WMS.Web.Domain.Services
|
||||
item.BoxId = box.BoxId;
|
||||
item.SubStockId = dto.SubStockId;
|
||||
item.StockCode = dto.StockCode;
|
||||
item.OrgCode = dto.OrgCode;
|
||||
item.OrgId = task.Details.Select(x=>x.OrgId).FirstOrDefault();
|
||||
item.OrgCode = dto.OrgCode;
|
||||
item.OrgId = task.Details.Select(x => x.OrgId).FirstOrDefault();
|
||||
});
|
||||
//3.3添加到临时集合中
|
||||
temps.AddRange(dets);
|
||||
@@ -325,7 +325,8 @@ namespace WMS.Web.Domain.Services
|
||||
task.Details.ForEach(x =>
|
||||
{
|
||||
var current_entityDet_matQty = entity.Details.Where(t => t.MaterialId == x.MaterialId).Sum(t => t.Qty);
|
||||
if (x.AccruedQty > current_entityDet_matQty) {
|
||||
if (x.AccruedQty > current_entityDet_matQty)
|
||||
{
|
||||
x.ReceiveQty = x.ReceiveQty + current_entityDet_matQty;
|
||||
x.DeliveredQty = x.ReceiveQty;
|
||||
}
|
||||
@@ -454,7 +455,7 @@ namespace WMS.Web.Domain.Services
|
||||
|
||||
|
||||
//1.1筛选出对应仓库的明细
|
||||
var task_details = task.Details.Where(x => x.StockCode == dto.StockCode).ToList();
|
||||
var task_details = task.Details.Where(x => x.StockCode == dto.StockCode).ToList();
|
||||
|
||||
//2.找到箱对应的物料信息:多个箱
|
||||
var boxs = await _boxRepositories.GetEntityListByNos(dto.BoxBillNos);
|
||||
@@ -483,7 +484,7 @@ namespace WMS.Web.Domain.Services
|
||||
r_box.BoxBillNo = box.BoxBillNo;
|
||||
r_box.BoxId = box.Id;
|
||||
r_box.TotalCount = box.Details.Sum(x => x.Qty);
|
||||
r_box.Details = _mapper.Map<List<ContrastBoxDetailsResponse>>(box.Details);
|
||||
r_box.Details = _mapper.Map<List<ContrastBoxDetailsResponse>>(box.Details);
|
||||
response.Boxs.Add(r_box);
|
||||
}
|
||||
return Result<ContrastMaterialsResponse>.ReSuccess(response);
|
||||
|
||||
Reference in New Issue
Block a user