Commit 64628b3b by 李承祥

bug--绩效数据校验

parent 5114ad55
...@@ -50,5 +50,10 @@ public class log_check ...@@ -50,5 +50,10 @@ public class log_check
/// ///
/// </summary> /// </summary>
public string Message { get; set; } public string Message { get; set; }
/// <summary>
/// 检验结果是否正确
/// </summary>
public Nullable<int> IsTrue { get; set; }
} }
} }
...@@ -55,14 +55,16 @@ public PerExcel Classify(PerExcel excel, per_allot allot) ...@@ -55,14 +55,16 @@ public PerExcel Classify(PerExcel excel, per_allot allot)
foreach (var sheet in perSheet) foreach (var sheet in perSheet)
{ {
string message; string message;
bool flag = true;
SheetType sheetType = perSheetService.GetSheetType(sheet.SheetName); SheetType sheetType = perSheetService.GetSheetType(sheet.SheetName);
if (sheetType != SheetType.Unidentifiable) if (sheetType != SheetType.Unidentifiable)
message = $"{sheet.SheetName} -- 已成功分类,类别为:{EnumHelper.GetDescription(sheetType)};"; message = $"{sheet.SheetName} -- 已成功分类,类别为:{EnumHelper.GetDescription(sheetType)};";
else else
{ {
flag = false;
message = $"{sheet.SheetName} -- 未识别,请检测sheet页名称是否正确;"; message = $"{sheet.SheetName} -- 未识别,请检测sheet页名称是否正确;";
} }
InsertLog(allot.ID, (int)sheetType, 1, "sheet页名称分类", message); InsertLog(allot.ID, (int)sheetType, 1, "sheet页名称分类", message, flag);
} }
return excel; return excel;
} }
...@@ -128,7 +130,7 @@ public bool Discern(PerExcel excel, per_allot allot) ...@@ -128,7 +130,7 @@ public bool Discern(PerExcel excel, per_allot allot)
if (!flag) if (!flag)
result = false; result = false;
} }
InsertLog(allot.ID, (int)sheet.SheetType, 3, "列头识别", message); InsertLog(allot.ID, (int)sheet.SheetType, 3, "列头识别", message, flag);
} }
return result; return result;
} }
...@@ -228,7 +230,7 @@ public bool CheckData(PerExcel excel, per_allot allot) ...@@ -228,7 +230,7 @@ public bool CheckData(PerExcel excel, per_allot allot)
result = false; result = false;
message = $"{sheet.SheetName} -- 有{count}行数据不合规范,行号是{String.Join("、", rowNumber.ToArray())};"; message = $"{sheet.SheetName} -- 有{count}行数据不合规范,行号是{String.Join("、", rowNumber.ToArray())};";
} }
InsertLog(allot.ID, (int)sheet.SheetType, 2, "空行数据警告", message.ToString()); InsertLog(allot.ID, (int)sheet.SheetType, 2, "空行数据警告", message.ToString(), flag);
} }
return result; return result;
} }
...@@ -238,11 +240,13 @@ public bool CheckData(PerExcel excel, per_allot allot) ...@@ -238,11 +240,13 @@ public bool CheckData(PerExcel excel, per_allot allot)
/// <summary> /// <summary>
/// 向log_check表中添加记录 /// 向log_check表中添加记录
/// </summary> /// </summary>
/// <param name="allotId">绩效id</param> /// <param name="allotId"></param>
/// <param name="type">1、通过验证,2、验证失败</param> /// <param name="type">sheet_type</param>
/// <param name="level">错误等级</param>
/// <param name="title"></param> /// <param name="title"></param>
/// <param name="message">描述</param> /// <param name="message">描述</param>
public void InsertLog(int allotId, int type, int level, string title, string message) /// <param name="istrue">校验结果</param>
public void InsertLog(int allotId, int type, int level, string title, string message, bool istrue)
{ {
log_check model = new log_check() log_check model = new log_check()
{ {
...@@ -251,7 +255,8 @@ public void InsertLog(int allotId, int type, int level, string title, string mes ...@@ -251,7 +255,8 @@ public void InsertLog(int allotId, int type, int level, string title, string mes
Type = type, Type = type,
Level = level, Level = level,
Titile = title, Titile = title,
Message = message Message = message,
IsTrue = istrue ? 1 : 0
}; };
perforLogcheckRepository.Add(model); perforLogcheckRepository.Add(model);
} }
......
...@@ -63,7 +63,7 @@ public string ExtractData(int hospitalId) ...@@ -63,7 +63,7 @@ public string ExtractData(int hospitalId)
var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId); var allotList = perforPerallotRepository.GetEntities(t => t.HospitalId == hospitalId);
var configList = perforHospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId); var configList = perforHospitalconfigRepository.GetEntities(t => t.HospitalId == hospitalId);
var first = perforPerfirstRepository.GetEntity(t => t.HospitalId == hospitalId); var firstList = perforPerfirstRepository.GetEntities(t => t.HospitalId == hospitalId);
if (configList == null || !configList.Any()) if (configList == null || !configList.Any())
throw new PerformanceException($"暂不支持自动提取绩效数据"); throw new PerformanceException($"暂不支持自动提取绩效数据");
...@@ -71,8 +71,9 @@ public string ExtractData(int hospitalId) ...@@ -71,8 +71,9 @@ public string ExtractData(int hospitalId)
var hospitalConfig = configList.First(); var hospitalConfig = configList.First();
string originalPath = ""; string originalPath = "";
//判断是否是首次 //判断是否是首次
if ((allotList == null || !allotList.Any()) && first != null) if ((allotList == null || !allotList.Any()) && firstList != null)
{ {
var first = firstList.OrderByDescending(t => t.CreateDate).FirstOrDefault();
//首次 从excel中获取人员信息,SHEET页信息,列头信息 //首次 从excel中获取人员信息,SHEET页信息,列头信息
sheetList = GetFileData(first.Path); sheetList = GetFileData(first.Path);
originalPath = first.Path; originalPath = first.Path;
......
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