优化接口

This commit is contained in:
tongfei
2023-12-06 10:46:02 +08:00
parent 033f442e9d
commit fd7cc0edaf
3 changed files with 48 additions and 35 deletions

View File

@@ -1304,12 +1304,22 @@
</member> </member>
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.OperatorId"> <member name="P:WMS.Web.Domain.Entitys.OutStockTask.OperatorId">
<summary> <summary>
操作人(出库人) 操作人
</summary> </summary>
</member> </member>
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.OperateTime"> <member name="P:WMS.Web.Domain.Entitys.OutStockTask.OperateTime">
<summary> <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> </summary>
</member> </member>
<member name="P:WMS.Web.Domain.Entitys.OutStockTask.CreateTime"> <member name="P:WMS.Web.Domain.Entitys.OutStockTask.CreateTime">
@@ -1322,7 +1332,7 @@
明细 明细
</summary> </summary>
</member> </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>
出库 反写 任务单(返回 这个物料下面的来源单号出了多少数量) 出库 反写 任务单(返回 这个物料下面的来源单号出了多少数量)
</summary> </summary>

View File

@@ -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(); 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为比对失败; //3.比对false为比对失败;
bool isRight = boxDetails.All(x => task_details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty >= x.Qty)) && boxDetails.Count <= task_details.Count; bool isRight = boxDetails.All(x => task_details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty >= x.Qty)) && boxDetails.Count <= task_details.Count;
if (!isRight) if (!isRight)
{ {
var qtyIsError = boxDetails.All(x => task_details.Any(t => t.MaterialId == x.MaterialId && t.AccruedQty < x.Qty)); 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 (boxDetails.Count > task_details.Count && qtyIsError)
{
if (task.Type == InstockType.Purchase)
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Purchase_Error); return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Purchase_Error);
else
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.ContrastError);
}
else if (qtyIsError) else if (qtyIsError)
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Qty_Error); return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Qty_Error);
else else
{
if (task.Type == InstockType.Purchase)
return Result<ContrastMaterialsResponse>.ReFailure(ResultCodes.Contrast_Purchase_Count_Error); 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.是否任务单存在绑定箱号判断:存在的话,就不能收货或者非采购上架 //4.是否任务单存在绑定箱号判断:存在的话,就不能收货或者非采购上架
@@ -588,5 +589,7 @@ namespace WMS.Web.Domain.Services
} }
return Result<ContrastMaterialsResponse>.ReSuccess(response); return Result<ContrastMaterialsResponse>.ReSuccess(response);
} }
} }
} }

View File

@@ -46,7 +46,7 @@ namespace WMS.Web.Domain.Values
public static ValueTuple<int, string> Box_NoBind_Task_Data = (80001, "该箱号不在收货信息中,请核对再试!"); public static ValueTuple<int, string> Box_NoBind_Task_Data = (80001, "该箱号不在收货信息中,请核对再试!");
public static ValueTuple<int, string> OrderNoData = (80002, "单据信息不存在,请核对后再试!"); public static ValueTuple<int, string> OrderNoData = (80002, "单据信息不存在,请核对后再试!");
public static ValueTuple<int, string> ContrastError = (80003, "箱内产品和数量与来源单不一致"); 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_Purchase_Count_Error = (80003, "箱内产品和采购单不一致");
public static ValueTuple<int, string> Contrast_Count_Error = (80003, "箱内产品和来源单不一致"); public static ValueTuple<int, string> Contrast_Count_Error = (80003, "箱内产品和来源单不一致");
public static ValueTuple<int, string> Contrast_Qty_Error = (80003, "箱内产品数量超过可入库数量"); public static ValueTuple<int, string> Contrast_Qty_Error = (80003, "箱内产品数量超过可入库数量");