提取添加日志

parent 9169e6e3
...@@ -233,8 +233,8 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest ...@@ -233,8 +233,8 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
// string email = claim.GetUserClaim(JwtClaimTypes.Mail); // string email = claim.GetUserClaim(JwtClaimTypes.Mail);
string email = ""; string email = "";
if (isSingle) //if (isSingle)
{ //{
logger.LogInformation("同一项目中进行提取"); logger.LogInformation("同一项目中进行提取");
Task.Run(() => Task.Run(() =>
...@@ -247,25 +247,26 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest ...@@ -247,25 +247,26 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
string extractFilePath = scopedServices.Main(allot.ID, allot.HospitalId, email, allot.ID.ToString(), filePath, isSingle); string extractFilePath = scopedServices.Main(allot.ID, allot.HospitalId, email, allot.ID.ToString(), filePath, isSingle);
} }
}); });
} //}
else //else
{ //{
var http = new RestSharpHelper(); // logger.LogInformation("多项目进行提取");
var extractUrl = http.SetUrl(url.HttpPost, "extract/extract"); // var http = new RestSharpHelper();
// var extractUrl = http.SetUrl(url.HttpPost, "extract/extract");
var obj = new ExtractRequest
{ // var obj = new ExtractRequest
AllotId = request.AllotId, // {
HospitalId = request.HospitalId, // AllotId = request.AllotId,
Email = email // HospitalId = request.HospitalId,
}; // Email = email
// };
string json = JsonHelper.Serialize(obj);
logger.LogInformation("提取绩效数据参数:" + json); // string json = JsonHelper.Serialize(obj);
var parameter = JsonHelper.Deserialize<Dictionary<string, object>>(json); // logger.LogInformation("提取绩效数据参数:" + json);
var restRequest = string.IsNullOrEmpty(filePath) ? http.CreatePostRequest(json) : http.CreateFileRequest(new string[] { filePath }, parameter); // var parameter = JsonHelper.Deserialize<Dictionary<string, object>>(json);
Task.Run(() => http.GetResponse(extractUrl, restRequest)); // var restRequest = string.IsNullOrEmpty(filePath) ? http.CreatePostRequest(json) : http.CreateFileRequest(new string[] { filePath }, parameter);
} // Task.Run(() => http.GetResponse(extractUrl, restRequest));
//}
return new ApiResponse(ResponseType.OK, "HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!", new { IsExtracting = false }); return new ApiResponse(ResponseType.OK, "HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!", new { IsExtracting = false });
} }
...@@ -441,7 +442,11 @@ public ApiResponse Schedule([FromBody] log_dbug request) ...@@ -441,7 +442,11 @@ public ApiResponse Schedule([FromBody] log_dbug request)
var allot = allotService.GetAllot(request.AllotID.Value); var allot = allotService.GetAllot(request.AllotID.Value);
if (null == allot) if (null == allot)
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
var ratio = allotService.AllotLog(allot, 3)?.Max(t => ConvertHelper.TryDecimal(t.Message)) ?? 0; var logs = allotService.AllotLog(allot, 3);
var ratio = 0m;
if (logs != null && logs.Any())
ratio = logs.Max(t => ConvertHelper.TryDecimal(t.Message));
return new ApiResponse(ResponseType.OK, new { ratio }); return new ApiResponse(ResponseType.OK, new { ratio });
} }
......
...@@ -57,7 +57,11 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi ...@@ -57,7 +57,11 @@ public void Handler(int hospitalId, per_allot allot, string groupName, bool isSi
try try
{ {
var configs = hospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId); var configs = hospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId);
if (configs == null || !configs.Any()) throw new Exception("医院未配置绩效抽取信息"); if (configs == null || !configs.Any())
{
logService.ReturnTheLog(allot.ID, groupName, 2, "提取数据", "医院未配置绩效抽取信息", isSingle: isSingle);
throw new Exception("医院未配置绩效抽取信息");
}
var types = extypeRepository.GetEntities(t => t.HospitalId == hospitalId && new int[] { (int)SheetType.Employee, (int)SheetType.OnlyExtract }.Contains(t.Source)); var types = extypeRepository.GetEntities(t => t.HospitalId == hospitalId && new int[] { (int)SheetType.Employee, (int)SheetType.OnlyExtract }.Contains(t.Source));
if (types != null && types.Any()) if (types != null && types.Any())
......
...@@ -72,7 +72,10 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName ...@@ -72,7 +72,10 @@ public List<ex_result> Handler(int hospitalId, per_allot allot, string groupName
try try
{ {
var configs = hosconfigRepository.GetEntities(t => t.HospitalId == hospitalId); var configs = hosconfigRepository.GetEntities(t => t.HospitalId == hospitalId);
if (configs == null || !configs.Any()) throw new Exception("医院未配置绩效抽取信息"); if (configs == null || !configs.Any())
{
throw new Exception("医院未配置绩效抽取信息");
}
dict = new Dictionary<ExDataDict, object> dict = new Dictionary<ExDataDict, object>
{ {
......
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