Commit 2229a0a9 by wyc

医院其他绩效审核(角色配置)

parent 0993a77f
...@@ -23,7 +23,8 @@ ...@@ -23,7 +23,8 @@
// 抽取结果Excel文件保存地址 // 抽取结果Excel文件保存地址
"AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com", "AbsolutePath": "E:\\wwwroot\\testjx.suvalue.com",
// 抽取结果Excel文件保存地址 更替的 网络地址 // 抽取结果Excel文件保存地址 更替的 网络地址
"HttpPath": "http://testjx.suvalue.com:81" "HttpPath": "http://testjx.suvalue.com:81",
"RoleId": [ 1, 2, 5, 8, 14, 15, 16 ]
}, },
"WebapiUrl": { "WebapiUrl": {
// 抽取结果保存地址 // 抽取结果保存地址
......
using System; using AutoMapper;
using System.Collections.Generic; using Microsoft.Extensions.Configuration;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
using AutoMapper;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Newtonsoft.Json; using Newtonsoft.Json;
using NPOI.HSSF.UserModel; using NPOI.HSSF.UserModel;
...@@ -18,6 +13,13 @@ ...@@ -18,6 +13,13 @@
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
using Performance.Repository.Repository; using Performance.Repository.Repository;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text.RegularExpressions;
namespace Performance.Services namespace Performance.Services
{ {
...@@ -50,6 +52,7 @@ public class EmployeeService : IAutoInjection ...@@ -50,6 +52,7 @@ public class EmployeeService : IAutoInjection
private readonly DownloadService downloadService; private readonly DownloadService downloadService;
private readonly PerAprAmountTypeRepository perAprAmountTypeRepository; private readonly PerAprAmountTypeRepository perAprAmountTypeRepository;
private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository; private readonly PerAprAmountTypeHideRepository perAprAmountTypeHIdeRepository;
private readonly IConfiguration _configuration;
...@@ -83,7 +86,9 @@ public class EmployeeService : IAutoInjection ...@@ -83,7 +86,9 @@ public class EmployeeService : IAutoInjection
UserService userService, UserService userService,
DownloadService downloadService, DownloadService downloadService,
PerAprAmountTypeRepository perAprAmountTypeRepository, PerAprAmountTypeRepository perAprAmountTypeRepository,
PerAprAmountTypeHideRepository perAprAmountTypeHideRepository PerAprAmountTypeHideRepository perAprAmountTypeHideRepository,
IConfiguration configuration
) )
{ {
_mapper = mapper; _mapper = mapper;
...@@ -113,6 +118,7 @@ PerAprAmountTypeHideRepository perAprAmountTypeHideRepository ...@@ -113,6 +118,7 @@ PerAprAmountTypeHideRepository perAprAmountTypeHideRepository
this.downloadService = downloadService; this.downloadService = downloadService;
this.perAprAmountTypeRepository = perAprAmountTypeRepository; this.perAprAmountTypeRepository = perAprAmountTypeRepository;
this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository; this.perAprAmountTypeHIdeRepository = perAprAmountTypeHideRepository;
_configuration = configuration;
} }
#region 行政人员 #region 行政人员
...@@ -452,7 +458,8 @@ public List<OhterAmountAuditResponse> GetAprList(int allotId, int userId, int is ...@@ -452,7 +458,8 @@ public List<OhterAmountAuditResponse> GetAprList(int allotId, int userId, int is
if (userrole == null) throw new PerformanceException("用户未绑定角色"); if (userrole == null) throw new PerformanceException("用户未绑定角色");
Expression<Func<per_apr_amount, bool>> expression = t => t.AllotId == allotId && (t.Amount ?? 0) != 0; Expression<Func<per_apr_amount, bool>> expression = t => t.AllotId == allotId && (t.Amount ?? 0) != 0;
var roles = new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 }; int[] roles = _configuration.GetSection("Application:RoleId").Get<int[]>()
?? new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 };
if (!roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办、院领导查看所有科室的数据 if (!roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办、院领导查看所有科室的数据
expression = expression.And(t => t.CreateUser == userId); expression = expression.And(t => t.CreateUser == userId);
...@@ -460,7 +467,7 @@ public List<OhterAmountAuditResponse> GetAprList(int allotId, int userId, int is ...@@ -460,7 +467,7 @@ public List<OhterAmountAuditResponse> GetAprList(int allotId, int userId, int is
expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1)); expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1));
var list = perapramountRepository.GetEntities(expression) ?? new List<per_apr_amount>(); var list = perapramountRepository.GetEntities(expression) ?? new List<per_apr_amount>();
if (list != null && list.Any()) if (list.Any())
list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList(); list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList();
var result = list.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate }) var result = list.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate })
...@@ -1099,7 +1106,8 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in ...@@ -1099,7 +1106,8 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in
if (userrole == null) throw new PerformanceException("用户未绑定角色"); if (userrole == null) throw new PerformanceException("用户未绑定角色");
Expression<Func<per_apr_amount_hide, bool>> expression = t => t.AllotId == allotId && (t.Amount ?? 0) != 0; Expression<Func<per_apr_amount_hide, bool>> expression = t => t.AllotId == allotId && (t.Amount ?? 0) != 0;
var roles = new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 }; int[] roles = _configuration.GetSection("Application:RoleId").Get<int[]>()
?? new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 };
if (!roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办查看所有科室的数据 if (!roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办查看所有科室的数据
expression = expression.And(t => t.CreateUser == userId); expression = expression.And(t => t.CreateUser == userId);
...@@ -1107,7 +1115,7 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in ...@@ -1107,7 +1115,7 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in
expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1)); expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1));
var list = _hideRepository.GetEntities(expression) ?? new List<per_apr_amount_hide>(); var list = _hideRepository.GetEntities(expression) ?? new List<per_apr_amount_hide>();
if (list != null && list.Any()) if (list.Any())
list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList(); list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList();
var result = list.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate }) var result = list.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate })
...@@ -1132,7 +1140,7 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in ...@@ -1132,7 +1140,7 @@ public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, in
ShowCommit = (new int[] { 1, 4 }).Contains(status) && t.FirstOrDefault(t => t.CreateUser.HasValue).CreateUser == userId, ShowCommit = (new int[] { 1, 4 }).Contains(status) && t.FirstOrDefault(t => t.CreateUser.HasValue).CreateUser == userId,
}; };
}); });
if (result != null && result.Any()) if (result.Any())
result = result.OrderByDescending(o => o.CreateDate).ToList(); result = result.OrderByDescending(o => o.CreateDate).ToList();
return result.ToList(); return result.ToList();
......
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