diff --git a/CowOutputClient/OperateWindow.xaml.cs b/CowOutputClient/OperateWindow.xaml.cs index b6b83e1..8c50167 100644 --- a/CowOutputClient/OperateWindow.xaml.cs +++ b/CowOutputClient/OperateWindow.xaml.cs @@ -486,7 +486,7 @@ namespace CowOutputClient //var weight = WeightInfoBL.GetButcDetailIDWeight(detail.ButcDetailID,she); var items = gridProductPlan.ItemsSource as List; var results = items.Where(x => x.DetailID == detail.ButcDetailID); - if (results.Count() > 0) { + if (results != null && results.Count() > 0) { result = results.First(); finishNum = result.FinishNum - detail.Weight; ProductPlanBL.UpdateButhcerDetailFinishNum(result,finishNum, result.DetailID,result.Goods_ID,she); diff --git a/WeighBusiness/BL/ProductPlanBL.cs b/WeighBusiness/BL/ProductPlanBL.cs index b391adf..5d8af09 100644 --- a/WeighBusiness/BL/ProductPlanBL.cs +++ b/WeighBusiness/BL/ProductPlanBL.cs @@ -408,6 +408,8 @@ namespace WeighBusiness.BL { //获取全部的完工数量 var details = list.Select(x => x.DetailID).Distinct(); + if (details.Count() < 1) + return list; var detailStr = string.Join("|", details); var method = "/MainSystem/B3_HaoYue/Rpcs/DeliveryNumberInfoRpc/GetDeliveryNumberInfo"; var deliveryInfo = RpcFacade.Call>>(method, detailStr);