From ff96d4e67648738a20d9f7b2852cf72540e4dd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E5=B7=A7?= <625215135@qq.com> Date: Fri, 27 Jun 2025 09:54:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DataAccess/Dao/IChannelListDao.cs | 27 +- .../DataAccess/Impl/ChannelListDao.cs | 455 +++++++++++++++++- .../DataAccess/Impl/OrderInfoDao.cs | 8 +- MasaBlazorApp3/Pages/BoxAddBox.razor | 11 +- .../Pages/BoxAddBoxDetailDialog.razor | 2 +- MasaBlazorApp3/Pages/BoxAddDetailDialog.razor | 2 +- MasaBlazorApp3/Pages/BoxAddDrug.razor | 11 +- MasaBlazorApp3/Pages/BoxRemoveDialog.razor | 131 +++++ MasaBlazorApp3/Pages/BoxReplace.razor | 169 +++++++ MasaBlazorApp3/Pages/BoxStock.razor | 239 +++++++++ MasaBlazorApp3/Pojo/ChannelList.cs | 2 + MasaBlazorApp3/Pojo/MachineRecord.cs | 2 +- MasaBlazorApp3/Pojo/PlanDetails.cs | 6 +- MasaBlazorApp3/Pojo/Premission.cs | 6 + MasaBlazorApp3/appsettings.json | 8 +- 15 files changed, 1044 insertions(+), 35 deletions(-) create mode 100644 MasaBlazorApp3/Pages/BoxRemoveDialog.razor create mode 100644 MasaBlazorApp3/Pages/BoxReplace.razor create mode 100644 MasaBlazorApp3/Pages/BoxStock.razor diff --git a/MasaBlazorApp3/DataAccess/Dao/IChannelListDao.cs b/MasaBlazorApp3/DataAccess/Dao/IChannelListDao.cs index e7c14bd..0633963 100644 --- a/MasaBlazorApp3/DataAccess/Dao/IChannelListDao.cs +++ b/MasaBlazorApp3/DataAccess/Dao/IChannelListDao.cs @@ -50,10 +50,35 @@ namespace MasaBlazorApp3.DataAccess.Dao //手术室药箱补药获取毒麻柜中的药品信息 Task> getTakeInfoByBox(ChannelList cl); //手术室药箱补药完成 - Task BoxTakeFinish(List datas); + Task BoxTakeFinish(List datas, ChannelList boxChannelList); //手术室药箱入库 Task> GetBoxWaitInfo(int? take, int? skip); //手术室药箱入库获取待入库明细 Task> getBoxWaitByBox(ChannelList cl); + + + //手术室药箱获取药箱药品及库存信息 + Task> GetBoxDrugInfo(int DrawerNo, int? take, int? skip); + //药箱移库时获取选中药箱号的药品信息 + Task> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip); + + /// + /// 药箱交换药品获取所有除本药箱外的所有药箱号 + /// + /// + /// + Task GetDrawerNum(ChannelStock channelStock); + + /// + /// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱号 + /// + /// + /// + Task GetDrawerNumForRemove(ChannelStock channelStock); + + //手术室药箱交换药品完成 + Task BoxReplaceFinish(ChannelStock stock, List Stocks); + //手术室药箱移出药品完成 + Task BoxRemoveFinish(ChannelStock stock, int SelectedDrawerNo, int removeQuantity); } } diff --git a/MasaBlazorApp3/DataAccess/Impl/ChannelListDao.cs b/MasaBlazorApp3/DataAccess/Impl/ChannelListDao.cs index 55a5da5..229ea69 100644 --- a/MasaBlazorApp3/DataAccess/Impl/ChannelListDao.cs +++ b/MasaBlazorApp3/DataAccess/Impl/ChannelListDao.cs @@ -704,7 +704,7 @@ namespace MasaBlazorApp3.DataAccess.Impl { List channelLists = new List(); var query = _connection.ChannelStock//.AsQueryable() - .Where(cs => cs.MachineId == _setting.boxMachineId&&cs.BoxState==1) + .Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 1) .GroupBy(cs => new { cs.DrawerNo, cs.DrugId }) .Select(g => new { @@ -715,7 +715,7 @@ namespace MasaBlazorApp3.DataAccess.Impl .ToList(); var queryChannelStock = _connection.ChannelStock.AsQueryable() - .Where(cs => cs.MachineId == _setting.boxMachineId&&cs.BoxState==1) + .Where(cs => cs.MachineId == _setting.boxMachineId && cs.BoxState == 1) .LoadWith(cs => cs.Drug).ToList(); @@ -729,7 +729,7 @@ namespace MasaBlazorApp3.DataAccess.Impl ChannelStock stock = queryChannelStock.Where(cs => cs.DrawerNo == item.DrawerNo && cs.DrugId == item.DrugId && cs.BaseQuantity > item.sumQuantity).FirstOrDefault(); if (stock != null) { - stock.NeedQuantity = stock.BaseQuantity-item.sumQuantity; + stock.NeedQuantity = stock.BaseQuantity - item.sumQuantity; queryList[i].ChannelStocks.Add(stock); } } @@ -772,9 +772,9 @@ namespace MasaBlazorApp3.DataAccess.Impl // 当前药品取药数量 var Quantity = boxCs.NeedQuantity; List stockList = await _connection.ChannelStock - .Where(cs=>cs.MachineId==_setting.machineId&&cs.DrawerType==1&&cs.DrugId==boxCs.DrugId&&cs.Quantity>0&&cs.ManuNo!=null) + .Where(cs => cs.MachineId == _setting.machineId && cs.DrawerType == 1 && cs.DrugId == boxCs.DrugId && cs.Quantity > 0 && cs.ManuNo != null) .AsQueryable() - .OrderBy(cs=>cs.EffDate).ToListAsync(); + .OrderBy(cs => cs.EffDate).ToListAsync(); // 当前药品的库存总量 var total = stockList.Sum(current => current.Quantity); @@ -801,7 +801,7 @@ namespace MasaBlazorApp3.DataAccess.Impl tempData.Add(new BoxTakeVo() { Drug = boxCs.Drug, - BoxDetail= boxCs, + BoxDetail = boxCs, ChannelStock = stock, StockQuantity = total, Quantity = stock.Quantity, @@ -848,7 +848,7 @@ namespace MasaBlazorApp3.DataAccess.Impl } } //手术室药箱补药完成 - public async Task BoxTakeFinish(List datas) + public async Task BoxTakeFinish(List datas, ChannelList boxChannelList) { try @@ -950,19 +950,20 @@ namespace MasaBlazorApp3.DataAccess.Impl #endregion //更新药箱中的药品数量 - int boxID = _connection.Insert(new ChannelStock() { + int boxID = _connection.Insert(new ChannelStock() + { Id = Guid.NewGuid().ToString(), ListId = boxTakeVo.BoxDetail.Id, MachineId = _setting.boxMachineId, DrawerNo = boxTakeVo.BoxDetail.DrawerNo, AddToQuantity = boxTakeVo.GetQuantity, - NeedQuantity=0, + NeedQuantity = 0, DrugId = boxTakeVo.ChannelStock.DrugId, ManuNo = boxTakeVo.ChannelStock.ManuNo, - EffDate= boxTakeVo.ChannelStock.EffDate, + EffDate = boxTakeVo.ChannelStock.EffDate, BaseQuantity = boxTakeVo.BoxDetail.BaseQuantity, BoardType = boxTakeVo.BoxDetail.BoardType, - BoxState= 2 //补药完成 + BoxState = 2 //补药完成 }); // 手术室药箱入库记录 int boxMId = _connection.InsertWithInt32Identity(new MachineRecord() @@ -979,12 +980,12 @@ namespace MasaBlazorApp3.DataAccess.Impl Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id, InvoiceId = boxTakeVo.ChannelStock.Id.ToString(), }); - int totalQuantity = _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxTakeVo.BoxDetail.DrugId)).Sum(p => p.BaseQuantity); - int list=_connection.ChannelList.Where(cl => cl.Id == boxTakeVo.BoxDetail.Id) + int totalQuantity = _connection.PlanDetails.Where(p => p.PlanId == Convert.ToInt32(boxChannelList.DrugId)&&p.DrugId== boxTakeVo.BoxDetail.DrugId).Sum(p => p.BaseQuantity); + int list = _connection.ChannelList.Where(cl => cl.Id == boxChannelList.Id) .Set(cl => cl.TotalQuantity, totalQuantity) .Update(); int delResutl = await _connection.ChannelStock.Where(cs => cs.Id == boxTakeVo.BoxDetail.Id).DeleteAsync(); - if (mid > 0 && r > 0 && boxID > 0&& boxMId>0&& delResutl>0&& list>0) + if (mid > 0 && r > 0 && boxID > 0 && boxMId > 0 && list > 0) { if (boxTakeVo.ChannelStock.BoardType.ToString().Contains("5")) { @@ -1167,5 +1168,431 @@ namespace MasaBlazorApp3.DataAccess.Impl return null; } } + + //手术室药箱获取药箱药品及库存信息 + public async Task> GetBoxDrugInfo(int DrawerNo, int? take, int? skip) + { + var query = _connection.PlanDetails.AsQueryable() + .InnerJoin( + _connection.ChannelList.Where(cl => cl.MachineId == _setting.boxMachineId && cl.DrawerNo.Equals(DrawerNo)), + (pd, cl) => pd.PlanId.ToString() == cl.DrugId, + (pd, cl) => pd); + + + + int pagedData = await query.CountAsync(); + + List list = await query + .LoadWith(pd => pd._DrugInfo) + //.LoadWith(pd => cl._PlanDetails._DrugInfo) + .OrderBy((pd) => pd.DrugId) + //.ThenBy((cl) => cl.ColNo) + .Skip((int)skip) + .Take((int)take) + .ToListAsync(); + if (list != null && list.Count > 0) + { + for (int i = 0; i < list.Count; i++) + { + list[i].channelStocks = _connection.ChannelStock.AsQueryable() + .Where(cs => cs.MachineId == _setting.boxMachineId && cs.DrawerNo == DrawerNo && cs.DrugId == list[i].DrugId) + .LoadWith(cs => cs.Drug) + .LoadWith(cs => cs.Drug.Manus) + .ToList(); + } + } + + //List list = await query + // .LoadWith(cl => cl.Drug) + // .LoadWith(cl => cl.Drug.Manus) + // .LoadWith(cl => cl.drugManuNo) + // .OrderBy((cl) => cl.DrawerNo) + // .ThenBy((cl) => cl.ColNo) + // .Skip((int)skip) + // .Take((int)take) + // .ToListAsync(); + + + return new PageData() + { + + TotalDesserts = pagedData, + Desserts = list + }; + } + + //药箱移库时获取选中药箱号的药品信息 + public async Task> GetChannelStockByDrug(ChannelStock cs, int drawerNo, int? take, int? skip) + { + try + { + var query = _connection.ChannelStock.AsQueryable().Where(c => c.MachineId == _setting.boxMachineId && c.DrawerNo.Equals(drawerNo) && c.DrugId.Equals(cs.DrugId)&&c.ManuNo!=cs.ManuNo&&c.EffDate!=cs.EffDate); + + + + int pagedData = await query.CountAsync(); + + List list = await query + .LoadWith(cs => cs.Drug) + .OrderBy((cs) => cs.DrugId) + .Skip((int)skip) + .Take((int)take) + .ToListAsync(); + + return new PageData() + { + + TotalDesserts = pagedData, + Desserts = list + }; + } + catch (Exception ex) + { + logger.Info($"药箱移库时获取选中药箱号的药品信息异常:{ex.Message}"); + return null; + } + } + + + /// + /// 药箱交换药品获取所有除本药箱外的所有药箱号 + /// + /// + /// + public async Task GetDrawerNum(ChannelStock channelStock) + { + int[] ints = _connection.ChannelStock.Where(cs => cs.MachineId == channelStock.MachineId && cs.DrugId == channelStock.DrugId && cs.DrawerNo != channelStock.DrawerNo && !string.IsNullOrEmpty(cs.ManuNo)&&cs.ManuNo!=channelStock.ManuNo) + .GroupBy(cs => cs.DrawerNo).Select(cs => cs.Key).ToArray(); + return ints; + } + /// + /// 药箱移除药品,获取所有除本药箱外的所有包含该药品的药箱号 + /// + /// + /// + public async Task GetDrawerNumForRemove(ChannelStock channelStock) + { + int[] ints = _connection.ChannelStock.Where(cs => cs.MachineId == channelStock.MachineId && cs.DrugId == channelStock.DrugId && cs.DrawerNo != channelStock.DrawerNo).GroupBy(cs => cs.DrawerNo).Select(cs => cs.Key).ToArray(); + return ints; + } + //手术室药箱交换药品完成 + public async Task BoxReplaceFinish(ChannelStock stock, List stockList) + { + try + { + bool flag = true; + _connection.BeginTransaction(); + for (int i = 0; i < stockList.Count; i++) + { + //查询出药的药箱是否有该批次的药品 + ChannelStock replace1ChannelStock = _connection.ChannelStock.AsQueryable() + .Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stock.DrawerNo && cs.DrugId == stockList[i].DrugId && cs.ManuNo == stockList[i].ManuNo && cs.EffDate == stockList[i].EffDate) + .FirstOrDefault(); + if (replace1ChannelStock != null) + { + //如果有该批次的药品,则更新数量 + int r = _connection.ChannelStock.Where(cs => cs.Id == replace1ChannelStock.Id) + .Set(cs => cs.Quantity, replace1ChannelStock.Quantity + stockList[i].AddQuantity) + .Update(); + if (r <= 0) + { + logger.Info($"更新药箱药品数量失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); + } + } + else + { + //如果没有该批次的药品,则新增一条记录 + int mid = _connection.Insert(new ChannelStock() + { + Id = Guid.NewGuid().ToString(), + MachineId = stockList[i].MachineId, + DrawerNo = stock.DrawerNo, + DrugId = stockList[i].DrugId, + ManuNo = stockList[i].ManuNo, + EffDate = stockList[i].EffDate, + Quantity = stockList[i].AddToQuantity, + BaseQuantity = stockList[i].BaseQuantity, + BoxState = 1 + }); + if (mid <= 0) + { + logger.Info($"新增药箱药品记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); + flag = false; + break; + } + } + + //记录操作记录 + int recordId = _connection.InsertWithInt32Identity(new MachineRecord() + { + MachineId = stock.MachineId, + DrawerNo = stock.DrawerNo, + DrugId = stock.DrugId, + ManuNo = stock.ManuNo, + EffDate = !String.IsNullOrEmpty(stock.EffDate) ? DateTime.ParseExact(stock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null, + OperationTime = DateTime.Now, + Type = 69, //交换 + Quantity = stockList[i].AddQuantity, + Operator = _globalStateService.Operator.Id, + Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id, + InvoiceId = stockList[i].Id.ToString(), + }); + if(recordId <= 0) + { + logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); + flag = false; + break; + } + + + + //更新入药的药箱中的药品数量 + ChannelStock replace2ChannelStock = _connection.ChannelStock.AsQueryable() + .Where(cs => cs.MachineId == stockList[i].MachineId && cs.DrawerNo == stockList[i].DrawerNo && cs.DrugId == stock.DrugId && cs.ManuNo == stock.ManuNo && cs.EffDate == stock.EffDate) + .FirstOrDefault(); + if (replace2ChannelStock != null) + { + //如果有该批次的药品,则更新数量 + int r = _connection.ChannelStock.Where(cs => cs.Id == replace2ChannelStock.Id) + .Set(cs => cs.Quantity, replace2ChannelStock.Quantity + stockList[i].AddQuantity) + .Update(); + if (r <= 0) + { + logger.Info($"更新药箱药品数量失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); + flag= false; + break; + } + } + else + { + //如果没有该批次的药品,则新增一条记录 + int mid = _connection.Insert(new ChannelStock() + { + Id = Guid.NewGuid().ToString(), + MachineId = stockList[i].MachineId, + DrawerNo = stockList[i].DrawerNo, + DrugId = stock.DrugId, + ManuNo = stock.ManuNo, + EffDate = stock.EffDate, + Quantity = stockList[i].AddQuantity, + BaseQuantity = stock.BaseQuantity, + BoxState = 1 + }); + if (mid <= 0) + { + logger.Info($"新增药箱药品记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); + flag= false; + break; + } + + } + //记录操作记录 + int record2Id = _connection.InsertWithInt32Identity(new MachineRecord() + { + MachineId = stockList[i].MachineId, + DrawerNo = stockList[i].DrawerNo, + DrugId = stockList[i].DrugId, + ManuNo = stockList[i].ManuNo, + EffDate = !String.IsNullOrEmpty(stockList[i].EffDate) ? DateTime.ParseExact(stockList[i].EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null, + OperationTime = DateTime.Now, + Type = 69, //交换 + Quantity = stockList[i].AddQuantity, + Operator = _globalStateService.Operator.Id, + Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id, + InvoiceId = stock.Id.ToString(), + }); + if (record2Id <= 0) + { + logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); + flag = false; + break; + } + //出库药箱减数量 + int updateQuantity = _connection.ChannelStock.Where(cs => cs.Id == stock.Id) + .Set(cs => cs.Quantity, stock.Quantity - stockList[i].AddQuantity) + .Update(); + if (updateQuantity <= 0) + { + logger.Info($"更新出库药箱药品减数量失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}"); + flag = false; + break; + } + //入库药箱减数量 + int updateQuantity2 = _connection.ChannelStock.Where(cs => cs.Id == stockList[i].Id) + .Set(cs => cs.Quantity, stockList[i].Quantity - stockList[i].AddQuantity) + .Update(); + if (updateQuantity2 <= 0) + { + logger.Info($"更新入库药箱药品减数量失败,药箱号:{stockList[i].DrawerNo},药品ID:{stockList[i].DrugId}"); flag = false; + break; + } + } + if (flag) + { + + _connection.CommitTransaction(); + } + else + { + _connection.RollbackTransaction(); + } + return flag; + + } + catch (Exception ex) + { + logger.Info($"手术室药箱交换药品完成异常:{ex.Message}"); + _connection.RollbackTransaction(); + return false; + } + } + //手术室药箱移出药品完成 + public async Task BoxRemoveFinish(ChannelStock stock,int SelectedDrawerNo,int removeQuantity) + { + try + { + bool flag = true; + _connection.BeginTransaction(); + //查询移入的药品是否有库存 + ChannelStock inChannelStock = _connection.ChannelStock.AsQueryable() + .Where(cs => cs.MachineId == stock.MachineId && cs.DrawerNo == SelectedDrawerNo && cs.DrugId == stock.DrugId && cs.ManuNo == stock.ManuNo && cs.EffDate == stock.EffDate) + .FirstOrDefault(); + if (inChannelStock != null) + { + //如果有该批次的药品,则更新数量 + int r = _connection.ChannelStock.Where(cs => cs.Id == inChannelStock.Id) + .Set(cs => cs.Quantity, inChannelStock.Quantity + removeQuantity) + .Update(); + if (r <= 0) + { + logger.Info($"手术室药箱移出药品更新数量失败,药箱号:{SelectedDrawerNo},药品ID:{stock.DrugId}"); + } + } + else + { + //如果没有该批次的药品,先查询是否有未绑批次的,有则更新批次信息,无则新增一条记录 + ChannelStock inDrugChannelStock = _connection.ChannelStock.AsQueryable() + .Where(cs => cs.MachineId == stock.MachineId && cs.DrawerNo == SelectedDrawerNo && cs.DrugId == stock.DrugId ) + .FirstOrDefault(); + if (inDrugChannelStock != null) + { + int mid= _connection.ChannelStock.Where(cs => cs.Id == inDrugChannelStock.Id) + .Set(cs => cs.Quantity, removeQuantity) + .Set(cs=>cs.ManuNo, stock.ManuNo) + .Set(cs=>cs.EffDate,stock.EffDate) + .Update(); + if (mid <= 0) + { + logger.Info($"更新药箱药品批次记录失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}"); + flag = false; + } + } + else + { + int mid = _connection.Insert(new ChannelStock() + { + Id = Guid.NewGuid().ToString(), + MachineId = stock.MachineId, + DrawerNo = SelectedDrawerNo, + DrugId = stock.DrugId, + ManuNo = stock.ManuNo, + EffDate = stock.EffDate, + Quantity = removeQuantity, + BaseQuantity = stock.BaseQuantity, + BoxState = 1 + }); + if (mid <= 0) + { + logger.Info($"新增药箱药品记录失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}"); + flag = false; + } + } + } + if (flag) + { + //减本库位库存数量 + int updateQuantity2 = _connection.ChannelStock.Where(cs => cs.Id == stock.Id) + .Set(cs => cs.Quantity, stock.Quantity - removeQuantity) + .Update(); + if (updateQuantity2 <= 0) + { + logger.Info($"更新入库药箱药品减数量失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}"); + flag = false; + } + else + { + int updateTotalQuantity = 0; + int updateMoveToTotalQuantity=0; + //修改总库存数 + ChannelList channelList = _connection.ChannelList.Where(cl => cl.MachineId == stock.MachineId && cl.DrawerNo == stock.DrawerNo && cl.DrugId == stock.DrugId).FirstOrDefault(); + if(channelList!=null) + { + updateTotalQuantity = _connection.ChannelList.Where(cl => cl.Id == channelList.Id) + .Set(cl => cl.TotalQuantity, channelList.TotalQuantity - removeQuantity) + .Update(); + } + //修改移入药箱的总库存数 + ChannelList moveToChannelList = _connection.ChannelList.Where(cl => cl.MachineId == stock.MachineId && cl.DrawerNo == SelectedDrawerNo && cl.DrugId == stock.DrugId).FirstOrDefault(); + if (moveToChannelList != null) + { + updateTotalQuantity = _connection.ChannelList.Where(cl => cl.Id == moveToChannelList.Id) + .Set(cl => cl.TotalQuantity, channelList.TotalQuantity + removeQuantity) + .Update(); + } + if(updateTotalQuantity>0&&updateMoveToTotalQuantity > 0) + { + flag = true; + } + else + { + flag = false; + } + + } + if (flag) + { + //记录操作记录 + int recordId = _connection.InsertWithInt32Identity(new MachineRecord() + { + MachineId = stock.MachineId, + DrawerNo = stock.DrawerNo, + ColNo = SelectedDrawerNo,//移入的药箱号 + DrugId = stock.DrugId, + ManuNo = stock.ManuNo, + EffDate = !String.IsNullOrEmpty(stock.EffDate) ? DateTime.ParseExact(stock.EffDate, "yyyy-MM-dd", System.Globalization.CultureInfo.CurrentCulture) : null, + OperationTime = DateTime.Now, + Type = 21, //交换 + Quantity = removeQuantity, + Operator = _globalStateService.Operator.Id, + Reviewer = _globalStateService.Reviewer?.Id ?? _globalStateService.Operator.Id, + InvoiceId = stock.Id.ToString(), + }); + if (recordId <= 0) + { + logger.Info($"药箱{stock.DrawerNo}交换药品新增操作记录失败,药箱号:{stock.DrawerNo},药品ID:{stock.DrugId}"); + flag = false; + } + } + } + if (flag) + { + + _connection.CommitTransaction(); + } + else + { + _connection.RollbackTransaction(); + } + return flag; + + } + catch (Exception ex) + { + logger.Info($"手术室药箱移出药品异常{ex.Message}"); + _connection.RollbackTransaction(); + return false; + } + } + } } diff --git a/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs b/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs index abeb449..0ed7a82 100644 --- a/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs +++ b/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs @@ -68,8 +68,8 @@ namespace MasaBlazorApp3.DataAccess.Impl int pagedData = await query.CountAsync(); List list = await query - .LoadWith(oi => oi.Detail) - .LoadWith(oi => oi.Detail.Drug) + //.LoadWith(oi => oi.Detail) + //.LoadWith(oi => oi.Detail.Drug) .OrderBy((oi) => oi.RecvDate) .ThenBy((oi => oi.OrderNo)) .Skip((int)skip) @@ -619,8 +619,8 @@ namespace MasaBlazorApp3.DataAccess.Impl int pagedData = await query.CountAsync(); List list = await query - //.LoadWith(oi => oi.Detail) - //.LoadWith(oi => oi.Detail.Drug) + .LoadWith(oi => oi.Detail) + .LoadWith(oi => oi.Detail.Drug) .OrderBy((oi) => oi.RecvDate) .ThenBy((oi => oi.OrderNo)) .Skip((int)skip) diff --git a/MasaBlazorApp3/Pages/BoxAddBox.razor b/MasaBlazorApp3/Pages/BoxAddBox.razor index 82af903..5639aa9 100644 --- a/MasaBlazorApp3/Pages/BoxAddBox.razor +++ b/MasaBlazorApp3/Pages/BoxAddBox.razor @@ -43,12 +43,12 @@