# Conflicts:
#	ZR.Admin.WebApi/Controllers/mes/wms/WmOutOrderController.cs
This commit is contained in:
赵正易 2024-03-28 08:53:41 +08:00
commit cf2d240216
2 changed files with 9 additions and 3 deletions

View File

@ -215,6 +215,7 @@ namespace ZR.Admin.WebApi.Controllers
public IActionResult checkProductionOut(string production_packcode = "", string shipment_num = "")
{
string msg = "可出库";
return ToResponse(new ApiResult(200, msg, true));
}

View File

@ -245,7 +245,7 @@ namespace ZR.Service.mes.wms
public List<WmMaterialQuery_print> Queryoutoder_matrials(string shipment_num)
{
List<WmMaterialQuery_print> stockList = Context.Queryable<WmMaterialOutorder>()
List<WmMaterialQuery_print> stockList = Context.Queryable<WmMaterialOutorder>()
.LeftJoin<WmMaterial>((mo, m) => mo.FkMaterialId == m.Id)
.Where(mo => mo.FkOutorderId == shipment_num)
.Select((mo, m) => new WmMaterialQuery_print()
@ -257,15 +257,20 @@ namespace ZR.Service.mes.wms
//需求零件数
RequireOutNum = mo.OuthouseNum
}).ToList();
if (stockList != null && stockList.Count > 0)
{
foreach (var stock in stockList)
{
//现有箱数
stock.PackageNum = Context.Queryable<WmGoodsNowProduction>().Where(it => it.Partnumber == stock.Partnumber).Count();
stock.PackageNum = Context.Queryable<WmGoodsNowProduction>()
.Where(it => it.Partnumber == stock.Partnumber).Count();
//现有零件数
int? num = Context.Queryable<WmGoodsNowProduction>().Where(it => it.Partnumber == stock.Partnumber).Sum(it => it.GoodsNumLogic);
int? num = Context.Queryable<WmGoodsNowProduction>()
.Where(it => it.Partnumber == stock.Partnumber)
.Sum(it => it.GoodsNumLogic);
stock.ItemNum = num ?? 0;
}
}