From cb09e98cbd49c4f3978c3a0d059a4cc71f70a30d Mon Sep 17 00:00:00 2001 From: maqiao <625215135@qq.com> Date: Tue, 2 Jul 2024 15:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E9=A2=86=E5=85=A5=E5=BA=93=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=80=89=E6=8B=A9=E8=AF=B7=E9=A2=86=E5=8D=95=E5=90=8E?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=8D=AF=E5=93=81id=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=80=89=E4=B8=AD=E8=A1=8C=E7=9A=84=E8=8D=AF=E5=93=81?= =?UTF-8?q?id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs index aafcec0..261b93a 100644 --- a/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs +++ b/DM_Weight/ViewModels/ApplyInStockWindowViewModel.cs @@ -359,6 +359,16 @@ namespace DM_Weight.ViewModels .OrderBy(cs => cs.DrawerNo) .OrderBy(cs => cs.ColNo) .First(); + if(q is null) + { + AlertMsg alertMsg = new AlertMsg + { + Message = "药品没有绑定库位信息!", + Type = MsgType.ERROR, + }; + _eventAggregator.GetEvent().Publish(alertMsg); + return; + } q.AddQuantity = drugPleaseManuNo.Quantity; csList.Add(q); @@ -438,7 +448,7 @@ namespace DM_Weight.ViewModels int totalCount = 0; var sb = new StringBuilder(); - sb.Append("SELECT i.please_no,i.do_date,i.totalQuantity,count(1) as get_quantity,drug_manu_no,machine_id from drug_please_claim i inner join "); + sb.Append("SELECT i.please_no,i.do_date,i.totalQuantity,count(1) as get_quantity,drug_manu_no,machine_id,i.drug_id from drug_please_claim i inner join "); sb.Append(" ( select c.drug_id as drug_id from channel_stock c where c.machine_id = 'DM3' group by c.drug_id ) di on di.drug_id = i.drug_id WHERE state=@State and type=@Type "); if (OrderDate != null)