Commit f5b6c8d5 by 李承祥

方案抽取

parent 3a8ab121
...@@ -25,6 +25,7 @@ public class TemplateController : Controller ...@@ -25,6 +25,7 @@ public class TemplateController : Controller
{ {
private readonly TemplateService templateService; private readonly TemplateService templateService;
private readonly ExtractService extractService; private readonly ExtractService extractService;
private readonly NewExtractService newExtractService;
private HospitalService hospitalService; private HospitalService hospitalService;
private IHostingEnvironment env; private IHostingEnvironment env;
private ClaimService claim; private ClaimService claim;
...@@ -36,6 +37,7 @@ public class TemplateController : Controller ...@@ -36,6 +37,7 @@ public class TemplateController : Controller
public TemplateController(TemplateService templateService, public TemplateController(TemplateService templateService,
HospitalService hospitalService, HospitalService hospitalService,
ExtractService extractService, ExtractService extractService,
NewExtractService newExtractService,
IHostingEnvironment env, IHostingEnvironment env,
ClaimService claim, ClaimService claim,
IOptions<Application> options, IOptions<Application> options,
...@@ -45,6 +47,7 @@ public class TemplateController : Controller ...@@ -45,6 +47,7 @@ public class TemplateController : Controller
{ {
this.templateService = templateService; this.templateService = templateService;
this.extractService = extractService; this.extractService = extractService;
this.newExtractService = newExtractService;
this.hospitalService = hospitalService; this.hospitalService = hospitalService;
this.env = env; this.env = env;
this.claim = claim; this.claim = claim;
...@@ -194,7 +197,7 @@ public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBo ...@@ -194,7 +197,7 @@ public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBo
} }
#endregion #endregion
#region 版提取 #region 版提取
/// <summary> /// <summary>
/// 提取绩效数据 /// 提取绩效数据
/// </summary> /// </summary>
...@@ -202,13 +205,48 @@ public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBo ...@@ -202,13 +205,48 @@ public ApiResponse ExtractData([CustomizeValidator(RuleSet = "Template"), FromBo
/// <returns></returns> /// <returns></returns>
[Route("NewExtractData")] [Route("NewExtractData")]
[HttpPost] [HttpPost]
public void NewExtractData([CustomizeValidator, FromBody]ExtractRequest request) public ApiResponse NewExtractData([CustomizeValidator, FromBody]ExtractRequest request)
{ {
var allot = allotService.GetAllot(request.AllotId);
if (allot == null)
return new ApiResponse(ResponseType.ParameterError, "AllotID错误");
// 判断是那种抽取 // 判断是那种抽取
try
{
string message = newExtractService.Judge(request.AllotId, request.HospitalId, request.UseScheme);
if (!string.IsNullOrEmpty(message))
return new ApiResponse(ResponseType.Fail, message);
allot.IsExtracting = allot.IsExtracting ?? 0;
if (allot.IsExtracting == 1)
throw new PerformanceException("正在提取数据,请稍等!");
allot.IsExtracting = 1;
allotService.Update(allot);
var email = claim.GetUserClaim(JwtClaimTypes.Mail);
request.Email = email;
if (request.UseScheme == (int)UseTemplate.Config)
{
LogHelper.Information("请求路径:" + url.HttpPost + "/extract/extract", "提取绩效数据");
HttpHelper.HttpPostNoRequest(url.HttpPost + "/extract/extract", JsonHelper.Serialize(request), true);
}
else
{
}
return new ApiResponse(ResponseType.Error, "HIS绩效数据提取任务正在执行,稍后我们将以邮件的通知您!");
}
catch (Exception ex)
{
if (allot != null)
{
allot.IsExtracting = 3;
allotService.Update(allot);
}
logger.LogError("提取绩效数据:" + ex.ToString());
throw new Exception(ex.Message);
}
// A 使用上传绩效作为模板 // A 使用上传绩效作为模板
// A-1 判断上传绩效是否存在,并执行成功 // A-1 判断上传绩效是否存在,并执行成功
// A-2 医院人员名单、1.0.1 额外收入(写出列头)、2.1 成本支出统计表(写出列头)、4.1 临床科室医护绩效测算表、4.2 特殊核算单元绩效测算表(数量、考核得分率、奖罚、其他) // A-2 医院人员名单、1.0.1 额外收入(写出列头)、2.1 成本支出统计表(写出列头)、4.1 临床科室医护绩效测算表、4.2 特殊核算单元绩效测算表(数量、考核得分率、奖罚、其他)
...@@ -259,17 +297,22 @@ public IActionResult DownFile([FromQuery]AllotRequest request) ...@@ -259,17 +297,22 @@ public IActionResult DownFile([FromQuery]AllotRequest request)
[AllowAnonymous] [AllowAnonymous]
public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int hospitalId) public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int hospitalId)
{ {
LogHelper.Information($"请求参数:allotId:{allotId} hospitalId:{hospitalId}", "保存提取文件");
logger.LogInformation($"保存提取文件 参数:allotId:{allotId} hospitalId:{hospitalId}"); logger.LogInformation($"保存提取文件 参数:allotId:{allotId} hospitalId:{hospitalId}");
try try
{ {
var file = ((FormFileCollection)form.Files).FirstOrDefault(); var file = ((FormFileCollection)form.Files).FirstOrDefault();
if (file == null) if (file == null)
{
LogHelper.Error($"返回文件为空!", "保存提取文件");
return new ApiResponse(ResponseType.Error, "上传文件无效"); return new ApiResponse(ResponseType.Error, "上传文件无效");
}
var dpath = Path.Combine(env.ContentRootPath, "Files", $"{hospitalId}", "autoextract"); var dpath = Path.Combine(env.ContentRootPath, "Files", $"{hospitalId}", "autoextract");
FileHelper.CreateDirectory(dpath); FileHelper.CreateDirectory(dpath);
var path = Path.Combine(dpath, FileHelper.GetFileName(file.FileName)); var path = Path.Combine(dpath, FileHelper.GetFileName(file.FileName));
LogHelper.Information($"保存路径:" + path, "保存提取文件");
using (var stream = file.OpenReadStream()) using (var stream = file.OpenReadStream())
{ {
...@@ -287,6 +330,7 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho ...@@ -287,6 +330,7 @@ public ApiResponse SaveFile([FromForm] IFormCollection form, int allotId, int ho
catch (Exception ex) catch (Exception ex)
{ {
logger.LogInformation($"保存提取文件异常{ex.ToString()}"); logger.LogInformation($"保存提取文件异常{ex.ToString()}");
LogHelper.Error($"保存失败:" + ex.ToString(), "保存提取文件");
} }
return new ApiResponse(ResponseType.Error); return new ApiResponse(ResponseType.Error);
} }
......
...@@ -58,9 +58,6 @@ ...@@ -58,9 +58,6 @@
<Content Update="wwwroot\Performance.Api.xml"> <Content Update="wwwroot\Performance.Api.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
<Content Update="wwwroot\Performance.DtoModels.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Update="wwwroot\Performance.EntityModels.xml"> <Content Update="wwwroot\Performance.EntityModels.xml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content> </Content>
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
"WebapiUrl": { "WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import", "ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index", "ExtractData": "http://localhost:50997/api/extract/index",
"ImportFile": "" "ImportFile": "http://localhost:5001/api/template/savefile",
"HttpPost": "http://localhost:50997/api"
} }
} }
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
"WebapiUrl": { "WebapiUrl": {
"ImportFirst": "http://localhost:50997/api/extract/import", "ImportFirst": "http://localhost:50997/api/extract/import",
"ExtractData": "http://localhost:50997/api/extract/index", "ExtractData": "http://localhost:50997/api/extract/index",
"ImportFile": "" "ImportFile": "http://localhost:5001/api/template/savefile",
"HttpPost": "http://localhost:50997/api"
} }
} }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
namespace Performance.DtoModels namespace Performance.DtoModels
{ {
public class ExtractRequest public class ExtractRequest
{ {
...@@ -21,6 +21,11 @@ public class ExtractRequest ...@@ -21,6 +21,11 @@ public class ExtractRequest
/// 使用方案 /// 使用方案
/// </summary> /// </summary>
public int UseScheme { get; set; } public int UseScheme { get; set; }
/// <summary>
/// 邮箱
/// </summary>
public string Email { get; set; }
} }
......
...@@ -117,7 +117,25 @@ public void Index([FromBody]AllotRequest request) ...@@ -117,7 +117,25 @@ public void Index([FromBody]AllotRequest request)
[HttpPost] [HttpPost]
public void ExtractData([CustomizeValidator, FromBody]ExtractRequest request) public void ExtractData([CustomizeValidator, FromBody]ExtractRequest request)
{ {
newExtractService.ExtractData(request.AllotId, "", request.HospitalId); LogHelper.Information("请求参数:" + JsonHelper.Serialize(request), "提取绩效数据");
string filePath = newExtractService.ExtractData(request.AllotId, "", request.HospitalId);
LogHelper.Information("提取文件路径:" + filePath, "提取绩效数据");
if (!string.IsNullOrEmpty(filePath) && FileHelper.IsExistFile(filePath))
{
int i = 1;
while (i <= 5)
{
LogHelper.Information("请求路径:" + url.ImportFile, "保存提取文件");
string retJson = HttpHelper.HttpClient(url.ImportFile + $"?allotId={request.AllotId}&hospitalId={request.HospitalId}", filePath);
LogHelper.Information("返回结果:" + JsonHelper.Serialize(retJson), "保存提取文件");
logger.LogInformation(retJson);
var ret = JsonHelper.Deserialize<ApiResponse>(retJson);
if ((int)ret.State == 1)
break;
i++;
}
}
} }
#endregion #endregion
......
...@@ -85,34 +85,22 @@ public string ExtractData(int allotId, string email, int hospitalId) ...@@ -85,34 +85,22 @@ public string ExtractData(int allotId, string email, int hospitalId)
{ {
// 获取绩效信息 // 获取绩效信息
var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId); var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null)
throw new PerformanceException("AllotID错误");
// 获取医院信息 // 获取医院信息
var hospital = perforHospitalRepository.GetEntity(t => t.ID == hospitalId); var hospital = perforHospitalRepository.GetEntity(t => t.ID == hospitalId);
if (hospital == null)
throw new PerformanceException("医院ID错误");
// 获取医院配置信息 // 获取医院配置信息
var hospitalConfigList = perforHospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId); var hospitalConfigList = perforHospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId);
if (hospitalConfigList == null || hospitalConfigList.Count == 0)
throw new PerformanceException("当前医院暂不支持HIS数据抽取");
// 获取最近一次绩效
var statesArray = new int[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive }; var statesArray = new int[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive };
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && statesArray.Contains(t.States)); var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && statesArray.Contains(t.States));
var allotLast = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).First(); var allotLast = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).First();
// 获取当前医院模版信息 // 获取当前医院模版信息
var modulesList = perforModmoduleRepository.GetEntities(t => t.HospitalId == hospitalId); var modulesList = perforModmoduleRepository.GetEntities(t => t.HospitalId == hospitalId);
if (modulesList == null || modulesList.Count == 0)
throw new PerformanceException("当前医院还未配置模版");
// 获取模板项 // 获取模板项
var moduleIdList = modulesList.Select(t => t.Id).ToList(); var moduleIdList = modulesList.Select(t => t.Id).ToList();
var itemsList = perforModitemRepository.GetEntities(t => t.ModuleId.HasValue && moduleIdList.Contains(t.ModuleId.Value)); var itemsList = perforModitemRepository.GetEntities(t => t.ModuleId.HasValue && moduleIdList.Contains(t.ModuleId.Value));
if (itemsList == null || itemsList.Count == 0)
throw new PerformanceException("当前医院还未配置模版项");
// 获取当前模板所有相关抽取SQL语句
var extractIdList = itemsList.Select(t => t.ExtractId).Union(modulesList.Select(t => t.ExtractId)).Distinct().ToList(); var extractIdList = itemsList.Select(t => t.ExtractId).Union(modulesList.Select(t => t.ExtractId)).Distinct().ToList();
var extractList = perforModextractRepository.GetEntities(t => extractIdList.Contains(t.Id)); var extractList = perforModextractRepository.GetEntities(t => extractIdList.Contains(t.Id));
if (extractList == null || extractList.Count == 0)
throw new PerformanceException("当前医院配置模板无需抽取");
IWorkbook workbook = null; IWorkbook workbook = null;
...@@ -125,6 +113,7 @@ public string ExtractData(int allotId, string email, int hospitalId) ...@@ -125,6 +113,7 @@ public string ExtractData(int allotId, string email, int hospitalId)
#region 单元格样式 #region 单元格样式
style = workbook.CreateCellStyle(); style = workbook.CreateCellStyle();
//字体
IFont titleFont = workbook.CreateFont(); IFont titleFont = workbook.CreateFont();
titleFont.FontHeightInPoints = 12;//设置字体大小 titleFont.FontHeightInPoints = 12;//设置字体大小
titleFont.Color = HSSFColor.Black.Index;//设置字体颜色 titleFont.Color = HSSFColor.Black.Index;//设置字体颜色
...@@ -139,6 +128,10 @@ public string ExtractData(int allotId, string email, int hospitalId) ...@@ -139,6 +128,10 @@ public string ExtractData(int allotId, string email, int hospitalId)
//前景色 //前景色
style.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.SkyBlue.Index; style.FillForegroundColor = NPOI.HSSF.Util.HSSFColor.SkyBlue.Index;
style.FillPattern = FillPattern.SolidForeground; style.FillPattern = FillPattern.SolidForeground;
//居中
style.Alignment = HorizontalAlignment.Center;//水平居中
style.VerticalAlignment = VerticalAlignment.Center;//垂直居中
#endregion #endregion
for (int i = 0; i < workbook.NumberOfSheets; i++) for (int i = 0; i < workbook.NumberOfSheets; i++)
...@@ -187,6 +180,8 @@ public string ExtractData(int allotId, string email, int hospitalId) ...@@ -187,6 +180,8 @@ public string ExtractData(int allotId, string email, int hospitalId)
} }
finally finally
{ {
allot.IsExtracting = 3;
perforPerallotRepository.Update(allot);
workbook.Close(); workbook.Close();
GC.Collect(); GC.Collect();
} }
...@@ -233,7 +228,7 @@ private void WriteOtherIncome(ISheet sheet, IPerSheetDataRead sheetRead) ...@@ -233,7 +228,7 @@ private void WriteOtherIncome(ISheet sheet, IPerSheetDataRead sheetRead)
var technicianFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3); var technicianFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3);
var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 4); var head = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 4);
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 3; int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
//写入列头信息 //写入列头信息
foreach (var item in itemList) foreach (var item in itemList)
{ {
...@@ -315,8 +310,8 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR ...@@ -315,8 +310,8 @@ private void WriteIncome(ISheet sheet, int allotLastId, IPerSheetDataRead sheetR
{ {
var value = allExtract.FirstOrDefault(t => t.Department == department && t.Category == headName)?.Value; var value = allExtract.FirstOrDefault(t => t.Department == department && t.Category == headName)?.Value;
newCell.SetCellValue(value == null || value == 0 ? "" : value.ToString()); newCell.SetCellValue(value == null || value == 0 ? "" : value.ToString());
newCell.CellStyle = style;
} }
newCell.CellStyle = style;
} }
rowIndex++; rowIndex++;
} }
...@@ -328,7 +323,7 @@ private ICell GetOrCreate(IRow row, int index) ...@@ -328,7 +323,7 @@ private ICell GetOrCreate(IRow row, int index)
if (cell == null) if (cell == null)
cell = row.CreateCell(index); cell = row.CreateCell(index);
cell.CellStyle.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.Orange.Index; //cell.CellStyle.FillBackgroundColor = NPOI.HSSF.Util.HSSFColor.Orange.Index;
return cell; return cell;
} }
...@@ -414,8 +409,8 @@ private void WriteWorkload(ISheet sheet, int allotLastId, IPerSheetDataRead shee ...@@ -414,8 +409,8 @@ private void WriteWorkload(ISheet sheet, int allotLastId, IPerSheetDataRead shee
{ {
var value = allExtract.FirstOrDefault(t => t.Department == department && t.Category == headName)?.Value; var value = allExtract.FirstOrDefault(t => t.Department == department && t.Category == headName)?.Value;
newCell.SetCellValue(value == null || value == 0 ? "" : value.ToString()); newCell.SetCellValue(value == null || value == 0 ? "" : value.ToString());
newCell.CellStyle = style;
} }
newCell.CellStyle = style;
} }
} }
} }
...@@ -457,7 +452,7 @@ private void WriteExpend(ISheet sheet, IPerSheetDataRead sheetRead) ...@@ -457,7 +452,7 @@ private void WriteExpend(ISheet sheet, IPerSheetDataRead sheetRead)
var nurseFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 2); var nurseFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 2);
var doctorFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3); var doctorFactor = sheet.GetRow(sheetRead.Point.HeaderFirstRowNum.Value + 3);
int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 3; int cellStartIndex = sheetRead.Point.HeaderFirstCellNum.Value + 4;
//写入列头信息 //写入列头信息
foreach (var item in itemList) foreach (var item in itemList)
{ {
...@@ -574,11 +569,10 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, int allotLastId, IPe ...@@ -574,11 +569,10 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, int allotLastId, IPe
var count = modDataGroup.First(t => t.Department.ToString() == value).Count; var count = modDataGroup.First(t => t.Department.ToString() == value).Count;
mergedEnd = mergedBegin + count - 1; mergedEnd = mergedBegin + count - 1;
} }
sheet.AddMergedRegion(new CellRangeAddress(mergedBegin, mergedEnd, cellIndex, cellIndex)); //合并单元格 CellRangeAddress region = new CellRangeAddress(mergedBegin, mergedEnd, cellIndex, cellIndex);
sheet.AddMergedRegion(region); //合并单元格
var newCell = importRow.CreateCell(cellIndex); var newCell = importRow.CreateCell(cellIndex);
newCell.SetCellValue(Verify(value)); newCell.SetCellValue(Verify(value));
style.Alignment = HorizontalAlignment.Center;//水平居中
style.VerticalAlignment = VerticalAlignment.Center;//垂直居中
newCell.CellStyle = style; newCell.CellStyle = style;
} }
else else
...@@ -592,11 +586,10 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, int allotLastId, IPe ...@@ -592,11 +586,10 @@ private void WriteSpecialUnit(ISheet sheet, int hospitalId, int allotLastId, IPe
{ {
if (!new List<string> { "量化指标", "数量", "量化指标绩效分值" }.Contains(cell.StringCellValue) && rowIndex == mergedBegin) if (!new List<string> { "量化指标", "数量", "量化指标绩效分值" }.Contains(cell.StringCellValue) && rowIndex == mergedBegin)
{ {
sheet.AddMergedRegion(new CellRangeAddress(mergedBegin, mergedEnd, cellIndex, cellIndex)); //合并单元格 CellRangeAddress region = new CellRangeAddress(mergedBegin, mergedEnd, cellIndex, cellIndex);
sheet.AddMergedRegion(region); //合并单元格
var newCell = importRow.CreateCell(cellIndex); var newCell = importRow.CreateCell(cellIndex);
newCell.SetCellValue(""); newCell.SetCellValue("");
style.Alignment = HorizontalAlignment.Center;//水平居中
style.VerticalAlignment = VerticalAlignment.Center;//垂直居中
newCell.CellStyle = style; newCell.CellStyle = style;
} }
} }
...@@ -648,7 +641,7 @@ private void WriteAccountBasic(ISheet sheet, int allotLastId, IPerSheetDataRead ...@@ -648,7 +641,7 @@ private void WriteAccountBasic(ISheet sheet, int allotLastId, IPerSheetDataRead
} }
var newCell = importRow.CreateCell(cell.ColumnIndex); var newCell = importRow.CreateCell(cell.ColumnIndex);
newCell.SetCellValue(Verify(value)); newCell.SetCellValue(Verify(value));
newCell.CellStyle = style; //newCell.CellStyle = style;
} }
} }
} }
...@@ -678,7 +671,63 @@ public dynamic Verify(string obj) ...@@ -678,7 +671,63 @@ public dynamic Verify(string obj)
} }
} }
#endregion #endregion
#endregion
#region 配置校验
/// <summary>
/// 配置校验
/// </summary>
/// <param name="allotId"></param>
/// <param name="hospitalId"></param>
/// <param name="useTemplate"></param>
public string Judge(int allotId, int hospitalId, int useTemplate)
{
string result = null;
try
{
// 获取绩效信息
var allot = perforPerallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null)
throw new PerformanceException("AllotID错误");
// 获取医院信息
var hospital = perforHospitalRepository.GetEntity(t => t.ID == hospitalId);
if (hospital == null)
throw new PerformanceException("医院ID错误");
// 获取医院配置信息
var hospitalConfigList = perforHospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId);
if (hospitalConfigList == null || hospitalConfigList.Count == 0)
throw new PerformanceException("当前医院暂不支持HIS数据抽取");
// 获取最近一次绩效
var statesArray = new int[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive };
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId && statesArray.Contains(t.States));
var allotLast = allotList.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).First();
// 获取当前医院模版信息
var modulesList = perforModmoduleRepository.GetEntities(t => t.HospitalId == hospitalId);
if (modulesList == null || modulesList.Count == 0)
throw new PerformanceException("当前医院还未配置模版");
// 获取模板项
var moduleIdList = modulesList.Select(t => t.Id).ToList();
var itemsList = perforModitemRepository.GetEntities(t => t.ModuleId.HasValue && moduleIdList.Contains(t.ModuleId.Value));
if (itemsList == null || itemsList.Count == 0)
throw new PerformanceException("当前医院还未配置模版项");
// 获取当前模板所有相关抽取SQL语句
var extractIdList = itemsList.Select(t => t.ExtractId).Union(modulesList.Select(t => t.ExtractId)).Distinct().ToList();
var extractList = perforModextractRepository.GetEntities(t => extractIdList.Contains(t.Id));
if (extractList == null || extractList.Count == 0)
throw new PerformanceException("当前医院配置模板无需抽取");
}
catch (PerformanceException ex)
{
LogHelper.Error(ex.ToString(), "提取绩效数据");
result = ex.ToString();
}
catch (Exception ex)
{
LogHelper.Error(ex.ToString(), "提取绩效数据");
throw new Exception(ex.Message);
}
return result;
}
#endregion #endregion
} }
} }
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