Commit f69cbd46 by 纪旭 韦

提取绩效不能访问已释放bug

parent eb138383
......@@ -102,5 +102,22 @@ public void ClearAllotSync()
});
}
#endregion
public void SyncDataToResult(int allotId)
{
using (var connection = new MySqlConnection(_options.Value.PerformanceConnectionString))
{
if (connection.State != ConnectionState.Open) connection.Open();
try
{
string sql = $@"call proc_sync_datatoresult({allotId})";
connection.Execute(sql, commandTimeout: 60 * 60);
}
catch (Exception)
{
throw;
}
}
}
}
}
......@@ -1791,11 +1791,6 @@ public void AddCategoryToConfig(int allotId)
}
}
public void SyncDataToResult(int allotId)
{
perforPerallotRepository.Execute($"call proc_sync_datatoresult({allotId})", new { }, 60 * 60 * 5);
}
public void AuditGather(List<Gather> gather)
{
List<ex_result_gather> ex_Result_Gathers = new List<ex_result_gather>();
......@@ -1845,7 +1840,7 @@ public void AuditGather(List<Gather> gather)
if (gatherFirst.Status == "通过")
{
SyncDataToResult(gatherFirst.AllotId);
_service.SyncDataToResult(gatherFirst.AllotId);
}
}
}
......
......@@ -17,6 +17,7 @@ namespace Performance.Services.ExtractExcelService
public class ExtractService : IAutoInjection
{
private readonly ILogger logger;
private readonly DapperService service;
private readonly LogManageService logService;
private readonly QueryService queryService;
private readonly PersonService personService;
......@@ -35,6 +36,7 @@ public class ExtractService : IAutoInjection
public ExtractService(
ILogger<ExtractService> logger,
DapperService service,
LogManageService logService,
QueryService queryService,
PersonService personService,
......@@ -53,6 +55,7 @@ PerforExresultRepository exresultRepository
)
{
this.logger = logger;
this.service = service;
this.logService = logService;
this.queryService = queryService;
this.personService = personService;
......@@ -104,7 +107,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
queryService.ClearConnectionPools();
queryService.ClearHistoryData(allot.ID, groupName, isSingle);
employeeService.SyncDataToResult(allotId);
service.SyncDataToResult(allotId);
var data = exresultRepository.GetEntities(t => t.AllotId == allotId);
......
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