Commit 95faf43c by lcx

抽取前科室、类型校验

parent cfddeca9
......@@ -166,6 +166,22 @@ public ApiResponse Import([FromForm] IFormCollection form)
#region 新版提取
/// <summary>
/// 提取前检查
/// </summary>
/// <returns></returns>
[HttpPost("Prejudge/{allotId}")]
public ApiResponse Prejudge([FromRoute] int allotId)
{
string filePath = configService.LastAllotFilePath(allotId);
if (!string.IsNullOrEmpty(filePath) && FileHelper.IsExistFile(filePath))
{
var data = configService.CheckHasNewDepartmentOrCategory(allotId);
return new ApiResponse(ResponseType.Fail, data);
}
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 提取绩效数据
/// </summary>
/// <param name="request"></param>
......
......@@ -1341,6 +1341,12 @@
<param name="form"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.TemplateController.Prejudge(System.Int32)">
<summary>
提取前检查
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.TemplateController.NewExtractData(Performance.DtoModels.ExtractRequest)">
<summary>
提取绩效数据
......
......@@ -608,6 +608,22 @@ public ModFeeResponse FeeSource(ModModuleRequest request)
#region 配置校验
public string LastAllotFilePath(int allotId)
{
// 获取绩效信息
var allot = perallotRepository.GetEntity(t => t.ID == allotId);
if (allot == null)
throw new PerformanceException("AllotID错误");
var statesArray = new int[] { (int)AllotStates.GenerateSucceed, (int)AllotStates.Archive };
var allotList = perallotRepository.GetEntities(t => t.HospitalId == allot.HospitalId && statesArray.Contains(t.States));
var allotLast = allotList?.OrderByDescending(t => t.Year).ThenByDescending(t => t.Month).First();
if (allotLast != null)
return allotLast.Path;
return "";
}
/// <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