Commit 81a6b18e by lcx

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

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