Commit 22114acb by lcx

刷新报表

parent 3bacd8be
......@@ -297,7 +297,15 @@ public ApiResponse GenerateReport([CustomizeValidator(RuleSet = "Delete"), FromB
if (null == allot || !states.Contains(allot.States))
throw new PerformanceException("当前绩效暂未生成,无法统计报表数据。");
//_publishEndpoint.Publish(allot).Wait();
_backgroundTaskQueue.QueueBackgroundWorkItem(async token =>
{
using (var scope = _serviceScopeFactory.CreateScope())
{
var scopedServices = scope.ServiceProvider.GetRequiredService<AllotService>();
scopedServices.GenerateReport(allot);
await Task.Delay(TimeSpan.FromSeconds(5), token);
}
});
return new ApiResponse(ResponseType.OK, "统计报表数据任务开始");
}
......
......@@ -487,8 +487,15 @@ public void Generate(per_allot allot)
/// <param name="allot"></param>
public void GenerateReport(per_allot allot)
{
try
{
reportService.ExecProc("call proc_report_performance(@hospitalid, @year, @month);", new { allot.HospitalId, allot.Year, allot.Month });
}
catch (Exception ex)
{
_logger.LogError($"{allot.Year}{allot.Month}月绩效报表生成失败。 allotid: {allot.ID}。" + ex.Message);
}
}
/// <summary>
/// 验证科室核算单元、工号
......
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