diff --git a/CowOutputClient/OperateWindow.xaml.cs b/CowOutputClient/OperateWindow.xaml.cs index b27937f..31e3748 100644 --- a/CowOutputClient/OperateWindow.xaml.cs +++ b/CowOutputClient/OperateWindow.xaml.cs @@ -104,7 +104,8 @@ namespace CowOutputClient for (int i = 1; i < list.Count; i++) { ProductPlanBL.UpdateButhcerDetailFinish(list[i].Value); var result = butDetails.Where(x => x.DetailID == list[i].Value); - butDetails.Remove(result.First()); + if (result.Count() > 0) + butDetails.Remove(result.First()); } var resultList = new List(); foreach (var item in butDetails) { @@ -272,6 +273,8 @@ namespace CowOutputClient //weight.Weight = goodsWeight.Value; weight.SubWeight = tare; weight.NetWeight = weight.Weight - (weight.SubWeight??0); + if (weight.NetWeight < 0) + throw new ApplicationException("毛重"+weight.Weight+",皮重"+weight.SubWeight+",净重"+weight.NetWeight+"小于零,不能录入"); weight.CreateTime = DateTime.Now; if (rbSingleWeight.IsChecked == true) weight.ProductNum = 1; @@ -281,8 +284,10 @@ namespace CowOutputClient if (mButcherDetailData != null && detail.Goods_ID == mButcherDetailData.Goods_ID) { weight.ButcDetailID = mButcherDetailData.DetailID; finishNum = (mButcherDetailData.FinishNum ?? 0) + weight.NetWeight; - if (finishNum > mButcherDetailData.PlanNumber) - throw new ApplicationException("计划数量【"+mButcherDetailData.PlanNumber+"】完工数量【"+finishNum+"】超出【"+(finishNum-mButcherDetailData.PlanNumber)+"】"); + if (finishNum > mButcherDetailData.PlanNumber) { + var infoWindow = new AutoCloseWindow("计划数量【" + mButcherDetailData.PlanNumber + "】完工数量【" + finishNum + "】超出【" + (finishNum - mButcherDetailData.PlanNumber) + "】"); + infoWindow.ShowDialog(); + } ProductPlanBL.UpdateButhcerDetailFinishNum(finishNum, mButcherDetailData.DetailID, mButcherDetailData.Goods_ID, she); //weight.DetailSequence = WeightInfoBL.GetCurrentSequence(mButcherDetailData.DetailID); } @@ -429,7 +434,8 @@ namespace CowOutputClient for (int i = 1; i < list.Count; i++) { ProductPlanBL.UpdateButhcerDetailFinish(list[i].Value); var result = butDetails.Where(x => x.DetailID == list[i].Value); - butDetails.Remove(result.First()); + if(result.Count() > 0) + butDetails.Remove(result.First()); } var resultList = new List(); foreach (var item in butDetails) { @@ -441,7 +447,9 @@ namespace CowOutputClient WindowUtil.Inf("生成产出单No." + outputId); } - mButcherDetailData = null; + if (mButcherDetailData!=null && mButcherDetailData.DetailID == selectedItem.DetailID) { + mButcherDetailData = null; + } //var num = RpcFacade.Call("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/FinishButcherDetail", selectedItem.DetailID); //if (num == 1) { // ProductPlanBL.UpdateButhcerDetailFinish(selectedItem.DetailID); diff --git a/WeighBusiness/BL/ProductCatalogBL.cs b/WeighBusiness/BL/ProductCatalogBL.cs index 6d570bc..8220df5 100644 --- a/WeighBusiness/BL/ProductCatalogBL.cs +++ b/WeighBusiness/BL/ProductCatalogBL.cs @@ -111,8 +111,9 @@ namespace WeighBusiness.BL var method = "/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/GetProductCatalogRowVersion"; if (domain_ID != null && !string.IsNullOrEmpty(domain_ID.ToString())) { var productCatalogRowVersion = RpcFacade.Call>>(method, long.Parse(domain_ID)); - var oldpCatalogRowVersion = GetProductCatalogRowVersion(); - + Delete(); + //var oldpCatalogRowVersion = GetProductCatalogRowVersion(); + var oldpCatalogRowVersion = new List(); var needInsertCatalogID = new List(); var needDeleteAndInsertCatalogID = new List(); if (productCatalogRowVersion.Count > 0) { diff --git a/WeighBusiness/BL/ProductPlanBL.cs b/WeighBusiness/BL/ProductPlanBL.cs index 264f590..e4e1b6c 100644 --- a/WeighBusiness/BL/ProductPlanBL.cs +++ b/WeighBusiness/BL/ProductPlanBL.cs @@ -274,9 +274,9 @@ namespace WeighBusiness.BL var list = new List(); var querySql = string.Empty; if (!isLoad) { - querySql = "select Batch_ID,Batch from {0} where BillDate >='{1}' and BillDate < '{2}'".FormatWith(TableNames.生产计划生产批次, startDate, date.AddDays(1)); + querySql = "select Batch_ID,Batch from {0} where BillDate >='{1}' and BillDate < '{2}' order by BillDate desc".FormatWith(TableNames.生产计划生产批次, startDate, date.AddDays(1)); } else { - querySql = "select Batch_ID,Batch from {0}".FormatWith(TableNames.生产计划生产批次, startDate.AddDays(1)); + querySql = "select Batch_ID,Batch from {0} order by BillDate desc".FormatWith(TableNames.生产计划生产批次, startDate.AddDays(1)); } var table = SqlHelperEx.DoQuery(querySql); if (table.Rows.Count == 0)