修改提交

This commit is contained in:
马巧 2025-08-30 10:12:11 +08:00
parent 0ccef22fbd
commit 9712c1e30c
3 changed files with 41 additions and 21 deletions

View File

@ -790,7 +790,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
return boxModelList; return boxModelList;
} }
//核对处方 //核对处方
public async Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo) public async Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, BoxModel DrawerNo)
{ {
try try
{ {
@ -806,7 +806,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
OrderInfo oi = selectedOrderInfos[i]; OrderInfo oi = selectedOrderInfos[i];
int drawerNo = DrawerNo; int drawerNo = DrawerNo.BoxNo;
if (oi.DetailInfo != null && oi.DetailInfo.Id > 0) if (oi.DetailInfo != null && oi.DetailInfo.Id > 0)
{ {
//ChannelStock? cs = _connection.ChannelStock.AsQueryable() //ChannelStock? cs = _connection.ChannelStock.AsQueryable()
@ -821,7 +821,7 @@ namespace MasaBlazorApp3.DataAccess.Impl
&& cs.ManuNo == oi.DetailInfo.drugManuNo.ManuNo && cs.ManuNo == oi.DetailInfo.drugManuNo.ManuNo
&& cs.EffDate == ((DateTime)oi.DetailInfo.drugManuNo.EffDate).ToString("yyyy-MM-dd") && cs.EffDate == ((DateTime)oi.DetailInfo.drugManuNo.EffDate).ToString("yyyy-MM-dd")
&& cs.MachineId.Equals(_setting.boxMachineId) && 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) if (cs.Count <= 0)
{ {
logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存"); logger.Info($"处方{oi.OrderNo}中药品{oi.DetailInfo.DrugId}在{drawerNo}号药盒无库存");
@ -1029,5 +1029,9 @@ namespace MasaBlazorApp3.DataAccess.Impl
} }
} }
public Task<bool> CheckOrderInfo(IList<OrderInfo> selectedOrderInfos, int DrawerNo)
{
throw new NotImplementedException();
}
} }
} }

View File

@ -74,7 +74,9 @@
<RadzenLabel Text="核对药箱" Component="BoxList" Style="margin:0.5rem" /> <RadzenLabel Text="核对药箱" Component="BoxList" Style="margin:0.5rem" />
<RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum" <RadzenDropDownDataGrid AllowVirtualization="true" Name="BoxList" TValue="BoxModel" Data="@BoxList" @bind-Value="BoxNum"
AllowFilteringByAllStringColumns="true" TextProperty="BoxName"> AllowFilteringByAllStringColumns="true" TextProperty="BoxName">
<Template>
@((context as BoxModel).BoxName + "-" + (context as BoxModel).BoxNo)
</Template>
<Columns> <Columns>
<RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" /> <RadzenDropDownDataGridColumn Property="BoxName" Title="药箱号" Sortable="false" />
</Columns> </Columns>
@ -256,6 +258,20 @@
//确认 //确认
async Task Confirm() 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)) if (selectedOrderInfos.Any(it => it.DetailInfo.drugManuNo == null))
{ {
_message.Notify( _message.Notify(
@ -263,21 +279,21 @@
); );
return; return;
} }
bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum.BoxNo); // bool bResult = await orderInfoDao.CheckOrderInfo(selectedOrderInfos, BoxNum);
if (bResult) // if (bResult)
{ // {
_message.Notify( // _message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 } // new NotificationMessage { Severity = NotificationSeverity.Success, Summary = "提示", Detail = $"处方已核对完成", Duration = 4000 }
); // );
await GetInitialDate(); // await GetInitialDate();
await grid.Reload(); // await grid.Reload();
} // }
else // else
{ // {
_message.Notify( // _message.Notify(
new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 } // new NotificationMessage { Severity = NotificationSeverity.Error, Summary = "提示", Detail = $"处方已核对失败", Duration = 4000 }
); // );
} // }
} }
PageData<OrderInfo> result; PageData<OrderInfo> result;
protected override async Task OnInitializedAsync() protected override async Task OnInitializedAsync()
@ -328,7 +344,7 @@
//查找该麻醉师对应的手术室 //查找该麻醉师对应的手术室
//List<string> roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList(); //List<string> roomNameList = orderInfos.Select(it => it.RoomName).Distinct().ToList();
List<int> roomNameList = orderInfos.Select(it => Convert.ToInt32(it.RoomName.Substring(it.RoomName.Length - 2, 2))).ToList(); List<int> 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.machineId, roomNameList); //roomNameList.Select(it => new BoxModel { BoxName = it, BoxNo = Convert.ToInt32(it.Substring(it.Length - 2, 2)) }).ToList();
BoxNum = BoxList.FirstOrDefault(); BoxNum = BoxList.FirstOrDefault();

View File

@ -54,7 +54,7 @@ internal class Program
// 数据库 // 数据库
appBuilder.Services.AddLinqToDBContext<AppDataConnection>((provider, options) => appBuilder.Services.AddLinqToDBContext<AppDataConnection>((provider, options) =>
options.UseMySql(config.GetValue<String>("connectionStrings")) options.UseMySql(config.GetValue<String>("connectionStrings"))
.UseDefaultLogging(provider), ServiceLifetime.Scoped); .UseDefaultLogging(provider), ServiceLifetime.Transient);
// dao层数据库操作 // dao层数据库操作
appBuilder.Services.AddScoped<IUserDao, UserDao>(); appBuilder.Services.AddScoped<IUserDao, UserDao>();
appBuilder.Services.AddScoped<IRoleDao, RoleDao>(); appBuilder.Services.AddScoped<IRoleDao, RoleDao>();