Commit 3d10d611 by 1391696987

修复bug,下拉框数据筛选

parent 15138d91
......@@ -1265,7 +1265,9 @@ public List<GatherDropResponse> GetGatherDrop(Gather gather)
var specials = exspecialRepository.GetEntities();
var headers = exitemRepository.GetEntities(w => sheets.Select(m => m.Id).Contains(w.ModuleId ?? 0)) ?? new List<ex_item>();
var takeOut = new[] { "核算单元(医技组)", "核算单元(医生组)", "核算单元(护理组)" };
var headers = exitemRepository.GetEntities(w => sheets.Select(m => m.Id).Contains(w.ModuleId ?? 0) && !takeOut.Contains(w.ItemName)) ?? new List<ex_item>();
if (specials != null && specials.Any())
{
......@@ -1278,6 +1280,7 @@ public List<GatherDropResponse> GetGatherDrop(Gather gather)
headers.AddRange(specials.Select(t => new ex_item { ItemName = t.Target, ModuleId = 0 }));
}
// 查询sheet和列头对应
var sheetHeads = from sheet in sheets
join head in headers on sheet.Id equals head.ModuleId
......@@ -1409,17 +1412,18 @@ public GatherResponse GetGatherTotal(Gather gather)
{
exp = exp.And(t => t.Category.Contains(gather.SearchQuery) || t.Source.Contains(gather.SearchQuery));
}
var username = userRepository.GetEntities();
if (username.FirstOrDefault(t => t.ID == gather.UserId).Login != "admin")
var user = userRepository.GetEntities();
var userLogin= user.FirstOrDefault(t => t.ID == gather.UserId);
if (userLogin.Login != "admin")
{
var userSource = perforcollectpermissionRepository.GetEntities(t => t.UserId == gather.UserId)
.Select(s => Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", ""))
.Distinct().ToList();
exp = exp.And(t => userSource.Contains(t.Source));
}
var hasDepartment = perdeptdicRepository.GetEntities(p=>p.AccountingUnit.Contains(userLogin.Department)).Select(s=>s.Department).Distinct();
exp = exp.And(t => hasDepartment.Contains(t.Department));
}
var datas = exresultgatherRepository.GetEntities(exp)
......@@ -1430,7 +1434,7 @@ public GatherResponse GetGatherTotal(Gather gather)
Source = s.Key.Source,
Category = s.Key.Category,
UserId = s.Key.Submitter,
Login = username.FirstOrDefault(t => t.ID == s.Key.Submitter).Login,
Login = user.FirstOrDefault(t => t.ID == s.Key.Submitter).Login,
CreateTime = s.Max(t => t.CreateTime).ToString("d"),
AuditTime = s.Max(t => t.AuditTime)?.ToString("d"),
States = s.Any(w => w.States == (int)AuditGatherEnum.未通过) ? "未通过"
......@@ -1586,7 +1590,10 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "错误原因", "关键信息缺失”请补全或删除" },
});
var ExistsDeptData = departments.FirstOrDefault(w => w.AllotId == allotId && (w.Department.Contains(newGather[i].Department) || w.HISDeptName.Contains(newGather[i].Department)));
var ExistsDeptData = departments.FirstOrDefault(w => w.AllotId == allotId
&& (w.Department != null && w.Department.Contains(newGather[i].Department))
|| (w.HISDeptName !=null && w.HISDeptName.Contains(newGather[i].Department))
);
if (ExistsDeptData == null)
error.Add(new Dictionary<string, string>
{
......@@ -1599,7 +1606,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "错误原因", $"科室字典中不存在科室[{newGather[i].Department}]" },
});
var ExistNameData = employees.FirstOrDefault(w => w.AllotId == allotId && w.DoctorName == newGather[i].DoctorName);
var ExistNameData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.DoctorName!=null && w.DoctorName == newGather[i].DoctorName));
if (ExistNameData == null)
error.Add(new Dictionary<string, string>
{
......@@ -1612,7 +1619,7 @@ public ApiResponse SaveGatherHands(int allotId, SaveGatherData saveGather)
{ "错误原因", $"人员字典中不存在医生姓名[{newGather[i].DoctorName}]" },
});
var ExistNumberData = employees.FirstOrDefault(w => w.AllotId == allotId && w.PersonnelNumber == newGather[i].PersonnelNumber);
var ExistNumberData = employees.FirstOrDefault(w => w.AllotId == allotId && (w.PersonnelNumber!= null && w.PersonnelNumber == newGather[i].PersonnelNumber));
if (ExistNumberData == null)
error.Add(new Dictionary<string, string>
{
......
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