|
|
@ -174,6 +174,11 @@ namespace UniApiWpf |
|
|
|
|
|
|
|
private void BgwPutDoWork(object sender, DoWorkEventArgs e) |
|
|
|
{ |
|
|
|
TimeSpan nowDt = DateTime.Now.TimeOfDay; |
|
|
|
TimeSpan workstartDT = DateTime.Parse("1:00").TimeOfDay; |
|
|
|
TimeSpan workendDT = DateTime.Parse("2:00").TimeOfDay; |
|
|
|
if (nowDt < workstartDT || nowDt > workendDT) |
|
|
|
{ |
|
|
|
SCP_DC_UNI_CONTROLLER.WriteService((rs) => |
|
|
|
{ |
|
|
|
if (rs.State == ReturnStatus.Succeed) |
|
|
@ -185,6 +190,7 @@ namespace UniApiWpf |
|
|
|
CreateLogDataList(rs.Result, WriteLogEnum.Put); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -197,24 +203,33 @@ namespace UniApiWpf |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
SCP_DC_UNI_CONTROLLER.ReadService((rs) => |
|
|
|
TimeSpan nowDt = DateTime.Now.TimeOfDay; |
|
|
|
TimeSpan workstartDT = DateTime.Parse("1:00").TimeOfDay; |
|
|
|
TimeSpan workendDT = DateTime.Parse("2:00").TimeOfDay; |
|
|
|
if (nowDt < workstartDT || nowDt > workendDT) |
|
|
|
{ |
|
|
|
List<LogModel> _list = new List<LogModel>(); |
|
|
|
if (rs.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
rs.MessageList.ForEach(p => { |
|
|
|
_list.Add(new LogModel() { LogMessage = string.Format("{0}任务:{1}", p,rs.Message.ToString()), LogTime = DateTime.Now.ToShortDateString(), TableName = "", TaskId=rs.Message.ToString(), }); |
|
|
|
}); |
|
|
|
CreateLogDataList(_list, WriteLogEnum.Get); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
rs.ErrorList.ForEach(p => { |
|
|
|
_list.Add(new LogModel() { LogMessage = string.Format("{0}任务:{1}", p.Message, rs.Message.ToString()), LogTime = DateTime.Now.ToShortDateString(), TableName = "", TaskId = rs.Message.ToString(), }); |
|
|
|
}); |
|
|
|
CreateLogDataList(_list, WriteLogEnum.Get); |
|
|
|
} |
|
|
|
}); |
|
|
|
#region
|
|
|
|
SCP_DC_UNI_CONTROLLER.ReadService((rs) => |
|
|
|
{ |
|
|
|
List<LogModel> _list = new List<LogModel>(); |
|
|
|
if (rs.State == ReturnStatus.Succeed) |
|
|
|
{ |
|
|
|
rs.MessageList.ForEach(p => { |
|
|
|
_list.Add(new LogModel() { LogMessage = string.Format("{0}任务:{1}", p, rs.Message.ToString()), LogTime = DateTime.Now.ToShortDateString(), TableName = "", TaskId = rs.Message.ToString(), }); |
|
|
|
}); |
|
|
|
CreateLogDataList(_list, WriteLogEnum.Get); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
rs.ErrorList.ForEach(p => { |
|
|
|
_list.Add(new LogModel() { LogMessage = string.Format("{0}任务:{1}", p.Message, rs.Message.ToString()), LogTime = DateTime.Now.ToShortDateString(), TableName = "", TaskId = rs.Message.ToString(), }); |
|
|
|
}); |
|
|
|
CreateLogDataList(_list, WriteLogEnum.Get); |
|
|
|
} |
|
|
|
}); |
|
|
|
#endregion
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|