diff --git a/MasaBlazorApp3/DataAccess/Dao/IOrderInfoDao.cs b/MasaBlazorApp3/DataAccess/Dao/IOrderInfoDao.cs index 7eba559..7369797 100644 --- a/MasaBlazorApp3/DataAccess/Dao/IOrderInfoDao.cs +++ b/MasaBlazorApp3/DataAccess/Dao/IOrderInfoDao.cs @@ -35,6 +35,6 @@ namespace MasaBlazorApp3.DataAccess.Dao /// 获取指定药盒号 public Task> GetDrawerNumByOperationNum(string machineId, List operationNum); //核对处方 - public Task CheckOrderInfo(IList selectedOrderInfos, int DrawerNo); + public Task CheckOrderInfo(IList selectedOrderInfos, BoxModel boxModel); } } diff --git a/MasaBlazorApp3/DataAccess/Impl/DrugInfoDao.cs b/MasaBlazorApp3/DataAccess/Impl/DrugInfoDao.cs index 20bde97..fdd8290 100644 --- a/MasaBlazorApp3/DataAccess/Impl/DrugInfoDao.cs +++ b/MasaBlazorApp3/DataAccess/Impl/DrugInfoDao.cs @@ -119,6 +119,7 @@ namespace MasaBlazorApp3.DataAccess.Impl .Where(di => di.DrugId == drugInfo.DrugId) .Set(di => di.DrugName, drugInfo.DrugName) .Set(di => di.DrugSpec, drugInfo.DrugSpec) + .Set(di=>di.PackH,drugInfo.PackH) .Set(di => di.Manufactory, drugInfo.Manufactory); return statement.Update() > 0; } diff --git a/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs b/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs index 2a0af4e..73947a3 100644 --- a/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs +++ b/MasaBlazorApp3/DataAccess/Impl/OrderInfoDao.cs @@ -784,13 +784,15 @@ namespace MasaBlazorApp3.DataAccess.Impl public async Task> GetDrawerNumByOperationNum(string machineId,List operationNum) { List boxModelList = new List(); + var query = _connection.ChannelStock + .Where(cs => cs.MachineId == machineId && operationNum.Contains(cs.DrawerNo)&&cs.Quantity>0); boxModelList =await _connection.ChannelStock .Where(cs => cs.MachineId == machineId&& operationNum.Contains(cs.DrawerNo)) - .Select(cs => new BoxModel { BoxName = cs.DrawerNo.ToString(), BoxNo = Convert.ToInt32(cs.ColNo) }).ToListAsync(); + .Select(cs => new BoxModel { BoxName = cs.DrawerNo.ToString(), BoxNo = Convert.ToInt32(cs.ColNo) }).Distinct().ToListAsync(); return boxModelList; } //核对处方 - public async Task CheckOrderInfo(IList selectedOrderInfos, BoxModel DrawerNo) + public async Task CheckOrderInfo(IList selectedOrderInfos, BoxModel boxModel) { try { @@ -806,7 +808,7 @@ namespace MasaBlazorApp3.DataAccess.Impl OrderInfo oi = selectedOrderInfos[i]; - int drawerNo = DrawerNo.BoxNo; + int drawerNo =Convert.ToInt32(boxModel.BoxName); if (oi.DetailInfo != null && oi.DetailInfo.Id > 0) { //ChannelStock? cs = _connection.ChannelStock.AsQueryable() @@ -821,7 +823,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&&cs.ColNo==DrawerNo.BoxNo).OrderBy(cs => cs.EffDate).ToList(); + && cs.DrawerNo == drawerNo&&cs.ColNo== boxModel.BoxNo).OrderBy(cs => cs.EffDate).ToList(); if (cs.Count <= 0) { logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存"); @@ -839,6 +841,7 @@ namespace MasaBlazorApp3.DataAccess.Impl if (oi.Status == 0) { int iUpdate = _connection.OrderInfo.Where(o => o.OrderNo == oi.OrderNo).Set(o => o.Status, 2).Update(); + int odUpdate = _connection.OrderDetail.Where(od => od.OrderNo == oi.OrderNo).Set(od => od.SetManuNo, oi.DetailInfo.drugManuNo.ManuNo).Update(); _connection.Insert(new OrderFinish() { OrderNo = oi.OrderNo, @@ -1008,6 +1011,8 @@ namespace MasaBlazorApp3.DataAccess.Impl _message.Notify( new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"有未核对处方:{empChannelStock}", Duration = 4000 } ); + _connection.RollbackTransaction(); + return false; } if (bFlag) { @@ -1029,9 +1034,5 @@ namespace MasaBlazorApp3.DataAccess.Impl } } - public Task CheckOrderInfo(IList selectedOrderInfos, int DrawerNo) - { - throw new NotImplementedException(); - } } } diff --git a/MasaBlazorApp3/DataAccess/Impl/ReportDataDao.cs b/MasaBlazorApp3/DataAccess/Impl/ReportDataDao.cs index 09cff6f..fe59648 100644 --- a/MasaBlazorApp3/DataAccess/Impl/ReportDataDao.cs +++ b/MasaBlazorApp3/DataAccess/Impl/ReportDataDao.cs @@ -109,10 +109,10 @@ namespace MasaBlazorApp3.DataAccess.Impl List accountList = new List(); int pagedData = 0; - string SQL = $@"SELECT oi.Order_date as portdate, od.drug_id as DrugId,1 as ShouShuJian,'' as ZhuMa,'' as FuMa,oi.patient_id as IDNumber,oi.p_name as PName,oi.disease as Diagnose, + string SQL = $@"SELECT oi.charge_Date as portdate, od.drug_id as DrugId,1 as ShouShuJian,'' as ZhuMa,'' as FuMa,oi.patient_id as IDNumber,oi.p_name as PName,oi.disease as Diagnose, CONCAT(di.drug_name,' ',di.drug_spec) as DrugName,od.set_manu_No as ManuNo,od.use_dosage as UsageDosage,'' as CanYeLiang,'' as CanYeChuZhi,'' as UseUserName,'' as CheckUserName from order_info oi inner join order_detail od on oi.order_no=od.order_no inner join drug_info di on od.drug_id=di.drug_id - WHERE DATE_FORMAT(oi.Order_date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1"; + WHERE DATE_FORMAT(oi.charge_Date,'%Y-%m-%d')='{searchDate?.ToString("yyyy-MM-dd")}' and oi.dm_status=2 and oi.cancel_flag=0 and oi.his_disp_flag=0 and di.pack_h=1"; diff --git a/MasaBlazorApp3/Pages/CheckOrder.razor b/MasaBlazorApp3/Pages/CheckOrder.razor index 8c5af9e..268915b 100644 --- a/MasaBlazorApp3/Pages/CheckOrder.razor +++ b/MasaBlazorApp3/Pages/CheckOrder.razor @@ -279,21 +279,21 @@ ); return; } - // 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 } - // ); - // } + 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() @@ -345,7 +345,7 @@ //查找该麻醉师对应的手术室 //List roomNameList = orderInfos.Select(it => it.RoomName).Distinct().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(); + BoxList = await orderInfoDao.GetDrawerNumByOperationNum(setting.Value.boxMachineId, 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/Pages/DrugList.razor b/MasaBlazorApp3/Pages/DrugList.razor index 4e56516..1d6b3b6 100644 --- a/MasaBlazorApp3/Pages/DrugList.razor +++ b/MasaBlazorApp3/Pages/DrugList.razor @@ -40,7 +40,7 @@ -
+
+ AllowPaging="true" PageSize="5" PagerHorizontalAlign="HorizontalAlign.Left" ColumnWidth="100px" ShowPagingSummary="true" PagingSummaryFormat="{0}/{1} {2}"> - + @@ -70,12 +70,17 @@ - + + + + + +