Commit 81a6b18e by lcx

自定义提取推送日志修改返回内容

parent 41b5c47f
......@@ -1459,24 +1459,23 @@ public void CheckGatherData(int allotId, SaveGatherData saveGather)
var data = saveGather.Data;
var departments = perdeptdicRepository.GetEntities(w => w.HospitalId == allot.HospitalId);
if (departments != null && departments.Any())
{
var notExistsDeptData = data.Where(w => !departments.Select(t => t.Department).Contains(w[0]));
if (notExistsDeptData != null && notExistsDeptData.Any())
throw new PerformanceException($"科室字典中不存在科室[{string.Join(",", notExistsDeptData.Select(t => t[0]).Distinct())}]");
}
if (departments == null || !departments.Any()) throw new PerformanceException("未配置科室字典");
var notExistsDeptData = data.Where(w => !departments.Select(t => t.Department).Contains(w[0]));
if (notExistsDeptData != null && notExistsDeptData.Any())
throw new PerformanceException($"科室字典中不存在科室[{string.Join(",", notExistsDeptData.Select(t => t[0]).Distinct())}]");
var employees = peremployeeRepository.GetEntities(w => w.AllotId == allotId);
if (employees != null && employees.Any())
{
var notExistNameData = data.Where(w => !employees.Select(t => t.DoctorName).Contains(w[1]) && !string.IsNullOrEmpty(w[1]));
if (notExistNameData != null && notExistNameData.Any())
throw new PerformanceException($"人员字典中不存在医生姓名[{string.Join(",", notExistNameData.Select(t => t[1]).Distinct())}]");
if (employees == null || !employees.Any()) throw new PerformanceException("未配置人员字典");
var notExistNumberData = data.Where(w => !employees.Select(t => t.PersonnelNumber).Contains(w[2]) && !string.IsNullOrEmpty(w[2]));
if (notExistNumberData != null && notExistNumberData.Any())
throw new PerformanceException($"人员字典中不存在工号[{string.Join(",", notExistNumberData.Select(t => t[2]).Distinct())}]");
}
var notExistNameData = data.Where(w => !employees.Select(t => t.DoctorName).Contains(w[1]) && !string.IsNullOrEmpty(w[1]));
if (notExistNameData != null && notExistNameData.Any())
throw new PerformanceException($"人员字典中不存在医生姓名[{string.Join(",", notExistNameData.Select(t => t[1]).Distinct())}]");
var notExistNumberData = data.Where(w => !employees.Select(t => t.PersonnelNumber).Contains(w[2]) && !string.IsNullOrEmpty(w[2]));
if (notExistNumberData != null && notExistNumberData.Any())
throw new PerformanceException($"人员字典中不存在工号[{string.Join(",", notExistNumberData.Select(t => t[2]).Distinct())}]");
var sheets = perforPersheetRepository.GetEntities(w => w.AllotID == allotId);
if (sheets != null && sheets.Any())
......@@ -1548,7 +1547,7 @@ public void AddCategoryToConfig(int allotId)
var specials = exspecialRepository.GetEntities(w => w.HospitalId == allot.HospitalId);
if (specials == null || !specials.Any()) return;
var list = (specials == null || !specials.Any())
var list = (specials == null || !specials.Any())
? speacialCategories
: speacialCategories.Where(w => !specials.Select(t => t.Target + t.Department).Contains(w.Category + w.Department));
......
......@@ -53,9 +53,9 @@ private void Consumer()
}
public enum NotificationLevel
{
[Description("通知")] INF,
[Description("警告")] WAR,
[Description("错误")] ERR,
[Description("通知")] INF = 1,
[Description("警告")] WAR = 2,
[Description("错误")] ERR = 3,
}
public class Notification
{
......@@ -75,11 +75,11 @@ public abstract class PushContent
protected PushContent(string subject, NotificationLevel level)
{
Subject = subject;
LogLevel = level.ToString();
LogLevel = (int)level;
}
public abstract string Type { get; }
public string LogLevel { get; }
public int LogLevel { get; }
public string Time { get => DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); }
public string Subject { get; set; }
}
......@@ -120,7 +120,7 @@ public UrlContent(string subject, string url, NotificationLevel level = Notifica
}
public class CustomDownloadContent : Notification.PushContent
{
public CustomDownloadContent(string subject,object @object ,NotificationLevel level = NotificationLevel.INF)
public CustomDownloadContent(string subject, object @object, NotificationLevel level = NotificationLevel.INF)
: base(subject, level)
{
Arguments = @object;
......
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