Commit f64ab5bd by ryun

下发归档状态维护

parent 33f085c7
......@@ -36,6 +36,7 @@ public class AllotController : Controller
private IWebHostEnvironment _evn;
private ILogger<AllotController> _logger;
private ClaimService _claim;
private readonly DapperService _service;
private LogManageService _logManageService;
private readonly TaskService _taskService;
private readonly CostTransferService costTransferService;
......@@ -44,7 +45,8 @@ public class AllotController : Controller
//private IBackgroundTaskQueue _backgroundTaskQueue;
private IServiceScopeFactory _serviceScopeFactory;
public AllotController(AllotService allotService,
public AllotController(
AllotService allotService,
ResultComputeService resultComputeService,
ConfigService configService,
ILogger<AllotController> logger,
......@@ -52,6 +54,7 @@ public class AllotController : Controller
//IBackgroundTaskQueue backgroundTaskQueue,
IServiceScopeFactory serviceScopeFactory,
ClaimService claim,
DapperService service,
LogManageService logManageService,
TaskService taskService,
CostTransferService costTransferService,
......@@ -62,6 +65,7 @@ public class AllotController : Controller
_logger = logger;
_evn = evn;
_claim = claim;
_service = service;
_logManageService = logManageService;
_taskService = taskService;
this.costTransferService = costTransferService;
......@@ -396,7 +400,8 @@ public ApiResponse Pigeonhole([CustomizeValidator(RuleSet = "Delete"), FromBody]
var allot = _allotService.GetAllot(request.ID);
if (null == allot)
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
_allotService.Pigeonhole(allot);
_service.Pigeonhole(allot.ID);
_taskService.Add(Background.JobType.每日汇报表汇总, allot.ID.ToString());
LogAllotAction(allot.ID, allot.Path, "归档");
......
......@@ -627,18 +627,6 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time)
}
/// <summary>
/// 归档绩效记录
/// </summary>
/// <param name="allot"></param>
public void Pigeonhole(per_allot allot)
{
allot.States = 8;
allot.PigeonholeDate = DateTime.Now;
allot.Remark = "归档";
_allotRepository.Update(allot);
}
/// <summary>
/// 检索数据是否合格
/// </summary>
/// <param name="allot"></param>
......
......@@ -88,6 +88,32 @@ decimal QueryDiff(int allotId)
}
#endregion
#region 归档绩效记录
/// <summary>
/// 归档绩效记录
/// </summary>
/// <param name="allot"></param>
public void Pigeonhole(int allotId)
{
try
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
string sql = $@"call proc_allot_pigeonhole({allotId})";
connection.Execute(sql, commandTimeout: 60 * 60);
}
}
catch (Exception ex)
{
_logger.LogError($"SQL执行异常:{ex}");
throw;
}
}
#endregion
#region 二次分配模板修复
/// <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