diff --git a/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs b/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs index 1e1877b..2a0af4e 100644 --- a/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs +++ b/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs @@ -790,7 +790,7 @@ namespace MasaBlazorApp3.DataAccess.Impl return boxModelList; } //核对处方 - public async Task CheckOrderInfo(IList selectedOrderInfos, int DrawerNo) + public async Task CheckOrderInfo(IList selectedOrderInfos, BoxModel DrawerNo) { try { @@ -806,7 +806,7 @@ namespace MasaBlazorApp3.DataAccess.Impl OrderInfo oi = selectedOrderInfos[i]; - int drawerNo = DrawerNo; + int drawerNo = DrawerNo.BoxNo; if (oi.DetailInfo != null && oi.DetailInfo.Id > 0) { //ChannelStock? cs = _connection.ChannelStock.AsQueryable() @@ -821,7 +821,7 @@ namespace MasaBlazorApp3.DataAccess.Impl && cs.ManuNo == oi.DetailInfo.drugManuNo.ManuNo && cs.EffDate == ((DateTime)oi.DetailInfo.drugManuNo.EffDate).ToString("yyyy-MM-dd") && cs.MachineId.Equals(_setting.boxMachineId) - && cs.DrawerNo == drawerNo).OrderBy(cs => cs.EffDate).ToList(); + && cs.DrawerNo == drawerNo&&cs.ColNo==DrawerNo.BoxNo).OrderBy(cs => cs.EffDate).ToList(); if (cs.Count <= 0) { logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存"); @@ -1029,5 +1029,9 @@ namespace MasaBlazorApp3.DataAccess.Impl } } + public Task CheckOrderInfo(IList selectedOrderInfos, int DrawerNo) + { + throw new NotImplementedException(); + } } } diff --git a/MasaBlazorApp3/Pages/CheckOrder.razor b/MasaBlazorApp3/Pages/CheckOrder.razor index 131292a..8c5af9e 100644 --- a/MasaBlazorApp3/Pages/CheckOrder.razor +++ b/MasaBlazorApp3/Pages/CheckOrder.razor @@ -74,7 +74,9 @@ - + @@ -256,6 +258,20 @@ //确认 async Task Confirm() { + if (selectedOrderInfos==null) + { + _message.Notify( + new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择处方", Duration = 4000 } + ); + return; + } + if (BoxNum==null) + { + _message.Notify( + new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"请选择药箱", Duration = 4000 } + ); + return; + } if (selectedOrderInfos.Any(it => it.DetailInfo.drugManuNo == null)) { _message.Notify( @@ -263,21 +279,21 @@ ); return; } - bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum.BoxNo); - if (bResult) - { - _message.Notify( - new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 } - ); - await GetInitialDate(); - await grid.Reload(); - } - else - { - _message.Notify( - new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 } - ); - } + // bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum); + // if (bResult) + // { + // _message.Notify( + // new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 } + // ); + // await GetInitialDate(); + // await grid.Reload(); + // } + // else + // { + // _message.Notify( + // new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 } + // ); + // } } PageData result; protected override async Task OnInitializedAsync() @@ -328,7 +344,7 @@ //查找该麻醉师对应的手术室 //List roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList(); - List roomNameList = orderInfos.Select(it => Convert.ToInt32(it.RoomName.Substring(it.RoomName.Length - 2, 2))).ToList(); + List roomNameList = orderInfos.Select(it => Convert.ToInt32(it.RoomName.Substring(6, it.RoomName.Length - 6))).Distinct().ToList(); BoxList = await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.machineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList(); BoxNum = BoxList.FirstOrDefault(); diff --git a/MasaBlazorApp3/Program.cs b/MasaBlazorApp3/Program.cs index 7bb82d0..6209e87 100644 --- a/MasaBlazorApp3/Program.cs +++ b/MasaBlazorApp3/Program.cs @@ -54,7 +54,7 @@ internal class Program // 数据库 appBuilder.Services.AddLinqToDBContext((provider, options) => options.UseMySql(config.GetValue("connectionStrings")) - .UseDefaultLogging(provider), ServiceLifetime.Scoped); + .UseDefaultLogging(provider), ServiceLifetime.Transient); // dao层数据库操作 appBuilder.Services.AddScoped(); appBuilder.Services.AddScoped();