Commit c496dfe0 authored by 罗显健's avatar 罗显健

1、修复绩效统计查询结束日期不准的问题

2、批量任务模拟,信息统计差异。
parent bd271843
......@@ -149,10 +149,10 @@ namespace Tools.UI
}
//生成开始、结束日期
string startDate = this.tscbMonth.Text + "-01";
string endDate = Convert.ToDateTime(startDate).AddMonths(1).AddDays(-1).ToString("yyyy-MM-dd"); //开始日期所在月份的最后一天
string endDate = Convert.ToDateTime(startDate).AddMonths(1).ToString("yyyy-MM-dd"); //开始日期所在下个月的第一天
//考勤数据-分组
var dic = new Dictionary<string, List<DataRow>>();
var rows = this._ds.Tables[0].Select($"CreateDate >= '{startDate}' AND CreateDate <= '{endDate}'");
var rows = this._ds.Tables[0].Select($"CreateDate >= '{startDate}' AND CreateDate < '{endDate}'"); // 注意结束日期是下月第一天,不能包含在内。
var unionRows = this.UnionTaskDelayRows(rows, startDate, endDate);
foreach (DataRow r in unionRows)
{
......
......@@ -117,19 +117,37 @@ namespace Tools.UI
var method = type.GetMethod(methodName);
if (method == null) throw new Exception($"程序集[{dllName}]-[{className}]类中不存在[{methodName}]方法或重载");
Utils.AsyncUI(wInstance, () => ShowMsg($"任务构建完成,准备执行。当前线程:{Thread.CurrentThread.ManagedThreadId},任务编号:{taskNo}"));
var objInstance = Activator.CreateInstance(type);
Utils.DoMainAsync(wInstance, ShowMsg, $"任务构建完成,准备执行。当前线程:{Thread.CurrentThread.ManagedThreadId},任务编号:{taskNo}");
var msg = $"任务构建完成,准备执行。当前线程:{Thread.CurrentThread.ManagedThreadId},任务编号:{taskNo}";
// Utils.AsyncUI(wInstance, () => ShowMsg(msg));
TimeWatch timeWatch = TimeWatch.Start();
try
{
method.Invoke(objInstance, null);
msg = $"任务执行完成、耗时:{timeWatch.TimeSpan.TotalMilliseconds} (毫秒),任务编号:{taskNo}";
Utils.DoMainAsync(wInstance, ShowMsg, $"任务执行完成、耗时:{timeWatch.TimeSpan.TotalMilliseconds} (毫秒),任务编号:{taskNo}");
Utils.AsyncUI(wInstance, () => ShowMsg(msg));
}
catch (Exception ex)
{
Utils.DoMainAsync(wInstance, ShowMsg, $"任务:{taskNo}执行失败、耗时:{timeWatch.TimeSpan.TotalMilliseconds} (毫秒),原因:{GetAllMessage(ex)}");
msg = $"任务:{taskNo}执行失败、耗时:{timeWatch.TimeSpan.TotalMilliseconds} (毫秒),原因:{GetAllMessage(ex)}";
// Utils.DoMainAsync(wInstance, ShowMsg, $"任务:{taskNo}执行失败、耗时:{timeWatch.TimeSpan.TotalMilliseconds} (毫秒),原因:{GetAllMessage(ex)}");
Utils.AsyncUI(wInstance, () => ShowMsg(msg));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment