优化接口
This commit is contained in:
@@ -1304,12 +1304,22 @@
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.OperatorId">
|
||||
<summary>
|
||||
操作人(出库人)
|
||||
操作人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.OperateTime">
|
||||
<summary>
|
||||
操作时间(出库时间)
|
||||
操作时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.OutStockId">
|
||||
<summary>
|
||||
出库人
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.OutStockTime">
|
||||
<summary>
|
||||
出库时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.CreateTime">
|
||||
@@ -1322,7 +1332,7 @@
|
||||
明细
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:WMS.Web.Domain.Entitys.OutStockTask.OutStock(System.Int32,System.Decimal)">
|
||||
<member name="M:WMS.Web.Domain.Entitys.OutStockTask.OutStock(System.Int32,System.Decimal,System.Int32)">
|
||||
<summary>
|
||||
出库 反写 任务单(返回 这个物料下面的来源单号出了多少数量)
|
||||
</summary>
|
||||
|
||||
@@ -542,30 +542,31 @@ namespace WMS.Web.Domain.Services
|
||||
//合并多个箱明细的数据:相同物料数量合并
|
||||
var boxDetails = boxs.SelectMany(x => x.Details).GroupBy(x => x.MaterialId).Select(x => new { MaterialId = x.Key, Qty = x.Sum(t => t.Qty) }).ToList();
|
||||
|
||||
//采购单:要对比数量
|
||||
if (task.Type == InstockType.Purchase)
|
||||
{
|
||||
//3.比对:false为比对失败;
|
||||
bool isRight = boxDetails.All(x => task_details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty >= x.Qty)) && boxDetails.Count <= task_details.Count;
|
||||
if (!isRight)
|
||||
{
|
||||
var qtyIsError = boxDetails.All(x => task_details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty < x.Qty));
|
||||
|
||||
if (boxDetails.Count > task_details.Count && qtyIsError)
|
||||
{
|
||||
if (task.Type == InstockType.Purchase)
|
||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Purchase_Error);
|
||||
else
|
||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.ContrastError);
|
||||
}
|
||||
else if (qtyIsError)
|
||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Qty_Error);
|
||||
else
|
||||
{
|
||||
if (task.Type == InstockType.Purchase)
|
||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Purchase_Count_Error);
|
||||
else
|
||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Count_Error);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//非采购单:不要对比数量,只对比物料
|
||||
else
|
||||
{
|
||||
//3.比对:false为比对失败;
|
||||
bool isRight = boxDetails.All(x => task_details.Any(t => t.MaterialId == x.MaterialId)) && boxDetails.Count <= task_details.Count;
|
||||
if (!isRight)
|
||||
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Count_Error);
|
||||
}
|
||||
|
||||
|
||||
//4.是否任务单存在绑定箱号判断:存在的话,就不能收货或者非采购上架
|
||||
@@ -588,5 +589,7 @@ namespace WMS.Web.Domain.Services
|
||||
}
|
||||
return Result<ContrastMaterialsResponse>.ReSuccess(response);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace WMS.Web.Domain.Values
|
||||
public static ValueTuple<int, string> Box_NoBind_Task_Data = (80001, "该箱号不在收货信息中,请核对再试!");
|
||||
public static ValueTuple<int, string> OrderNoData = (80002, "单据信息不存在,请核对后再试!");
|
||||
public static ValueTuple<int, string> ContrastError = (80003, "箱内产品和数量与来源单不一致");
|
||||
public static ValueTuple<int, string> Contrast_Purchase_Error = (80003, "箱内产品和数量与来源单不一致");
|
||||
public static ValueTuple<int, string> Contrast_Purchase_Error = (80003, "箱内产品和数量与采购单不一致");
|
||||
public static ValueTuple<int, string> Contrast_Purchase_Count_Error = (80003, "箱内产品和采购单不一致");
|
||||
public static ValueTuple<int, string> Contrast_Count_Error = (80003, "箱内产品和来源单不一致");
|
||||
public static ValueTuple<int, string> Contrast_Qty_Error = (80003, "箱内产品数量超过可入库数量");
|
||||
|
||||
Reference in New Issue
Block a user