Commit d1815883 by lcx

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

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