Commit 6bca28e0 by 钟博

更多按钮新增医院其他绩效

parent ceb0691e
......@@ -22,14 +22,19 @@ public class EmployeeController : Controller
private AllotService allotService;
private ClaimService claim;
private IHostingEnvironment evn;
private readonly RoleService roleService;
private readonly UserService userService;
public EmployeeController(EmployeeService employeeService, AllotService allotService,
ClaimService claim, IHostingEnvironment evn)
ClaimService claim, IHostingEnvironment evn, RoleService roleService,
UserService userService)
{
this.employeeService = employeeService;
this.allotService = allotService;
this.claim = claim;
this.evn = evn;
this.roleService = roleService;
this.userService = userService;
}
/// <summary>
......@@ -456,8 +461,20 @@ public ApiResponse<List<TitleValue>> GetPerforTypeDict([FromRoute] int allotId)
[HttpPost]
public ApiResponse AprOverview(int allotId)
{
var relust = employeeService.GetOtherPerStats(allotId);
return new ApiResponse(ResponseType.OK, relust);
var roleType = new[] { 3, 4, 9, 10 };
var userid = claim.GetUserId();
var user = userService.GetUser(userid);
var role = roleService.GetUserRole(user.UserID);
var result = new List<Dictionary<string, string>>();
if (role.Any(t => roleType.Contains(t.Type.Value)))
result = employeeService.GetOtherPerStats(allotId,user.Department??"");
else
result = employeeService.GetOtherPerStats(allotId);
return new ApiResponse(ResponseType.OK, result);
}
#endregion
......
......@@ -665,10 +665,12 @@ public List<TitleValue> GetPerforTypeDict(int allotId)
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public List<Dictionary<string, string>> GetOtherPerStats(int allotId)
public List<Dictionary<string, string>> GetOtherPerStats(int allotId, string department=null)
{
var others = new List<Dictionary<string, string>>();
var aprAmountList = perapramountRepository.GetFullAmount(w => w.AllotId == allotId && w.Status == 3);
if (department != null)
aprAmountList = aprAmountList.Where(t => t.AccountingUnit == department).ToList();
var perForType = aprAmountList.Select(t => t.PerforType).Distinct();
foreach (var num in aprAmountList.Select(t => t.PersonnelNumber).Distinct())
......
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