提取修改,优先SQL覆盖公式

parent 2458960b
......@@ -226,8 +226,8 @@ public ApiResponse NewExtractData([CustomizeValidator, FromBody] ExtractRequest
//检验科室、费用类型是否需要补充
if (allot.IsExtracting == 1 && allot.ExtractTime.HasValue && DateTime.Now.AddHours(-3) < allot.ExtractTime)
return new ApiResponse(ResponseType.OK, "正在提取数据,请稍等!", new { IsExtracting = true });
//if (allot.IsExtracting == 1 && allot.ExtractTime.HasValue && DateTime.Now.AddHours(-3) < allot.ExtractTime)
// return new ApiResponse(ResponseType.OK, "正在提取数据,请稍等!", new { IsExtracting = true });
_taskService.Add(Background.JobType.提取数据, JsonHelper.Serialize(new { request.AllotId, request.HospitalId, request.UseScheme, isSingle, filePath }));
......
......@@ -79,6 +79,6 @@ public class ex_result
// /// <summary>
// /// 1 删除 0 未删除
// /// </summary>
// public int IsDelete { get; set; }
public int IsDelete { get; set; }
}
}
......@@ -799,7 +799,7 @@ public cof_accounting AccountingInsert(cof_accounting request)
var existed = cofaccountingRepository.GetEntity(w => w.Code == request.Code);
if (existed != null) throw new PerformanceException("核算单元编码重复");
existed = cofaccountingRepository.GetEntity(w => w.UnitType == request.UnitType && w.AccountingUnit == request.AccountingUnit);
existed = cofaccountingRepository.GetEntity(w => w.AllotId == request.AllotId && w.UnitType == request.UnitType && w.AccountingUnit == request.AccountingUnit);
if (existed != null) throw new PerformanceException("核算单元、核算组别已存在");
var entity = new cof_accounting
......
......@@ -292,6 +292,7 @@ private void ExResult(per_allot allot, sys_hospitalconfig config, string sql, st
ConfigId = config.Id,
AllotId = allot.ID,
CreateTime = createTime,
IsDelete = 0,
}).ToList();
exresultRepository.AddRange(result.ToArray());
}
......
......@@ -282,7 +282,9 @@ public static void EvaluateAll(this IWorkbook workbook)
{
try
{
workbook.GetCreationHelper().CreateFormulaEvaluator().EvaluateAll();
var creation = workbook.GetCreationHelper();
var formula = creation?.CreateFormulaEvaluator();
formula?.EvaluateAll();
}
catch
{
......
......@@ -65,9 +65,15 @@ public static void CreateNotExistSheet(List<ex_module> modulesList, IWorkbook wo
var item = pairs.Where(t => t.Key.ToString().NoBlank().StartsWith("1.")).OrderByDescending(t => t.Key).First();
var copysheet = workbook.GetSheet(item.Key);
if (copysheet == null) continue;
try
{
var newSheet = copysheet.CopySheet(module.ModuleName, true);
workbook.SetSheetOrder(newSheet.SheetName, workbook.NumberOfSheets - 1);
}
catch (Exception)
{
}
}
}
}
......
......@@ -225,6 +225,7 @@ private List<ex_result> ExtractModuleData(per_allot allot, string groupName, boo
ConfigId = config.Id,
AllotId = allot.ID,
CreateTime = CreateTime,
IsDelete = 0,
}).ToList();
exresultRepository.InsertExecute(result.ToArray());
data.AddRange(result);
......@@ -303,6 +304,7 @@ private List<ex_result> ExtractItemData(per_allot allot, string groupName, bool
ConfigId = config.Id,
AllotId = allot.ID,
CreateTime = CreateTime,
IsDelete = 0,
}).ToList();
exresultRepository.InsertExecute(result.ToArray());
data.AddRange(result);
......@@ -377,6 +379,7 @@ private List<ex_result> ExtractSpecialData(per_allot allot, string groupName, bo
ConfigId = config.Id,
AllotId = allot.ID,
CreateTime = CreateTime,
IsDelete = 0,
}).ToList();
exresultRepository.InsertExecute(result.ToArray());
data.AddRange(result);
......
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