修改自动退出检测鼠标点击时间

This commit is contained in:
马巧 2025-09-29 14:44:48 +08:00
parent 694bbd71dc
commit 9e16a24d60
6 changed files with 30 additions and 8 deletions

View File

@ -235,7 +235,7 @@
WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1]; WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1] = orderTakeVo.BeforeQuantity[data[i].ChannelStock.ColNo - 1] - orderTakeVo.AfterQuantity[data[i].ChannelStock.ColNo - 1];
if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]) if (data[i].Quantity != WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1])
{ {
alertMessage += $"{data[i].Drug.DrugName}应取数量【{orderTakeVo.Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】"; alertMessage += $"{data[i].Drug.DrugName}应取数量【{data[i].Quantity}】,实际取出数量【{WeightFinnalQuantity[data[i].ChannelStock.ColNo - 1]}】";
} }
} }
} }

View File

@ -221,16 +221,22 @@
if (!_portUtil.Operate) if (!_portUtil.Operate)
{ {
// 无人操作鼠标键盘 // 无人操作鼠标键盘
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog) if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > setting.Value.autoOutLog)
{ {
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}"); logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{globalStateService.Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds},autoOutLog:{setting.Value.autoOutLog}");
globalStateService.Operator.NickName = string.Empty;
globalStateService.Operator = null; globalStateService.Operator = null;
if (globalStateService.Reviewer != null)
{
globalStateService.Reviewer.NickName = string.Empty;
globalStateService.Reviewer = null; globalStateService.Reviewer = null;
}
await InvokeAsync(StateHasChanged);
stop(); stop();
} }
else else
{ {
logger.Info($"{setting.Value.autoOutLog}未自动退出{(DateTime.Now - _portUtil.dateTime).TotalSeconds}-{CheckComputerFreeState.GetLastInputTime()}"); logger.Info($"{setting.Value.autoOutLog}未自动退出{(DateTime.Now - _portUtil.dateTime).TotalSeconds}-{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds}");
next(); next();
} }
} }

View File

@ -109,6 +109,7 @@
FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx; FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
globalStateService.Reviewer = user; globalStateService.Reviewer = user;
logger.Info($"双人登录模式:操作人【{globalStateService.Operator.NickName}】复核人【{user.NickName}】登录"); logger.Info($"双人登录模式:操作人【{globalStateService.Operator.NickName}】复核人【{user.NickName}】登录");
PortUtil.mouseClickTime = DateTime.Now;
dialogService.Close(true); dialogService.Close(true);
} }
else else
@ -137,6 +138,7 @@
FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx; FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
globalStateService.Operator = user; globalStateService.Operator = user;
logger.Info($"双人登录模式:操作人【{user.NickName}】复核人【{globalStateService.Reviewer.NickName}】登录"); logger.Info($"双人登录模式:操作人【{user.NickName}】复核人【{globalStateService.Reviewer.NickName}】登录");
PortUtil.mouseClickTime = DateTime.Now;
dialogService.Close(true); dialogService.Close(true);
} }
else else
@ -161,6 +163,7 @@
FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx; FingerprintUtil.axCZKEM1.OnAttTransactionEx -= axCZKEM1_OnAttTransactionEx;
globalStateService.Operator = user; globalStateService.Operator = user;
logger.Info($"单人登录模式:用户【{user.NickName}】登录"); logger.Info($"单人登录模式:用户【{user.NickName}】登录");
PortUtil.mouseClickTime = DateTime.Now;
dialogService.Close(true); dialogService.Close(true);
} }
} }

View File

@ -296,7 +296,18 @@
async Task EditRow(PlanDetails planDetail) async Task EditRow(PlanDetails planDetail)
{ {
// planDetail.DrugId = null; // planDetail.DrugId = null;
//查询要删除的药品是否有绑定且库存大于0
if (!(await planDao.CheckPlanDetailBind(planDetail)))
{
_message.Notify(new NotificationMessage
{
Severity = NotificationSeverity.Error,
Summary = "提示",
Detail = "该药品有绑定且库存不为0请先清库存",
Duration = 4000
});
return;
}
await PlanDetailsGrid.EditRow(planDetail); await PlanDetailsGrid.EditRow(planDetail);
} }
//保存修改药品 //保存修改药品

View File

@ -42,6 +42,8 @@ namespace MasaBlazorApp3.Port
public bool Operate { get; set; } public bool Operate { get; set; }
public DateTime dateTime { get; set; } = DateTime.Now; public DateTime dateTime { get; set; } = DateTime.Now;
// //鼠标点击时间
public DateTime mouseClickTime { get; set; }
// 当前操作的抽屉号 // 当前操作的抽屉号
public int DrawerNo { get; set; } public int DrawerNo { get; set; }

View File

@ -131,9 +131,9 @@
if (!_portUtil.Operate) if (!_portUtil.Operate)
{ {
// 无人操作鼠标键盘 // 无人操作鼠标键盘
if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && CheckComputerFreeState.GetLastInputTime() > setting.Value.autoOutLog) if ((DateTime.Now - _portUtil.dateTime).TotalSeconds > setting.Value.autoOutLog && (DateTime.Now - _portUtil.mouseClickTime).TotalSeconds > setting.Value.autoOutLog)
{ {
logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{CheckComputerFreeState.GetLastInputTime()},autoOutLog:{setting.Value.autoOutLog}"); logger.Info($"设备{setting.Value.autoOutLog}内无人操作,用户【{Operator?.NickName}】自动退出登录,_portUtil.Operate:{_portUtil.Operate},totalSecond:{(DateTime.Now - _portUtil.dateTime).TotalSeconds},lastInputTime:{(DateTime.Now - _portUtil.mouseClickTime).TotalSeconds},autoOutLog:{setting.Value.autoOutLog}");
globalStateService.Operator = null; globalStateService.Operator = null;
globalStateService.Reviewer = null; globalStateService.Reviewer = null;
na.NavigateTo(""); na.NavigateTo("");