Commit d1815883 by lcx

取消二次绩效handsontable相关接口调整,添加sheettyp枚举考核,考核相关数据抽取时模板copy,添加人员字典数据时更新其allotid,hospitalid

parent 7ffa0d8c
......@@ -401,11 +401,11 @@ public ApiResponse NursingDeptAuditResult([FromBody] SecondAuditRequest request)
[HttpPost]
public ApiResponse OtherList([FromBody] AgOtherRequest request)
{
//var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId());
var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
var result = secondAllotService.OtherList(request.SecondId, claimService.GetUserId());
//var result = secondAllotDetails.GetOtherTempData(claimService.GetUserId(), request.SecondId, request.IsArchive, request.EmployeeSource, out decimal? realAmount);
var obj = new
{
header = secondAllotService.OtherListHeader(request.SecondId, realAmount ?? 0),
header = secondAllotService.OtherListHeader(request.SecondId, result?.Sum(s => s.RealAmount) ?? 0),
body = result,
};
return new ApiResponse(ResponseType.OK, obj);
......@@ -415,14 +415,21 @@ public ApiResponse OtherList([FromBody] AgOtherRequest request)
/// 二次绩效其他绩效保存
/// </summary>
/// <returns></returns>
[Route("api/second/other/save/{secondId}")]
[HttpPost]
public ApiResponse OtherSave(int secondId, [FromBody] SaveCollectData request)
[Route("api/second/other/save")]
public ApiResponse OtherSave([FromBody] AgOtherRequest request)
{
secondAllotService.OtherSave(secondId, request);
return new ApiResponse(ResponseType.OK);
var result = secondAllotService.OtherSave(request.SecondId, request.Othersources);
return new ApiResponse(ResponseType.OK, result);
}
//[Route("api/second/other/save/{secondId}")]
//[HttpPost]
//public ApiResponse OtherSave(int secondId, [FromBody] SaveCollectData request)
//{
// secondAllotService.OtherSave(secondId, request);
// return new ApiResponse(ResponseType.OK);
//}
#endregion 二次绩效其他绩效
/// <summary>
......
......@@ -1238,7 +1238,7 @@
</summary>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.OtherSave(System.Int32,Performance.DtoModels.SaveCollectData)">
<member name="M:Performance.Api.Controllers.SecondAllotController.OtherSave(Performance.DtoModels.AgOtherRequest)">
<summary>
二次绩效其他绩效保存
</summary>
......
......@@ -84,6 +84,12 @@ private void Employee(per_allot allot, sys_hospitalconfig config, string sql)
{
peremployeeRepository.RemoveRange(employees.ToArray());
}
data.ToList().ForEach(t =>
{
t.AllotId = allot.ID;
t.HospitalId = allot.HospitalId;
});
peremployeeRepository.AddRange(data.ToArray());
}
catch (Exception ex)
......
......@@ -87,6 +87,7 @@ public static void SetCellValue<T>(this ICell cell, object value, T defaultValue
cell.SetCellValue("");
}
}
public static void SetValue(this ISheet sheet, int row, int column, object value)
{
var icell = sheet.GetOrCreate(row).GetOrCreate(column);
......@@ -97,6 +98,7 @@ public static void SetValue(this ISheet sheet, int row, int column, object value
case string reg when Regex.IsMatch(reg, @"^[+-]?\d*[.]?\d*$"):
value = ConvertHelper.To<double>(value);
break;
case string reg when Regex.IsMatch(reg, @"^[+-]?\d*$"):
value = ConvertHelper.To<int>(value);
break;
......@@ -106,7 +108,6 @@ public static void SetValue(this ISheet sheet, int row, int column, object value
SetCellOValue(icell, value);
}
public static void SetCellOValue(this ICell cell, object value)
{
if (cell == null) return;
......@@ -269,5 +270,21 @@ public static List<string> GetCellValues(this IRow row)
return pairs;
}
/// <summary>
/// 实时更新公式的结果
/// </summary>
/// <param name="workbook"></param>
public static void EvaluateAll(this IWorkbook workbook)
{
try
{
workbook.GetCreationHelper().CreateFormulaEvaluator().EvaluateAll();
}
catch
{
return;
}
}
}
}
......@@ -142,9 +142,16 @@ public static void ClearSheetTemplate(ISheet sheet, PerSheetPoint point, SheetTy
if (!new SheetType[] { SheetType.Workload, SheetType.OtherWorkload }.Contains(sheetType))
{
if (sheet.NumMergedRegions > 0)
{
for (int mergedIndex = sheet.NumMergedRegions - 1; mergedIndex >= 0; mergedIndex--)
{
sheet.RemoveMergedRegion(mergedIndex);
}
}
var row = sheet.GetRow(0);
if (row != null) sheet.RemoveRow(row);
sheet.ShiftRows(point.DataFirstRowNum.Value, sheet.LastRowNum + 1, -1);
}
}
......
......@@ -90,10 +90,10 @@ public string Main(int allotId, int hospitalId, string email, string groupName,
WriteDataToFile(workbook, allotId, dict, standData, groupName, isSingle);
logService.ReturnTheLog(allotId, groupName, 2, "提取完成", $"绩效数据提取成功", 5, isSingle);
workbook.GetCreationHelper().CreateFormulaEvaluator().EvaluateAll(); //实时更新公式的结果
allot.IsExtracting = isSingle ? 2 : 0;
allot.ExtractPath = extractFilePath;
workbook.EvaluateAll();
}
catch (Exception ex)
{
......
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