Commit bca53ce4 by 1391696987

修复手工录入无权限报错

parent 505217c5
...@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. ...@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
--> -->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<DeleteExistingFiles>True</DeleteExistingFiles> <DeleteExistingFiles>False</DeleteExistingFiles>
<ExcludeApp_Data>False</ExcludeApp_Data> <ExcludeApp_Data>False</ExcludeApp_Data>
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish> <LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration> <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
......
...@@ -1414,18 +1414,27 @@ public GatherResponse GetGatherTotal(Gather gather) ...@@ -1414,18 +1414,27 @@ public GatherResponse GetGatherTotal(Gather gather)
} }
var user = userRepository.GetEntities(); var user = userRepository.GetEntities();
var userLogin = user.FirstOrDefault(t => t.ID == gather.UserId); var userLogin = user.FirstOrDefault(t => t.ID == gather.UserId);
if (userLogin.Login != "admin")
{ var userSource = perforcollectpermissionRepository.GetEntities(t => t.UserId == gather.UserId)
var userSource = perforcollectpermissionRepository.GetEntities(t => t.UserId == gather.UserId)
.Select(s => Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", "")) .Select(s => Regex.Replace(s.SheetName.Replace(" ", "").Replace(".", ""), "[0-9]", ""))
.Distinct().ToList(); .Distinct().ToList();
exp = exp.And(t => userSource.Contains(t.Source));
var hasDepartment = perdeptdicRepository.GetEntities(p => p.AccountingUnit.Contains(userLogin.Department)).Select(s => s.HISDeptName).Distinct().ToList(); if (userLogin.Login != "admin")
exp = exp.And(t => hasDepartment.Contains(t.Department)); {
if(userSource.Count() != 0)
{
exp = exp.And(t => userSource.Contains(t.Source));
var hasDepartment = perdeptdicRepository.GetEntities(p => p.AccountingUnit.Contains(userLogin.Department)).Select(s => s.HISDeptName).Distinct().ToList();
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);
}
var datas = exresultgatherRepository.GetEntities(exp) 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 })
.Select(s => new .Select(s => new
{ {
......
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