From f43e691ee0101755fb0abe1dfb521f412e532719 Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Fri, 19 Jul 2024 15:36:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=BD=E5=B1=89=E6=89=93=E5=BC=80=20?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E4=BA=8B=E4=BB=B6=E9=87=8C=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?channelStocks[0].process=E5=AD=97=E6=AE=B5=E5=8E=BB=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/Port/PortUtil.cs | 1 + .../CheckStockNewWindowViewModel.cs | 26 ++++++++--------- .../ViewModels/InvoiceInNewWindowViewModel.cs | 29 ++++++++++--------- .../ViewModels/InvoiceTakeDialogViewModel.cs | 25 ++++++++-------- .../ViewModels/OrderReturnDialogViewModel.cs | 23 ++++++++------- .../ViewModels/OrderTakeDialogViewModel.cs | 23 ++++++++------- .../ViewModels/SelfAddDialogViewModel.cs | 23 ++++++++------- .../ViewModels/SelfTakeDialogViewModel.cs | 23 ++++++++------- 8 files changed, 90 insertions(+), 83 deletions(-) diff --git a/DM_Weight/Port/PortUtil.cs b/DM_Weight/Port/PortUtil.cs index 5d11072..758988c 100644 --- a/DM_Weight/Port/PortUtil.cs +++ b/DM_Weight/Port/PortUtil.cs @@ -824,6 +824,7 @@ namespace DM_Weight.Port private bool DrawerState(int[] r) { + logger.Info($"DrawerState DrawerNo:{DrawerNo};r.length:{r.Length}"); int index = DrawerNo > 8 ? DrawerNo - 7 : DrawerNo + 1; return r[index] == 0; } diff --git a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs index 346fbc5..992d29b 100644 --- a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs @@ -221,25 +221,25 @@ namespace DM_Weight.ViewModels // 抽屉打开 case EventType.DRAWEROPEN: - - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - //Status = 2; - } + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); + //if (Status == 1) + //{ + // if (channelStocks!=null&& channelStocks[0]!=null&&channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + // //Status = 2; + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} IGrouping groupingBefore = enumerator.Current; int DrawerNoBefore = groupingBefore.Key; //Convert.ToInt32(groupingBefore.Key.Substring(0, groupingBefore.Key.IndexOf('-'))); if (enumerator.MoveNext()) diff --git a/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs b/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs index ef90f02..ba30c2f 100644 --- a/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs @@ -104,24 +104,25 @@ namespace DM_Weight.ViewModels // 抽屉打开 case EventType.DRAWEROPEN: + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - } + //if (Status == 1) + //{ + // if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} IGrouping groupingBefore = enumerator.Current; int DrawerNoBefore = groupingBefore.Key; if (enumerator.MoveNext()) @@ -339,7 +340,7 @@ namespace DM_Weight.ViewModels // .Where(cs => cs.ManuNo == invoicesManuNo[j].DrugManuNo && cs.DrugId == invoicesManuNo[j].DrugId && cs.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList(); List stockList = _mysqlHelper.GetInvoiceStock(invoicesManuNo[j].DrugId, invoicesManuNo[j].DrugManuNo); // List manuNoList = SqlSugarHelper.Db.Queryable().Where(dm => dm.ManuNo == invoicesManuNo[j].DrugManuNo && dm.DrugId == invoicesManuNo[j].DrugId).ToList(); - // DrugManuNo manuNoList = _mysqlHelper.GetManuNoList(invoicesManuNo[j].DrugId, invoicesManuNo[j].DrugManuNo); + // DrugManuNo manuNoList = _mysqlHelper.GetManuNoList(invoicesManuNo[j].DrugId, invoicesManuNo[j].DrugManuNo); if (stockList == null || stockList.Count <= 0) { //if (manuNoList == null||manuNoList.Id==null) @@ -388,7 +389,7 @@ namespace DM_Weight.ViewModels stock.ColNo = channelL[k].ColNo; stock.DrugId = channelL[k].DrugId; stock.ManuNo = invoicesManuNo[j].DrugManuNo; - stock.EffDate =Convert.ToDateTime(invoicesManuNo[j].DrugEffDate).ToString("yyyy-MM-dd"); + stock.EffDate = Convert.ToDateTime(invoicesManuNo[j].DrugEffDate).ToString("yyyy-MM-dd"); stock.Chnguid = channelL[k].Id; stockList.Add(stock); } @@ -550,7 +551,7 @@ namespace DM_Weight.ViewModels _isFinishClick = true; - List record = ChannelStocks.Where(cs=>cs.AddQuantity>0).ToList(); + List record = ChannelStocks.Where(cs => cs.AddQuantity > 0).ToList(); string InvoiceId = SelectedInvoice.InvoiceNo; //var f = SqlSugarHelper.Db.UseTran(() => //{ diff --git a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs index d3ed51b..db02bed 100644 --- a/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceTakeDialogViewModel.cs @@ -61,24 +61,25 @@ namespace DM_Weight.ViewModels // 抽屉打开 case EventType.DRAWEROPEN: - - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - } + + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); + //if (Status == 1) + //{ + // if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} IGrouping groupingBefore = enumerator.Current; int DrawerNoBefore = groupingBefore.Key; if (enumerator.MoveNext()) diff --git a/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs b/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs index 7250e21..f00df12 100644 --- a/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs +++ b/DM_Weight/ViewModels/OrderReturnDialogViewModel.cs @@ -66,23 +66,24 @@ namespace DM_Weight.ViewModels case EventType.DRAWEROPEN: - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - } + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); + //if (Status == 1) + //{ + // if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} IGrouping groupingBefore = enumerator.Current; int DrawerNoBefore = groupingBefore.Key; if (enumerator.MoveNext()) diff --git a/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs b/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs index 9c2c437..3f58571 100644 --- a/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs @@ -65,23 +65,24 @@ namespace DM_Weight.ViewModels case EventType.DRAWEROPEN: - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - } + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); + //if (Status == 1) + //{ + // if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} //IGrouping groupingBefore = enumerator.Current; //int DrawerNoBefore = groupingBefore.Key; if (enumerator.MoveNext()) diff --git a/DM_Weight/ViewModels/SelfAddDialogViewModel.cs b/DM_Weight/ViewModels/SelfAddDialogViewModel.cs index 0998505..89df0d2 100644 --- a/DM_Weight/ViewModels/SelfAddDialogViewModel.cs +++ b/DM_Weight/ViewModels/SelfAddDialogViewModel.cs @@ -70,23 +70,24 @@ namespace DM_Weight.ViewModels case EventType.DRAWEROPEN: - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - } + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); + //if (Status == 1) + //{ + // if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} IGrouping groupingBefore = enumerator.Current; int DrawerNoBefore = groupingBefore.Key; if (enumerator.MoveNext()) diff --git a/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs b/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs index 1aedd5d..53fc20e 100644 --- a/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/SelfTakeDialogViewModel.cs @@ -62,23 +62,24 @@ namespace DM_Weight.ViewModels case EventType.DRAWEROPEN: - if (Status == 1) - { - if (channelStocks[0].process == 1) - { - channelStocks.ForEach(it => it.process = 2); - } - } + logger.Info($"抽屉打开,channelStocks{channelStocks != null}"); + //if (Status == 1) + //{ + // if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 1) + // { + // channelStocks.ForEach(it => it.process = 2); + // } + //} break; // 抽屉关闭 case EventType.DRAWERCLOSE: if (Status == 1) { - if (channelStocks[0].process == 2) - { - channelStocks.ForEach(it => it.process = 3); - } + //if (channelStocks != null && channelStocks[0] != null && channelStocks[0].process == 2) + //{ + // channelStocks.ForEach(it => it.process = 3); + //} IGrouping groupingBefore = enumerator.Current; int DrawerNoBefore = groupingBefore.Key; if (enumerator.MoveNext())