From 336531bb2a3e02d85d4cb12327365efd83280d71 Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Fri, 3 Jan 2025 17:58:33 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=9A=E5=A4=84=E6=96=B9=E5=8F=96=E8=8D=AF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8F=96=E8=8D=AF=E4=BA=BA=EF=BC=9B=E6=8C=87?= =?UTF-8?q?=E7=BA=B9=E7=99=BB=E5=BD=95=E6=B7=BB=E5=8A=A0machinid=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=AA=8C=E8=AF=81=EF=BC=8C=E5=8E=BB=E6=8E=89=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E8=BD=AF=E4=BB=B6=E5=86=99=E6=A0=87=E7=AD=BE=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E5=8A=9F=E8=83=BD=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/App.config | 2 +- DM_Weight/Port/PortUtil.cs | 2 + .../ReportTemp/changeShifts_temp_new.grf | 444 ++++++++++++++++++ .../CheckStockNewWindowViewModel.cs | 2 + DM_Weight/ViewModels/LoginWindowViewModel.cs | 2 +- DM_Weight/ViewModels/MainWindowViewModel.cs | 10 +- .../MultiOrderTakeDialogViewModel.cs | 15 +- .../Views/Dialog/MultiOrderTakeDialog.xaml | 4 + 8 files changed, 473 insertions(+), 8 deletions(-) create mode 100644 DM_Weight/ReportTemp/changeShifts_temp_new.grf diff --git a/DM_Weight/App.config b/DM_Weight/App.config index db39a32..fd496d9 100644 --- a/DM_Weight/App.config +++ b/DM_Weight/App.config @@ -28,7 +28,7 @@ - + diff --git a/DM_Weight/Port/PortUtil.cs b/DM_Weight/Port/PortUtil.cs index 77875a0..5c6bcd2 100644 --- a/DM_Weight/Port/PortUtil.cs +++ b/DM_Weight/Port/PortUtil.cs @@ -545,6 +545,7 @@ namespace DM_Weight.Port } else { + Thread.Sleep(50); // 灯在闪烁继续监听状态 GetBackDoorState(); } @@ -581,6 +582,7 @@ namespace DM_Weight.Port }); logger.Info($"储物箱打开成功"); } + Thread.Sleep(50); // 灯在闪烁继续监听状态 GetBackDoorState(); } diff --git a/DM_Weight/ReportTemp/changeShifts_temp_new.grf b/DM_Weight/ReportTemp/changeShifts_temp_new.grf new file mode 100644 index 0000000..454040f --- /dev/null +++ b/DM_Weight/ReportTemp/changeShifts_temp_new.grf @@ -0,0 +1,444 @@ +{ + "Version":"6.8.1.1", + "Font":{ + "Name":"宋体", + "Size":105000, + "Weight":400, + "Charset":134 + }, + "Printer":{ + "Oriention":"Landscape", + "LeftMargin":1, + "TopMargin":1.4287, + "RightMargin":1, + "BottomMargin":1.8 + }, + "DetailGrid":{ + "CenterView":true, + "Recordset":{ + "Field":[ + { + "Name":"日期", + "Type":"DateTime", + "Format":"yyyy/MM/dd", + "DBFieldName":"opt_date" + }, + { + "Name":"品名", + "DBFieldName":"drug_name" + }, + { + "Name":"规格", + "DBFieldName":"drug_spec" + }, + { + "Name":"上班结存数", + "Type":"Integer", + "DBFieldName":"beforenum" + }, + { + "Name":"领用数", + "Type":"Integer", + "DBFieldName":"getnum" + }, + { + "Name":"消耗数", + "Type":"Integer", + "DBFieldName":"usenum" + }, + { + "Name":"批号", + "DBFieldName":"manu_no" + }, + { + "Name":"余", + "Type":"Integer", + "DBFieldName":"surplus" + }, + { + "Name":"交班人", + "DBFieldName":"fromoperator" + }, + { + "Name":"接班人", + "DBFieldName":"tooperator" + } + ] + }, + "Column":[ + { + "Name":"品名", + "Width":4.60375 + }, + { + "Name":"规格", + "Width":2.59292 + }, + { + "Name":"单位" + }, + { + "Name":"基数数量" + }, + { + "Name":"现存数量" + }, + { + "Name":"处方数量" + }, + { + "Name":"空安瓿数" + }, + { + "Name":"交接班时间" + }, + { + "Name":"上班结存数", + "Width":1.4 + }, + { + "Name":"领用数", + "Width":1.4 + }, + { + "Name":"消耗数", + "Width":1.4 + }, + { + "Name":"批号", + "Width":1.98438 + }, + { + "Name":"余", + "Width":0.608542 + }, + { + "Name":"交班人", + "Width":2.80458 + }, + { + "Name":"接班人", + "Width":2.35479 + }, + { + "Name":"备注" + } + ], + "ColumnContent":{ + "Height":0.85, + "ColumnContentCell":[ + { + "Column":"品名", + "DataField":"品名" + }, + { + "Column":"规格", + "TextAlign":"MiddleCenter", + "DataField":"规格" + }, + { + "Column":"单位" + }, + { + "Column":"基数数量" + }, + { + "Column":"现存数量" + }, + { + "Column":"处方数量" + }, + { + "Column":"空安瓿数" + }, + { + "Column":"交接班时间" + }, + { + "Column":"上班结存数", + "TextAlign":"MiddleCenter", + "DataField":"上班结存数" + }, + { + "Column":"领用数", + "TextAlign":"MiddleCenter", + "DataField":"领用数" + }, + { + "Column":"消耗数", + "TextAlign":"MiddleCenter", + "DataField":"消耗数" + }, + { + "Column":"批号", + "TextAlign":"MiddleCenter", + "DataField":"批号" + }, + { + "Column":"余", + "TextAlign":"MiddleCenter", + "DataField":"余" + }, + { + "Column":"交班人", + "TextAlign":"MiddleCenter", + "DataField":"交班人" + }, + { + "Column":"接班人", + "TextAlign":"MiddleCenter", + "DataField":"接班人" + }, + { + "Column":"备注" + } + ] + }, + "ColumnTitle":{ + "Height":1.00542, + "RepeatStyle":"OnPage", + "ColumnTitleCell":[ + { + "GroupTitle":false, + "Column":"品名", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"品名" + }, + { + "GroupTitle":false, + "Column":"规格", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"规格" + }, + { + "GroupTitle":false, + "Column":"单位", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"单位" + }, + { + "GroupTitle":false, + "Column":"基数数量", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"基数数量" + }, + { + "GroupTitle":false, + "Column":"现存数量", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"现存数量" + }, + { + "GroupTitle":false, + "Column":"处方数量", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"处方数量" + }, + { + "GroupTitle":false, + "Column":"空安瓿数", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"空安瓿数" + }, + { + "GroupTitle":false, + "Column":"交接班时间", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"交接班时间" + }, + { + "GroupTitle":false, + "Column":"上班结存数", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "WordWrap":true, + "TextAlign":"MiddleCenter", + "Text":"上班\r\n结存数" + }, + { + "GroupTitle":false, + "Column":"领用数", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "WordWrap":true, + "TextAlign":"MiddleCenter", + "Text":"领用数" + }, + { + "GroupTitle":false, + "Column":"消耗数", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "WordWrap":true, + "TextAlign":"MiddleCenter", + "Text":"消耗数" + }, + { + "GroupTitle":false, + "Column":"批号", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"批号" + }, + { + "GroupTitle":false, + "Column":"余", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"余" + }, + { + "GroupTitle":false, + "Column":"交班人", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"交班人" + }, + { + "GroupTitle":false, + "Column":"接班人", + "Font":{ + "Name":"宋体", + "Size":105000, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"接班人" + }, + { + "GroupTitle":false, + "Column":"备注", + "TextAlign":"MiddleCenter", + "Text":"备注" + } + ] + }, + "Group":[ + { + "Name":"Group1", + "ByFields":"日期", + "GroupHeader":{ + "Height":0, + "PrintGridBorder":false, + "NewPageColumn":"Before" + }, + "GroupFooter":{ + "Visible":false, + "PrintGridBorder":false + } + } + ] + }, + "Parameter":[ + { + "Name":"machine_id" + }, + { + "Name":"startDate", + "DataType":"DateTime" + }, + { + "Name":"endDate", + "DataType":"DateTime" + } + ], + "ReportHeader":[ + { + "Name":"ReportHeader1", + "Height":1.79917, + "Control":[ + { + "Type":"MemoBox", + "Name":"MemoBox1", + "Dock":"Fill", + "Center":"Both", + "Font":{ + "Name":"宋体", + "Size":262500, + "Bold":true, + "Charset":134 + }, + "TextAlign":"MiddleCenter", + "Text":"麻醉药品、第一类精神药品交接班记录" + } + ], + "RepeatOnPage":true + } + ] +} \ No newline at end of file diff --git a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs index 7cf17b3..38186d5 100644 --- a/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs +++ b/DM_Weight/ViewModels/CheckStockNewWindowViewModel.cs @@ -331,12 +331,14 @@ namespace DM_Weight.ViewModels { if (Status == 0) { + logger.Info("开始盘点"); enumerable = ChannelStocks.GroupBy(cs => cs.DrawerNo, cs => cs); //enumerable = ChannelStocks.GroupBy(cs => cs.Location, cs => cs); enumerator = enumerable.GetEnumerator(); enumerator.MoveNext(); Status = 1; OpenOneByOne(); + logger.Info("结束盘点"); } }); } diff --git a/DM_Weight/ViewModels/LoginWindowViewModel.cs b/DM_Weight/ViewModels/LoginWindowViewModel.cs index 1b95b96..5c2951e 100644 --- a/DM_Weight/ViewModels/LoginWindowViewModel.cs +++ b/DM_Weight/ViewModels/LoginWindowViewModel.cs @@ -343,7 +343,7 @@ _exitCommand ??= new DelegateCommand(Exit); { UserList userList = SqlSugarHelper.Db.Queryable() .Includes(u => u.Role) - .First(u => u.Id == msg.Id); + .First(u => u.Id == msg.Id&& ConfigurationManager.AppSettings["machineId"].ToString().Equals(u.MachineId)); //UserList userList = new UserService().CheckUserByFingerPrinter(msg.Id); diff --git a/DM_Weight/ViewModels/MainWindowViewModel.cs b/DM_Weight/ViewModels/MainWindowViewModel.cs index 048f8f4..17af269 100644 --- a/DM_Weight/ViewModels/MainWindowViewModel.cs +++ b/DM_Weight/ViewModels/MainWindowViewModel.cs @@ -88,11 +88,11 @@ namespace DM_Weight.ViewModels _regionManager.RequestNavigate("MainRegion", "BeforeLogin"); })); - string bAutoWriteNum = ConfigurationManager.AppSettings["AutoWriteNum"] ?? "false"; - if (bAutoWriteNum == "true") - { - Task.Factory.StartNew(() => BindStock()); - } + //string bAutoWriteNum = ConfigurationManager.AppSettings["AutoWriteNum"] ?? "false"; + //if (bAutoWriteNum == "true") + //{ + // Task.Factory.StartNew(() => BindStock()); + //} } void doMyPrismEvent2(AlertMsg msg) diff --git a/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs b/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs index 631bf20..8b9e688 100644 --- a/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs +++ b/DM_Weight/ViewModels/MultiOrderTakeDialogViewModel.cs @@ -31,6 +31,14 @@ namespace DM_Weight.ViewModels private static readonly DateTime Jan1st1970 = new DateTime (1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + //取药人(科室) + private string receivePerson; + public string ReceivePerson + { + get => receivePerson; + set => SetProperty(ref receivePerson, value); + } + private PortUtil _portUtil; IEventAggregator _eventAggregator; IDialogService _dialogService; @@ -412,7 +420,12 @@ namespace DM_Weight.ViewModels OperationTime = DateTime.Now, Quantity = orderTakeQuantity, Type = 2, - InvoiceId = InvoiceId + InvoiceId = InvoiceId, + StockQuantity = nowChannels.Sum(it => it.Quantity), + ManunoQuantity = nowChannels.FindAll(it2 => it2.ManuNo == it.ManuNo).Sum(it => it.Quantity), + SupplierDept = ConfigurationManager.AppSettings["receiveDept"].ToString(), + ReceiveDept = OrderInfo[0].DeptName, + ReceivePerson = ReceivePerson //,StockQuantity = nowChannels.Sum(it => it.Quantity) }).ExecuteCommand(); } diff --git a/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml b/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml index e1f3cdc..a6489d1 100644 --- a/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml +++ b/DM_Weight/Views/Dialog/MultiOrderTakeDialog.xaml @@ -149,6 +149,10 @@ Content="取药" Command="{Binding OpenDrawer}"> --> +