弃用开关IsSingleProject;抽取前清空数据库连接缓存

parent c48b87fb
......@@ -266,31 +266,31 @@ private void Execute_Allot_ExtractData(TaskService service, bg_task task)
allot.ExtractTime = DateTime.Now;
allotService.Update(allot);
if (isSingle)
{
//if (isSingle)
//{
_logger.LogInformation("同一项目中进行提取");
_logger.LogInformation("提取绩效数据参数:" + JsonHelper.Serialize(new { allotId = allot.ID, hospitalId = allot.HospitalId }));
scopedServices.Main(allot.ID, allot.HospitalId, "", allot.ID.ToString(), filePath, isSingle);
}
else
{
var http = new RestSharpHelper();
var extractUrl = http.SetUrl(url.Value.HttpPost, "extract/extract");
var obj = new ExtractRequest
{
AllotId = allotId,
HospitalId = hospitalId,
Email = ""
};
string json = JsonHelper.Serialize(obj);
_logger.LogInformation("提取绩效数据参数:" + json);
var parameter = JsonHelper.Deserialize<Dictionary<string, object>>(json);
var restRequest = string.IsNullOrEmpty(filePath) ? http.CreatePostRequest(json) : http.CreateFileRequest(new string[] { filePath }, parameter);
http.GetResponse(extractUrl, restRequest);
}
//}
//else
//{
// var http = new RestSharpHelper();
// var extractUrl = http.SetUrl(url.Value.HttpPost, "extract/extract");
// var obj = new ExtractRequest
// {
// AllotId = allotId,
// HospitalId = hospitalId,
// Email = ""
// };
// string json = JsonHelper.Serialize(obj);
// _logger.LogInformation("提取绩效数据参数:" + json);
// var parameter = JsonHelper.Deserialize<Dictionary<string, object>>(json);
// var restRequest = string.IsNullOrEmpty(filePath) ? http.CreatePostRequest(json) : http.CreateFileRequest(new string[] { filePath }, parameter);
// http.GetResponse(extractUrl, restRequest);
//}
}
catch (Exception ex)
{
......
......@@ -100,6 +100,7 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
logService.ReturnTheLog(allotId, groupName, 3, "", 5, 1, isSingle);
queryService.ClearConnectionPools();
queryService.ClearHistoryData(allot.ID, groupName, isSingle);
employeeService.SyncDataToResult(allotId);
......
......@@ -62,6 +62,14 @@ PerforPerallotRepository perallotRepository
private static Dictionary<int, IDbConnection> pools = new Dictionary<int, IDbConnection>();
/// <summary>
/// 清理数据库连接池
/// </summary>
public void ClearConnectionPools()
{
pools.Clear();
}
/// <summary>
/// 获取抽取数据
/// </summary>
/// <param name="hospitalId"></param>
......
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