接口优化
This commit is contained in:
@@ -198,9 +198,25 @@ namespace WMS.Web.Domain.Services
|
|||||||
//需要同步金蝶
|
//需要同步金蝶
|
||||||
|
|
||||||
entity = await _inStockRepositories.Add(entity, isTransaction);
|
entity = await _inStockRepositories.Add(entity, isTransaction);
|
||||||
|
if (entity == null)
|
||||||
|
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
|
||||||
if (entity != null)
|
//同步金蝶后,反写任务单的已交数量
|
||||||
|
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 =>
|
||||||
|
{
|
||||||
|
var current_dto_det = dto.Details.Where(x => x.MaterialId == x.MaterialId).FirstOrDefault();
|
||||||
|
if (current_dto_det != null)
|
||||||
|
x.DeliveredQty = current_dto_det.Qty;
|
||||||
|
});
|
||||||
|
task=await _inStockTaskRepositories.Update(task);
|
||||||
|
if(task==null)
|
||||||
|
return Result.ReFailure(ResultCodes.DateWriteError);
|
||||||
|
}
|
||||||
|
|
||||||
//保存成功后:序列号跟踪流程添加
|
//保存成功后:序列号跟踪流程添加
|
||||||
var serialNumber_result = await _serialNumberService.InStock(entity, loginInfo, isTransaction);
|
var serialNumber_result = await _serialNumberService.InStock(entity, loginInfo, isTransaction);
|
||||||
if (!serialNumber_result.IsSuccess)
|
if (!serialNumber_result.IsSuccess)
|
||||||
@@ -233,9 +249,8 @@ namespace WMS.Web.Domain.Services
|
|||||||
return boxInventoryResult;
|
return boxInventoryResult;
|
||||||
|
|
||||||
return Result.ReSuccess();
|
return Result.ReSuccess();
|
||||||
}
|
|
||||||
else
|
|
||||||
return Result.ReFailure(ResultCodes.DateWriteError);
|
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 非采购上架-保存
|
/// 非采购上架-保存
|
||||||
@@ -256,7 +271,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
entity.Type = task.Type;
|
entity.Type = task.Type;
|
||||||
entity.Details = new List<InStockDetails>();
|
entity.Details = new List<InStockDetails>();
|
||||||
|
|
||||||
var temps=new List<InStockDetails>();
|
var temps = new List<InStockDetails>();
|
||||||
//3.遍历:box信息,并拼装入库单明细
|
//3.遍历:box信息,并拼装入库单明细
|
||||||
foreach (var box in dto.Boxs)
|
foreach (var box in dto.Boxs)
|
||||||
{
|
{
|
||||||
@@ -271,7 +286,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
item.SubStockId = dto.SubStockId;
|
item.SubStockId = dto.SubStockId;
|
||||||
item.StockCode = dto.StockCode;
|
item.StockCode = dto.StockCode;
|
||||||
|
|
||||||
var taskDet= task.Details.Where(x => x.MaterialId == item.MaterialId).FirstOrDefault();
|
var taskDet = task.Details.Where(x => x.MaterialId == item.MaterialId).FirstOrDefault();
|
||||||
item.SupplierId = taskDet.SupplierId;
|
item.SupplierId = taskDet.SupplierId;
|
||||||
item.OrgId = taskDet.OrgId;
|
item.OrgId = taskDet.OrgId;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ namespace WMS.Web.Domain.Services
|
|||||||
{
|
{
|
||||||
//2.1.2修改数量
|
//2.1.2修改数量
|
||||||
item.AccruedQty = erp_data.Qty;
|
item.AccruedQty = erp_data.Qty;
|
||||||
item.DeliveredQty = erp_data.DeliveredQty;
|
item.DeliveredQty = erp_data.DeliveredQty> item.DeliveredQty? erp_data.DeliveredQty: item.DeliveredQty;
|
||||||
erp_remove_billNo.Add(data.SourceBillNo);
|
erp_remove_billNo.Add(data.SourceBillNo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user