Commit f64ab5bd by ryun

下发归档状态维护

parent 33f085c7
...@@ -36,6 +36,7 @@ public class AllotController : Controller ...@@ -36,6 +36,7 @@ public class AllotController : Controller
private IWebHostEnvironment _evn; private IWebHostEnvironment _evn;
private ILogger<AllotController> _logger; private ILogger<AllotController> _logger;
private ClaimService _claim; private ClaimService _claim;
private readonly DapperService _service;
private LogManageService _logManageService; private LogManageService _logManageService;
private readonly TaskService _taskService; private readonly TaskService _taskService;
private readonly CostTransferService costTransferService; private readonly CostTransferService costTransferService;
...@@ -44,7 +45,8 @@ public class AllotController : Controller ...@@ -44,7 +45,8 @@ public class AllotController : Controller
//private IBackgroundTaskQueue _backgroundTaskQueue; //private IBackgroundTaskQueue _backgroundTaskQueue;
private IServiceScopeFactory _serviceScopeFactory; private IServiceScopeFactory _serviceScopeFactory;
public AllotController(AllotService allotService, public AllotController(
AllotService allotService,
ResultComputeService resultComputeService, ResultComputeService resultComputeService,
ConfigService configService, ConfigService configService,
ILogger<AllotController> logger, ILogger<AllotController> logger,
...@@ -52,6 +54,7 @@ public class AllotController : Controller ...@@ -52,6 +54,7 @@ public class AllotController : Controller
//IBackgroundTaskQueue backgroundTaskQueue, //IBackgroundTaskQueue backgroundTaskQueue,
IServiceScopeFactory serviceScopeFactory, IServiceScopeFactory serviceScopeFactory,
ClaimService claim, ClaimService claim,
DapperService service,
LogManageService logManageService, LogManageService logManageService,
TaskService taskService, TaskService taskService,
CostTransferService costTransferService, CostTransferService costTransferService,
...@@ -62,6 +65,7 @@ public class AllotController : Controller ...@@ -62,6 +65,7 @@ public class AllotController : Controller
_logger = logger; _logger = logger;
_evn = evn; _evn = evn;
_claim = claim; _claim = claim;
_service = service;
_logManageService = logManageService; _logManageService = logManageService;
_taskService = taskService; _taskService = taskService;
this.costTransferService = costTransferService; this.costTransferService = costTransferService;
...@@ -396,7 +400,8 @@ public ApiResponse Pigeonhole([CustomizeValidator(RuleSet = "Delete"), FromBody] ...@@ -396,7 +400,8 @@ public ApiResponse Pigeonhole([CustomizeValidator(RuleSet = "Delete"), FromBody]
var allot = _allotService.GetAllot(request.ID); var allot = _allotService.GetAllot(request.ID);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在或没有上传数据文件"); throw new PerformanceException("当前绩效记录不存在或没有上传数据文件");
_allotService.Pigeonhole(allot); _service.Pigeonhole(allot.ID);
_taskService.Add(Background.JobType.每日汇报表汇总, allot.ID.ToString()); _taskService.Add(Background.JobType.每日汇报表汇总, allot.ID.ToString());
LogAllotAction(allot.ID, allot.Path, "归档"); LogAllotAction(allot.ID, allot.Path, "归档");
......
...@@ -627,18 +627,6 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time) ...@@ -627,18 +627,6 @@ private void SendEmail(per_allot allot, string mail, int type, DateTime time)
} }
/// <summary> /// <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> /// </summary>
/// <param name="allot"></param> /// <param name="allot"></param>
......
...@@ -88,6 +88,32 @@ decimal QueryDiff(int allotId) ...@@ -88,6 +88,32 @@ decimal QueryDiff(int allotId)
} }
#endregion #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 二次分配模板修复 #region 二次分配模板修复
/// <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