强退异常处理

main
yinq 3 days ago
parent 481d9a4229
commit 48b20ad274

@ -91,7 +91,7 @@ namespace SlnMesnac.Business.business
/// </summary>
public void HandleStaffCommute(BaseStaffInfo staff, int isCheckOn)
{
if(isCheckOn == 0)
/* if(isCheckOn == 0)
{
RecordStaffCommute recordStaffCommute = new RecordStaffCommute
{
@ -115,7 +115,7 @@ namespace SlnMesnac.Business.business
recordStaffCommute.EndWorkTime = currentTime;
recordStaffCommute.ClockingRatio = Convert.ToDecimal((DateTime.Parse(recordStaffCommute.EndWorkTime) - DateTime.Parse(recordStaffCommute.StartWorkTime)).TotalHours);
_recordStaffCommuteService.Update(recordStaffCommute);
}
}*/
}
/// <summary>

@ -316,39 +316,46 @@ namespace SlnMesnac.WPF.ViewModel
/// </summary>
private void Remove(string staffId)
{
MainWindowViewModel.wins = 2;
if (isUse == false)
{
var removeConfirmWin = new RemoveConfirmWin();
removeConfirmWin.Owner = Application.Current.MainWindow;
removeConfirmWin.WindowStartupLocation = WindowStartupLocation.CenterOwner;
removeConfirmWin.ShowDialog();
if (RemoveConfirmViewModel.times == 1)
{
var theUser = baseStaffService.GetStaffInfoByStaffId(staffId);
_rfidHandleBusniess.HandleAndInsertRemove(theUser, 2);//在打卡记录表里记录强退
var list = _rfidHandleBusniess.HandleAndInsertStaffRealTime(theUser, 2);
if (list.Count>=0)
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
RecordStaffRealTimeDataGrid.Clear();
list.ForEach(item => { RecordStaffRealTimeDataGrid.Add(item); });
}));
_rfidHandleBusniess.HandleStaffCommute(user, 1);
}
if(list.Count == 0)
{
isOnDuty = false;
isSelectedStationCode = false;
}
}
TransmitUserDelegateEvent?.Invoke();
EmployeeLoginViewModel._transmitToRemoveConfigAction -= _transmitToRemoveConfigAction;
}
else
try
{
MessageBox.Show("正在打卡不能强退!");
MainWindowViewModel.wins = 2;
if (isUse == false)
{
var removeConfirmWin = new RemoveConfirmWin();
removeConfirmWin.Owner = Application.Current.MainWindow;
removeConfirmWin.WindowStartupLocation = WindowStartupLocation.CenterOwner;
removeConfirmWin.ShowDialog();
if (RemoveConfirmViewModel.times == 1)
{
var theUser = baseStaffService.GetStaffInfoByStaffId(staffId);
_rfidHandleBusniess.HandleAndInsertRemove(theUser, 2);//在打卡记录表里记录强退
var list = _rfidHandleBusniess.HandleAndInsertStaffRealTime(theUser, 2);
if (list.Count >= 0)
{
System.Windows.Application.Current.Dispatcher.Invoke((Action)(async () =>
{
RecordStaffRealTimeDataGrid.Clear();
list.ForEach(item => { RecordStaffRealTimeDataGrid.Add(item); });
}));
_rfidHandleBusniess.HandleStaffCommute(user, 1);
}
if (list.Count == 0)
{
isOnDuty = false;
isSelectedStationCode = false;
}
}
TransmitUserDelegateEvent?.Invoke();
EmployeeLoginViewModel._transmitToRemoveConfigAction -= _transmitToRemoveConfigAction;
}
else
{
MessageBox.Show("正在打卡不能强退!");
}
}
catch (Exception ex)
{
_logger.LogError($"强退异常:{ex.Message}");
}
}

@ -66,9 +66,13 @@
// "DeviceCode": "XMGR0004",
// "ProcessCode": "1002",
// "ProductLineName": "压延一工位"
"StationCode": "1023-硫化十一工位",
//"StationCode": "1023-硫化十一工位",
//"DeviceCode": "XMGR0030",
//"ProcessCode": "1020",
//"ProductLineName": "硫化十一工位"
"StationCode": "1022-硫化三工位",
"DeviceCode": "XMGR0030",
"ProcessCode": "1023",
"ProductLineName": "硫化十一工位"
"ProcessCode": "1020",
"ProductLineName": "硫化工位"
}
}

Loading…
Cancel
Save