Commit 60863148 authored by 吴春's avatar 吴春

提交出库审核问题

parent 620e93b9
...@@ -111,8 +111,8 @@ namespace Mall.WebApi.Controllers.Property ...@@ -111,8 +111,8 @@ namespace Mall.WebApi.Controllers.Property
//根据订单商品id查询商品信息 //根据订单商品id查询商品信息
var orderGoodsIds = string.Join(",", demodel.WarehouseOutGoodsList.Select(x => x.OrderGoodsId)); var orderGoodsIds = string.Join(",", demodel.WarehouseOutGoodsList.Select(x => x.OrderGoodsId));
var orderGoodsList = orderModule.GetOrderGoodsList(new Model.Extend.Product.RB_Goods_OrderDetail_Extend { IsOut=demodel.IsOut,TenantId = requestParm.TenantId, MallBaseId = requestParm.MallBaseId, IdList = demodel.WarehouseOutGoodsList.Select(x => x.OrderGoodsId).ToList() }); var orderGoodsList = orderModule.GetOrderGoodsList(new Model.Extend.Product.RB_Goods_OrderDetail_Extend { IsOut = demodel.IsOut, TenantId = requestParm.TenantId, MallBaseId = requestParm.MallBaseId, IdList = demodel.WarehouseOutGoodsList.Select(x => x.OrderGoodsId).ToList() });
if (demodel.WarehouseOutGoodsList.GroupBy(x => x.OrderGoodsId).Count() != orderGoodsList.Count) if (demodel.WarehouseOutGoodsList.GroupBy(x => x.OrderGoodsId).Count() != orderGoodsList.Count)
{ {
List<int> chajiList = demodel.WarehouseOutGoodsList.Select(x => x.OrderGoodsId).Except(orderGoodsList.Select(x => x.Id)).ToList(); List<int> chajiList = demodel.WarehouseOutGoodsList.Select(x => x.OrderGoodsId).Except(orderGoodsList.Select(x => x.Id)).ToList();
...@@ -161,14 +161,17 @@ namespace Mall.WebApi.Controllers.Property ...@@ -161,14 +161,17 @@ namespace Mall.WebApi.Controllers.Property
var orderGoodsDetailModel = orderGoodsList.Where(x => x.Id == item.OrderGoodsId).FirstOrDefault(); var orderGoodsDetailModel = orderGoodsList.Where(x => x.Id == item.OrderGoodsId).FirstOrDefault();
if (item.NewSpecificationSort != item.SpecificationSort)//修改了规格的判断新规格是否在物料中存在 if (item.NewSpecificationSort != item.SpecificationSort)//修改了规格的判断新规格是否在物料中存在
{ {
var materialModel = materialList.Where(x => x.GoodsId == item.NewGoodsId && x.SpecificationKey == item.NewSpecificationSort).FirstOrDefault(); var oldmaterialList = materialList.Where(x => x.GoodsId == item.NewGoodsId && x.SpecificationKey == item.NewSpecificationSort);
var materialModel = oldmaterialList.FirstOrDefault();
var orderGoodsDetail = orderGoodsList.Where(x => x.Id == item.OrderGoodsId).FirstOrDefault(); var orderGoodsDetail = orderGoodsList.Where(x => x.Id == item.OrderGoodsId).FirstOrDefault();
if (materialModel == null) if (oldmaterialList == null || !oldmaterialList.Any() || materialModel== null )
{ {
return ApiResult.Failed("订单号:" + orderGoodsDetail?.OrderNo + "的商品:" + orderGoodsDetail?.GoodsName + "不存在物料请先同步"); return ApiResult.Failed("订单号:" + orderGoodsDetail?.OrderNo + "的商品:" + orderGoodsDetail?.GoodsName + "不存在物料请先同步");
} }
if (!materialModel.InventoryNum.HasValue || (materialModel.InventoryNum ?? 0) <= 0)
if (oldmaterialList != null && (oldmaterialList.Sum(x => x.InventoryNum ?? 0)) <= 0)
{ {
return ApiResult.Failed("订单号:" + orderGoodsDetail?.OrderNo + "的商品:" + orderGoodsDetail?.GoodsName + "库存不足"); return ApiResult.Failed("订单号:" + orderGoodsDetail?.OrderNo + "的商品:" + orderGoodsDetail?.GoodsName + "库存不足");
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment