Commit af16f4d2 by 李承祥

绩效校验结果修改

parent 15893460
using Performance.EntityModels;
using System.Collections.Generic;
namespace Performance.DtoModels
{
public class CheckLogResponse
{
public string Level { get; set; }
public List<log_check> Row { get; set; }
}
}
...@@ -30,7 +30,7 @@ public class im_employee ...@@ -30,7 +30,7 @@ public class im_employee
/// sheet页id /// sheet页id
/// </summary> /// </summary>
public Nullable<int> SheetID { get; set; } public Nullable<int> SheetID { get; set; }
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
......
...@@ -37,6 +37,11 @@ public class log_check ...@@ -37,6 +37,11 @@ public class log_check
public Nullable<int> Type { get; set; } public Nullable<int> Type { get; set; }
/// <summary> /// <summary>
/// 1、信息(info)2、警告(warn)3、错误(error)
/// </summary>
public Nullable<int> Level { get; set; }
/// <summary>
/// ///
/// </summary> /// </summary>
public string Titile { get; set; } public string Titile { get; set; }
......
...@@ -35,8 +35,7 @@ internal bool Check(PerExcel excel, per_allot allot) ...@@ -35,8 +35,7 @@ internal bool Check(PerExcel excel, per_allot allot)
//匹配绩效参考标准 //匹配绩效参考标准
//空行数据警告 //空行数据警告
if (!CheckData(excel, allot)) CheckData(excel, allot);
result = false;
//科室收入项 总费用相等 校验(暂不处理) //科室收入项 总费用相等 校验(暂不处理)
...@@ -63,7 +62,7 @@ public PerExcel Classify(PerExcel excel, per_allot allot) ...@@ -63,7 +62,7 @@ public PerExcel Classify(PerExcel excel, per_allot allot)
{ {
message = $"{sheet.SheetName} -- 未识别,请检测sheet页名称是否正确;"; message = $"{sheet.SheetName} -- 未识别,请检测sheet页名称是否正确;";
} }
InsertLog(allot.ID, (int)sheetType, "sheet页名称分类", message); InsertLog(allot.ID, (int)sheetType, 1, "sheet页名称分类", message);
} }
return excel; return excel;
} }
...@@ -129,7 +128,7 @@ public bool Discern(PerExcel excel, per_allot allot) ...@@ -129,7 +128,7 @@ public bool Discern(PerExcel excel, per_allot allot)
if (!flag) if (!flag)
result = false; result = false;
} }
InsertLog(allot.ID, (int)sheet.SheetType, "列头识别", message); InsertLog(allot.ID, (int)sheet.SheetType, 3, "列头识别", message);
} }
return result; return result;
} }
...@@ -229,7 +228,7 @@ public bool CheckData(PerExcel excel, per_allot allot) ...@@ -229,7 +228,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, "空行数据警告", message.ToString()); InsertLog(allot.ID, (int)sheet.SheetType, 2, "空行数据警告", message.ToString());
} }
return result; return result;
} }
...@@ -243,13 +242,14 @@ public bool CheckData(PerExcel excel, per_allot allot) ...@@ -243,13 +242,14 @@ public bool CheckData(PerExcel excel, per_allot allot)
/// <param name="type">1、通过验证,2、验证失败</param> /// <param name="type">1、通过验证,2、验证失败</param>
/// <param name="title"></param> /// <param name="title"></param>
/// <param name="message">描述</param> /// <param name="message">描述</param>
public void InsertLog(int allotId, int type, string title, string message) public void InsertLog(int allotId, int type, int level, string title, string message)
{ {
log_check model = new log_check() log_check model = new log_check()
{ {
AllotID = allotId, AllotID = allotId,
CreateTime = DateTime.Now, CreateTime = DateTime.Now,
Type = type, Type = type,
Level = level,
Titile = title, Titile = title,
Message = message Message = message
}; };
......
...@@ -284,12 +284,25 @@ public List<AgainAllotResponse> GetAgainAllotNotSucceed(per_allot allot) ...@@ -284,12 +284,25 @@ public List<AgainAllotResponse> GetAgainAllotNotSucceed(per_allot allot)
/// </summary> /// </summary>
/// <param name="allot"></param> /// <param name="allot"></param>
/// <returns></returns> /// <returns></returns>
public List<log_check> AllotCheckResult(per_allot allot) public List<CheckLogResponse> AllotCheckResult(per_allot allot)
{ {
List<CheckLogResponse> result = new List<CheckLogResponse>();
var list = perforLogcheckRepository.GetEntities(t => t.AllotID == allot.ID); var list = perforLogcheckRepository.GetEntities(t => t.AllotID == allot.ID);
if (list != null) if (list != null)
list = list.OrderBy(t => t.Titile).ThenBy(t => t.ID).ToList(); {
return list; //list = list.OrderBy(t => t.Type).ThenBy(t => t.ID).ToList();
Dictionary<int, string> keyValues = new Dictionary<int, string> { { 1, "info" }, { 2, "warn" }, { 3, "error" } };
foreach (var item in keyValues)
{
CheckLogResponse data = new CheckLogResponse
{
Level = item.Value,
Row = list.Where(t => t.Level == item.Key).OrderBy(t => t.Type).ThenBy(t => t.ID).ToList()
};
result.Add(data);
}
}
return 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