接口优化
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>
|
||||||
/// 非采购上架-保存
|
/// 非采购上架-保存
|
||||||
|
|||||||
@@ -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