From fcf1238c2cafb42b364f28fc9ec3668f714fcbdd Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Wed, 9 Oct 2024 10:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=8F=E9=99=A2=E8=8D=AF=E6=88=BF1=E3=80=812?= =?UTF-8?q?=E5=8F=B7=E6=8A=BD=E5=B1=89=E4=B8=BA=E5=80=BC=E7=8F=AD=E6=9F=9C?= =?UTF-8?q?3-16=E5=8F=B7=E6=8A=BD=E5=B1=89=E4=B8=BA=E5=91=A8=E8=BD=AC?= =?UTF-8?q?=E6=9F=9C=20=E4=BD=8F=E9=99=A2=E8=8D=AF=E6=88=BFmachineId?= =?UTF-8?q?=E4=B8=BADM2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/App.config | 2 +- DM_Weight/Services/MachineRecordService.cs | 2 +- .../BindingChannelDialogViewModel.cs | 2 ++ .../BindingChannelNewDialogViewModel .cs | 4 +-- .../CheckStockNew2WindowViewModel.cs | 4 +-- .../CheckStockNewWindowViewModel.cs | 26 ++------------ .../DrawerAddDrugWindowViewModel.cs | 10 +++--- .../DrawerTakeDrugWindowViewModel.cs | 10 +++--- .../ViewModels/InvoiceInNewWindowViewModel.cs | 8 +++-- DM_Weight/ViewModels/MainWindowViewModel.cs | 5 ++- .../ViewModels/OrderTakeDialogViewModel.cs | 4 +-- .../ViewModels/ReturnDrugWindow2ViewModel.cs | 4 +-- .../ViewModels/ReturnDrugWindowViewModel.cs | 4 +-- .../ViewModels/ReturnEmptyWindowViewModel.cs | 4 +-- .../ViewModels/SelfAddWindowViewModel.cs | 4 +-- .../ViewModels/SelfTakeDrugWindowViewModel.cs | 4 +-- .../SpecialAccountWindowViewModel.cs | 10 +++--- .../ViewModels/StockListWindowViewModel.cs | 4 +-- DM_Weight/Views/AddDrugControl.xaml | 28 +++++++-------- DM_Weight/Views/DrawerAddDrugWindow.xaml | 32 ++++++++--------- DM_Weight/Views/DrawerTakeDrugWindow.xaml | 34 +++++++++---------- 21 files changed, 95 insertions(+), 110 deletions(-) diff --git a/DM_Weight/App.config b/DM_Weight/App.config index 5f7b376..bd01fb4 100644 --- a/DM_Weight/App.config +++ b/DM_Weight/App.config @@ -12,7 +12,7 @@ - + diff --git a/DM_Weight/Services/MachineRecordService.cs b/DM_Weight/Services/MachineRecordService.cs index c54d152..15104ec 100644 --- a/DM_Weight/Services/MachineRecordService.cs +++ b/DM_Weight/Services/MachineRecordService.cs @@ -33,7 +33,7 @@ namespace DM_Weight.Services (SELECT mr.type,mr.`stock_quantity` AS `stockQuantity`, -- IF(mr.`type` IN (1, 31), mr.`quantity`,IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`, 0)) AS `inQuantity`, -- IF(mr.`type` = 2, mr.`quantity`, IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`, - if(mr.drawer_no>8 and mr.`type` IN (1, 31),quantity,IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`,0)) AS `inQuantity`, + if(mr.drawer_no>2 and mr.`type` IN (1, 31),quantity,IF(mr.`type` = 4 AND mr.`quantity` > 0, mr.`quantity`,0)) AS `inQuantity`, if(OI.ORDER_NO is not null,mr.quantity,IF(mr.`type` = 4 AND mr.`quantity` < 0, (0 - mr.`quantity`), 0)) AS `outQuantity`, DATE_FORMAT(mr.`operation_time`,'%m/%d') AS `operationTime`,IF(mr.`type`=1,mr.`invoice_id`,NULL) AS `invoiceId`, di.`drug_name` AS `drugName`, di.`drug_id` AS `drugId`, di.`drug_spec` AS `drugSpec`, di.`pack_unit` AS `packUnit`, di.`dosage` AS `dosage`, di.`manufactory` AS `manufactory`, diff --git a/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs b/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs index 1d793a0..31e64c4 100644 --- a/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs +++ b/DM_Weight/ViewModels/BindingChannelDialogViewModel.cs @@ -229,6 +229,8 @@ namespace DM_Weight.ViewModels var list = SqlSugarHelper.Db.Queryable() .Includes(cs => cs.DrugInfo) .WhereIF(DrawerNo > 0, cs => cs.DrawerNo == DrawerNo) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")) .OrderBy(cs => cs.DrawerNo) .OrderBy(cs => cs.ColNo) diff --git a/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs b/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs index ce8e2da..8d5a3ed 100644 --- a/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs +++ b/DM_Weight/ViewModels/BindingChannelNewDialogViewModel .cs @@ -258,8 +258,8 @@ namespace DM_Weight.ViewModels int totalCount = 0; var list = SqlSugarHelper.Db.Queryable() .Includes(cl => cl.Drug) - .WhereIF(App.SingleModel, cl => cl.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cl => cl.DrawerNo > 8) + .WhereIF(App.SingleModel, cl => cl.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cl => cl.DrawerNo > 2) .Includes(cs => cs.channelStocks) .WhereIF(DrawerNo > 0, cl => cl.DrawerNo == DrawerNo) .Where(cl => cl.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")) diff --git a/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs index 7894adc..5a58f2a 100644 --- a/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs +++ b/DM_Weight/ViewModels/CheckStockNew2WindowViewModel.cs @@ -574,8 +574,8 @@ namespace DM_Weight.ViewModels .Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrugId != null) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .WhereIF(!String.IsNullOrEmpty(SearchValue), cs => cs.DrugInfo.DrugName == SearchValue) .OrderBy(cs => cs.DrawerNo) .OrderBy(cs => cs.ColNo) diff --git a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs index 40c4bb4..339ae3e 100644 --- a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs @@ -317,28 +317,6 @@ namespace DM_Weight.ViewModels IGrouping grouping = enumerator.Current; //int DrawerNo =Convert.ToInt32(grouping.Key.Substring(0,grouping.Key.IndexOf('-'))); int DrawerNo = grouping.Key; - - if (DrawerNo <= 8) - { - if (App.CurrentFaUserList.Role.FirstEightChecked == "0") - { - NoAuthority(); - } - } - if (DrawerNo > 8 && DrawerNo != 17) - { - if (App.CurrentFaUserList.Role.LastEightChecked == "0") - { - NoAuthority(); - } - } - if (DrawerNo == 17) - { - if (App.CurrentFaUserList.Role.StorageBoxChecked == "0") - { - NoAuthority(); - } - } List Stocks = grouping.ToList(); Stocks.ForEach(it => it.process = 1); _portUtil.SpeakAsync("正在打开" + DrawerNo + "号抽屉"); @@ -706,8 +684,8 @@ namespace DM_Weight.ViewModels .Where(cs => cs.DrawerType == 1) .Where(cs => cs.DrugId != null) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .WhereIF(!String.IsNullOrEmpty(SearchValue), cs => cs.DrugInfo.DrugName == SearchValue) .OrderBy(cs => cs.DrawerNo) //.OrderByDescending(cs => cs.DrawerNo) diff --git a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs index bd535dd..b6c0e74 100644 --- a/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/DrawerAddDrugWindowViewModel.cs @@ -371,11 +371,11 @@ namespace DM_Weight.ViewModels public void FindDrawerCount() { - int count = SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType != 3) - .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count(); - Is8Drawer = count < 9; - Is16Drawer = count >= 16; - Is17Drawer = count > 16; + //int count = SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType != 3) + //.Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count(); + Is8Drawer = App.SingleModel; //count < 9; + Is16Drawer = !App.SingleModel; //count >= 16; + Is17Drawer = false;//count > 16; } diff --git a/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs b/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs index 43b88d0..d2c2f35 100644 --- a/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/DrawerTakeDrugWindowViewModel.cs @@ -347,11 +347,11 @@ namespace DM_Weight.ViewModels public void FindDrawerCount() { - int count = SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType != 3) - .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count(); - Is8Drawer = count < 9; - Is16Drawer = count >= 16; - Is17Drawer = count > 16; + //int count = SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType != 3) + // .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrawerNo).Select(cs => SqlFunc.AggregateCount(cs.DrawerNo)).Count(); + Is8Drawer = App.SingleModel; //count < 9; + Is16Drawer = !App.SingleModel; //count >= 16; + Is17Drawer = false;//count > 16; } diff --git a/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs b/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs index 7623baa..3e4586a 100644 --- a/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/InvoiceInNewWindowViewModel.cs @@ -306,7 +306,9 @@ namespace DM_Weight.ViewModels List channelL = SqlSugarHelper.Db.Queryable() .Includes(cl => cl.Drug, di => di.DrugManuNos) //.Includes(cl => cl.channelStocks, dr => dr.DrugInfo, d => d.DrugManuNos) - .Where(cl => cl.DrugId == invoices[i].DrugId && cl.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList(); + .Where(cl => cl.DrugId == invoices[i].DrugId && cl.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")) + .Where(cl=>cl.DrawerNo>2) //调拨只能往周转库调住院药房3~16为周转库 + .ToList(); ChannelList channelLst = channelL.Count > 0 ? channelL[0] : null; if (channelLst == null || channelLst.Id is null) { @@ -327,7 +329,9 @@ namespace DM_Weight.ViewModels { //查询是否有库存 List stockList = SqlSugarHelper.Db.Queryable() - .Where(cs => cs.ManuNo == invoicesManuNo[j].DrugManuNo && cs.DrugId == invoicesManuNo[j].DrugId && cs.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList(); + .Where(cs => cs.ManuNo == invoicesManuNo[j].DrugManuNo && cs.DrugId == invoicesManuNo[j].DrugId && cs.MachineId == (ConfigurationManager.AppSettings["machineId"] ?? "DM1")) + .Where(cs=>cs.DrawerNo>2) + .ToList(); //stock = stockList.Count > 0 ? stockList[0] : new ChannelStock(); List manuNoList = SqlSugarHelper.Db.Queryable().Where(dm => dm.ManuNo == invoicesManuNo[j].DrugManuNo && dm.DrugId == invoicesManuNo[j].DrugId).ToList(); if (stockList == null || stockList.Count <= 0) diff --git a/DM_Weight/ViewModels/MainWindowViewModel.cs b/DM_Weight/ViewModels/MainWindowViewModel.cs index 04f0346..532a969 100644 --- a/DM_Weight/ViewModels/MainWindowViewModel.cs +++ b/DM_Weight/ViewModels/MainWindowViewModel.cs @@ -18,6 +18,7 @@ using Unity; using DM_Weight.Models; using System.Runtime.CompilerServices; using SqlSugar; +using System.Configuration; namespace DM_Weight.ViewModels { @@ -110,7 +111,9 @@ namespace DM_Weight.ViewModels //写标签数量 async Task BindStock() { - List singleChannels = SqlSugarHelper.Db.Queryable().Where(cs => cs.BoardType == 5&&cs.Quantity>0).Where(cs => cs.DrugId !=null).ToList(); + List singleChannels = SqlSugarHelper.Db.Queryable().Where(cs => cs.BoardType == 5&&cs.Quantity>0) + .Where(cs => cs.DrugId !=null) + .Where(cs=>cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).ToList(); singleChannels = singleChannels.GroupBy(cs => new { cs.DrawerNo, cs.ColNo }) .Select(cs => { var ret = cs.First(); diff --git a/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs b/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs index a302105..c71ee65 100644 --- a/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/OrderTakeDialogViewModel.cs @@ -207,8 +207,8 @@ namespace DM_Weight.ViewModels .WhereIF(!string.IsNullOrEmpty(orderDetail.SetEffDate), cs => cs.EffDate.Equals(orderDetail.SetEffDate)) .WhereIF(!string.IsNullOrEmpty(orderDetail.SetManuNo), cs => cs.ManuNo.Equals(orderDetail.SetManuNo)) .Where(cs => cs.DrugId == orderDetail.DrugId) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前2个抽屉,双人登录开后14个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .OrderBy(cs => cs.EffDate) .OrderBy(cs => cs.DrawerNo) .OrderBy(cs => cs.ManuNo) diff --git a/DM_Weight/ViewModels/ReturnDrugWindow2ViewModel.cs b/DM_Weight/ViewModels/ReturnDrugWindow2ViewModel.cs index 41fe93b..4fc9c05 100644 --- a/DM_Weight/ViewModels/ReturnDrugWindow2ViewModel.cs +++ b/DM_Weight/ViewModels/ReturnDrugWindow2ViewModel.cs @@ -219,8 +219,8 @@ namespace DM_Weight.ViewModels List queryData = SqlSugarHelper.Db.Queryable() .InnerJoin((oi, od) => oi.OrderNo == od.OrderNo) .InnerJoin(SqlSugarHelper.Db.Queryable().Where(cs => cs.DrawerType == 1) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")).GroupBy(cs => cs.DrugId), (oi, od, t) => od.DrugId == t.DrugId) .WhereIF(OrderDate != null, oi => oi.OrderDate.ToString("yyyy-MM-dd") == OrderDate) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("OrderNo"), oi => oi.OrderNo == SearchValue) diff --git a/DM_Weight/ViewModels/ReturnDrugWindowViewModel.cs b/DM_Weight/ViewModels/ReturnDrugWindowViewModel.cs index 50d24e1..9668557 100644 --- a/DM_Weight/ViewModels/ReturnDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/ReturnDrugWindowViewModel.cs @@ -184,8 +184,8 @@ namespace DM_Weight.ViewModels .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (mr) => mr.DrugInfo.DrugName.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("PyCode"), (mr) => mr.DrugInfo.PyCode.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugBarcode"), (mr) => mr.DrugInfo.DrugBarcode.Contains(SearchValue)) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .OrderBy(mr => mr.OperationTime) .ToList(); MachineRecords = queryData; diff --git a/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs b/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs index 312f534..a7850fa 100644 --- a/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs +++ b/DM_Weight/ViewModels/ReturnEmptyWindowViewModel.cs @@ -105,8 +105,8 @@ namespace DM_Weight.ViewModels Channels = SqlSugarHelper.Db.Queryable() .LeftJoin((cs,di) => cs.DrugId == di.DrugId.ToString()) .Where((cs) => cs.DrawerType != 1) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1")) .Select((cs, di) => new ChannelStock{ CanReturnQuantity = SqlFunc.Subqueryable().Where(mr => mr.DrugId == cs.DrugId).Where(mr => mr.Type == 2).Where(mr => mr.Status != 2).Select(mr => SqlFunc.IsNull(SqlFunc.AggregateSumNoNull(mr.Quantity - mr.ReturnQuantity1 - mr.ReturnQuantity2), 0)) , diff --git a/DM_Weight/ViewModels/SelfAddWindowViewModel.cs b/DM_Weight/ViewModels/SelfAddWindowViewModel.cs index 1ee97fe..fc7c0ba 100644 --- a/DM_Weight/ViewModels/SelfAddWindowViewModel.cs +++ b/DM_Weight/ViewModels/SelfAddWindowViewModel.cs @@ -212,8 +212,8 @@ namespace DM_Weight.ViewModels //ChannelStocks = queryData; List q = SqlSugarHelper.Db.Queryable() .Includes(di => di.channelStocks.Where(cs => cs.DrawerType == 1) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList()) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue)) diff --git a/DM_Weight/ViewModels/SelfTakeDrugWindowViewModel.cs b/DM_Weight/ViewModels/SelfTakeDrugWindowViewModel.cs index 4da590d..7492ab6 100644 --- a/DM_Weight/ViewModels/SelfTakeDrugWindowViewModel.cs +++ b/DM_Weight/ViewModels/SelfTakeDrugWindowViewModel.cs @@ -197,8 +197,8 @@ namespace DM_Weight.ViewModels //ChannelStocks = queryData; List q = SqlSugarHelper.Db.Queryable() .Includes(di => di.channelStocks.Where(cs => cs.DrawerType == 1) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8 ) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8 ) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2 ) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2 ) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null&&cs.Quantity>0).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList()) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue)) diff --git a/DM_Weight/ViewModels/SpecialAccountWindowViewModel.cs b/DM_Weight/ViewModels/SpecialAccountWindowViewModel.cs index 26a8dcd..f63e823 100644 --- a/DM_Weight/ViewModels/SpecialAccountWindowViewModel.cs +++ b/DM_Weight/ViewModels/SpecialAccountWindowViewModel.cs @@ -139,7 +139,7 @@ namespace DM_Weight.ViewModels { string drugId = channelStockList[i].DrugId; string manuNo = channelStockList[i].ManuNo; - int quantity= channelStockList[i] .Quantity; + int quantity = channelStockList[i].Quantity; int Count = accountList.Where(cs => cs.DrugId == drugId && cs.ManuNo == manuNo).Count(); if (Count <= 0) @@ -149,7 +149,7 @@ namespace DM_Weight.ViewModels } else { - inQuantity = accountList.Where(cs => cs.DrugId == drugId&&cs.ManuNo== manuNo).Sum(cs => cs.InQuantity); + inQuantity = accountList.Where(cs => cs.DrugId == drugId && cs.ManuNo == manuNo).Sum(cs => cs.InQuantity); outQuantity = accountList.Where(cs => cs.DrugId == drugId && cs.ManuNo == manuNo).Sum(cs => cs.OutQuantity); } // 获取药品总库存 @@ -179,8 +179,6 @@ namespace DM_Weight.ViewModels SupplierDept = string.Empty,// ConfigurationManager.AppSettings["supplierDept"].ToString(), ReceiveDept = string.Empty,//ConfigurationManager.AppSettings["receiveDept"].ToString() }).ExecuteCommand(); - - } } else @@ -249,7 +247,7 @@ namespace DM_Weight.ViewModels { get => new DelegateCommand(() => { - GridReportUtil.PrintReportSpecialAccount(EndDate?? DateTime.Now, DrugInfo == null ? "" : DrugInfo.DrugId); + GridReportUtil.PrintReportSpecialAccount(EndDate ?? DateTime.Now, DrugInfo == null ? "" : DrugInfo.DrugId); }); } @@ -260,7 +258,7 @@ namespace DM_Weight.ViewModels { get => new DelegateCommand(() => { - GridReportUtil.PrintReportSpecialAccount2New(EndDate?? DateTime.Now, DrugInfo == null ? "" : DrugInfo.DrugId); + GridReportUtil.PrintReportSpecialAccount2New(EndDate ?? DateTime.Now, DrugInfo == null ? "" : DrugInfo.DrugId); }); } diff --git a/DM_Weight/ViewModels/StockListWindowViewModel.cs b/DM_Weight/ViewModels/StockListWindowViewModel.cs index 425593e..33eb09e 100644 --- a/DM_Weight/ViewModels/StockListWindowViewModel.cs +++ b/DM_Weight/ViewModels/StockListWindowViewModel.cs @@ -243,8 +243,8 @@ namespace DM_Weight.ViewModels List q = SqlSugarHelper.Db.Queryable() .Includes(di => di.channelStocks.Where(cs => cs.DrawerType == 1) - .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 8) //单人登录开前8个抽屉,双人登录开后8个抽屉 - .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 8) + .WhereIF(App.SingleModel, cs => cs.DrawerNo <= 2) //单人登录开前8个抽屉,双人登录开后8个抽屉 + .WhereIF(!(App.SingleModel), cs => cs.DrawerNo > 2) .Where(cs => cs.MachineId.Equals(ConfigurationManager.AppSettings["machineId"] ?? "DM1") && cs.DrugId != null).OrderBy(cs => cs.DrawerNo).OrderBy(cs => cs.ColNo).ToList()) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugId"), (cs) => cs.DrugId.Contains(SearchValue)) .WhereIF(!String.IsNullOrEmpty(SearchValue) && SelectedItem.Code.Equals("DrugName"), (cs) => cs.DrugName.Contains(SearchValue)) diff --git a/DM_Weight/Views/AddDrugControl.xaml b/DM_Weight/Views/AddDrugControl.xaml index d318830..3e07b87 100644 --- a/DM_Weight/Views/AddDrugControl.xaml +++ b/DM_Weight/Views/AddDrugControl.xaml @@ -80,14 +80,14 @@ -