Commit 8b5bea24 by 1391696987

手工录入登录角色判断修改

parent da587975
...@@ -1259,7 +1259,11 @@ public List<GatherDropResponse> GetGatherDrop(Gather gather) ...@@ -1259,7 +1259,11 @@ public List<GatherDropResponse> GetGatherDrop(Gather gather)
var takeOut = new[] { "核算单元(医技组)", "核算单元(医生组)", "核算单元(护理组)", " ", "" }; var takeOut = new[] { "核算单元(医技组)", "核算单元(医生组)", "核算单元(护理组)", " ", "" };
if (username.Login == "admin") var userrole = userroleRepository.GetEntity(t => t.UserID == gather.UserId);
if (userrole == null) throw new PerformanceException("用户未绑定角色");
var roles = new int[] { (int)Role.医院管理员, (int)Role.绩效管理员, (int)Role.绩效核算办 };
if (!roles.Contains(userrole.RoleID))
{ {
var types = new[] { (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.SpecialUnit }; var types = new[] { (int)SheetType.OtherIncome, (int)SheetType.Expend, (int)SheetType.Workload, (int)SheetType.SpecialUnit };
...@@ -1419,20 +1423,29 @@ public GatherResponse GetGatherTotal(Gather gather) ...@@ -1419,20 +1423,29 @@ public GatherResponse GetGatherTotal(Gather gather)
.Select(s => Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", "")) .Select(s => Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", ""))
.Distinct().ToList(); .Distinct().ToList();
if (userLogin.Login != "admin") var userrole = userroleRepository.GetEntity(t => t.UserID == gather.UserId);
if (userrole == null) throw new PerformanceException("用户未绑定角色");
var roles = new int[] { (int)Role.医院管理员, (int)Role.绩效管理员, (int)Role.绩效核算办 };
List<ex_result_gather> exresultgather = new List<ex_result_gather>();
if (!roles.Contains(userrole.RoleID))
{ {
if(userSource.Count() != 0) if (userSource.Count() != 0)
{ {
exp = exp.And(t => userSource.Contains(t.Source)); exp = exp.And(t => userSource.Contains(t.Source));
var hasDepartment = perdeptdicRepository.GetEntities(p => p.AccountingUnit.Contains(userLogin.Department)).Select(s => s.HISDeptName).Distinct().ToList(); var hasDepartment = perdeptdicRepository.GetEntities(p => p.AccountingUnit.Contains(userLogin.Department)).Select(s => s.HISDeptName).Distinct().ToList();
exp = exp.And(t => hasDepartment.Contains(t.Department)); exp = exp.And(t => hasDepartment.Contains(t.Department));
}
}
List<ex_result_gather> exresultgather = new List<ex_result_gather>();
if (userSource.Count() != 0) {
exresultgather = exresultgatherRepository.GetEntities(exp); exresultgather = exresultgatherRepository.GetEntities(exp);
} }
}
else
{
exresultgather = exresultgatherRepository.GetEntities(t=>t.AllotId == gather.AllotId);
}
var datas = exresultgather var datas = exresultgather
.GroupBy(t => new { t.Department, t.Source, t.Category, t.Submitter }) .GroupBy(t => new { t.Department, t.Source, t.Category, t.Submitter })
......
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