绩效生成状态修改

parent 457718cc
...@@ -150,8 +150,8 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al ...@@ -150,8 +150,8 @@ public ApiResponse Generate([CustomizeValidator(RuleSet = "Delete"), FromBody]Al
var allot = _allotService.GetAllot(request.ID); var allot = _allotService.GetAllot(request.ID);
if (null == allot || string.IsNullOrEmpty(allot.Path)) if (null == allot || string.IsNullOrEmpty(allot.Path))
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件"); throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
_perExcelService.Execute(allot); //_perExcelService.Execute(allot);
//BackgroundJob.Enqueue(() => _perExcelService.Execute(allot)); BackgroundJob.Enqueue(() => _perExcelService.Execute(allot));
return new ApiResponse(ResponseType.OK); return new ApiResponse(ResponseType.OK);
} }
} }
......
...@@ -78,6 +78,11 @@ public class PerExcelService : IAutoInjection ...@@ -78,6 +78,11 @@ public class PerExcelService : IAutoInjection
public void Execute(per_allot allot) public void Execute(per_allot allot)
{ {
allot.States = 2;
_perforPerAllotRepository.Update(allot);
Clear(allot.ID);
// 导出数据 // 导出数据
var excel = Import(allot.Path); var excel = Import(allot.Path);
...@@ -98,6 +103,9 @@ public void Execute(per_allot allot) ...@@ -98,6 +103,9 @@ public void Execute(per_allot allot)
//发送邮件 //发送邮件
SendEmail(allot); SendEmail(allot);
allot.States = 5;
_perforPerAllotRepository.Update(allot);
} }
/// <summary> /// <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