Commit 2229a0a9 by wyc

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

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