Commit 2a6523ec by ruyun.zhang

获取所有员工记录

parent 07fb0ab9
......@@ -679,11 +679,12 @@ public ApiResponse DeptRollback(int allotId, string unitType)
/// </summary>
/// <param name="allotId">绩效月ID</param>
/// <param name="unitType">核算组别</param>
/// <param name="accountingUnit">核算单元</param>
/// <param name="audit"></param>
/// <returns></returns>
[HttpPost]
[Route("dept/audit")]
public ApiResponse DeptAudit(int allotId, string unitType, [FromBody] AttendanceDeptAudit audit)
public ApiResponse DeptAudit(int allotId, string unitType, string accountingUnit, [FromBody] AttendanceDeptAudit audit)
{
if (audit == null)
throw new PerformanceException("审核参数错误");
......@@ -692,10 +693,8 @@ public ApiResponse DeptAudit(int allotId, string unitType, [FromBody] Attendance
if (!states.Contains(audit.State))
throw new PerformanceException("暂不支持当前审核模式");
var userid = claim.GetUserId();
var realName = claim.GetUserClaim(JwtClaimTypes.RealName);
return _attendanceService.DeptAudit(allotId, unitType, audit.State, audit.Remark, userid, realName);
return _attendanceService.DeptAudit(allotId, unitType, accountingUnit, audit.State, audit.Remark, realName);
}
/// <summary>
......
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
......@@ -52,6 +53,40 @@ public ApiResponse GetPersons([FromRoute] int allotId, [FromBody] PersonParamsRe
}
/// <summary>
/// 获取所有员工记录
/// </summary>
/// <param name="allotId">绩效月ID</param>
/// <param name="personnelNumber">工号</param>
/// <param name="personnelName">姓名</param>
/// <param name="unitType">核算组别</param>
/// <param name="accountingUnit">核算单元</param>
/// <param name="searchText">多字段查询;支持“工号/姓名/核算组别/核算单元”</param>
/// <param name="pageIndex">页码 默认1</param>
/// <param name="pageSize">行数 默认</param>
/// <returns></returns>
[Route("employee/list")]
[HttpPost]
public ApiResponse GetEmployee([FromQuery] int allotId,
[FromQuery, DefaultValue("")] string personnelNumber,
[FromQuery, DefaultValue("")] string personnelName,
[FromQuery, DefaultValue("")] string unitType,
[FromQuery, DefaultValue("")] string accountingUnit,
[FromQuery, DefaultValue("")] string searchText,
[FromQuery, DefaultValue(1)] int pageIndex,
[FromQuery, DefaultValue(20)] int pageSize)
{
var list = personService.GetEmployee(allotId, personnelNumber, personnelName, unitType, accountingUnit, searchText, pageIndex, pageSize);
return new ApiResponse(ResponseType.OK, new
{
list.CurrentPage,
list.TotalPages,
list.PageSize,
list.TotalCount,
list
});
}
/// <summary>
/// 新增员工信息
/// </summary>
/// <param name="request"></param>
......
......@@ -34,7 +34,7 @@
"/api/account/updateuser"
],
//登录过期时间
"ExpirationMinutes": "1200",
"ExpirationMinutes": "1200000",
//验证码过期
"SmsCodeMinutes": "5",
////护士长二次绩效管理员
......
......@@ -553,12 +553,13 @@
<param name="unitType">核算组别</param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.AttendanceController.DeptAudit(System.Int32,System.String,Performance.DtoModels.Request.AttendanceDeptAudit)">
<member name="M:Performance.Api.Controllers.AttendanceController.DeptAudit(System.Int32,System.String,System.String,Performance.DtoModels.Request.AttendanceDeptAudit)">
<summary>
科室考勤上报结果审核
</summary>
<param name="allotId">绩效月ID</param>
<param name="unitType">核算组别</param>
<param name="accountingUnit">核算单元</param>
<param name="audit"></param>
<returns></returns>
</member>
......@@ -2028,6 +2029,20 @@
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.PersonController.GetEmployee(System.Int32,System.String,System.String,System.String,System.String,System.String,System.Int32,System.Int32)">
<summary>
获取所有员工记录
</summary>
<param name="allotId">绩效月ID</param>
<param name="personnelNumber">工号</param>
<param name="personnelName">姓名</param>
<param name="unitType">核算组别</param>
<param name="accountingUnit">核算单元</param>
<param name="searchText">多字段查询;支持“工号/姓名/核算组别/核算单元”</param>
<param name="pageIndex">页码 默认1</param>
<param name="pageSize">行数 默认</param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.PersonController.CreatePerson(Performance.DtoModels.PerEmployeeResponse)">
<summary>
新增员工信息
......
......@@ -2142,7 +2142,7 @@
</member>
<member name="P:Performance.DtoModels.Request.AttendanceDeptMore.UnitType">
<summary>
人员类
核算组
</summary>
</member>
<member name="P:Performance.DtoModels.Request.AttendanceDeptMore.AccountingUnit">
......
......@@ -80,7 +80,7 @@ public class AttendanceDeptMore : AttendanceDept
public string Code { get; set; }
/// <summary>
/// 人员类
/// 核算组
/// </summary>
public string UnitType { get; set; }
......
......@@ -1842,12 +1842,9 @@ public ApiResponse DeptRollback(int allotId, string unitType, int userid, string
/// <param name="unitType"></param>
/// <param name="state"></param>
/// <param name="remark"></param>
/// <param name="userid"></param>
/// <param name="userName"></param>
/// <returns></returns>
/// <exception cref="PerformanceException"></exception>
/// <exception cref="NotImplementedException"></exception>
public ApiResponse DeptAudit(int allotId, string unitType, int state, string remark, int userid, string userName)
public ApiResponse DeptAudit(int allotId, string unitType, string accountingUnit, int state, string remark, string userName)
{
var allot = perforPerallotRepository.GetEntity(w => w.ID == allotId);
if (allot == null)
......@@ -1856,16 +1853,7 @@ public ApiResponse DeptAudit(int allotId, string unitType, int state, string rem
var begMonthDate = allot.Month >= 1 && allot.Month <= 12 ? new DateTime(allot.Year, allot.Month, 1) : new DateTime(allot.Year, 12, 1);
var endMonthDate = begMonthDate.AddMonths(1).AddDays(-1);
//当角色对应时过滤
var userInfo = _userRepository.GetUser(userid);
if (userInfo?.User == null) throw new NotImplementedException("当前用户不存在");
if (userInfo?.URole == null) throw new NotImplementedException("当前用户暂未分配角色");
var queryUnitTypes = UnitTypeUtil.GetMaps(userInfo?.URole.Type ?? 0);
string queryAccountingUnit = userInfo.User.Department;
if (!queryUnitTypes.Contains(unitType)) throw new PerformanceException("当前用户角色与“核算组别”不匹配");
var attendances = _attendanceDeptRepository.GetEntities((w) => w.AllotId == allotId && queryUnitTypes.Contains(w.UnitType) && queryAccountingUnit.Equals(w.AccountingUnit))
var attendances = _attendanceDeptRepository.GetEntities((w) => w.AllotId == allotId && unitType.Equals(w.UnitType) && accountingUnit.Equals(w.AccountingUnit))
?? new List<per_attendance_dept>();
if (attendances.Count() != attendances.Count(w => w.State == (int)Attendance.Report.提交))
......
using AutoMapper;
using MassTransit.Internals.GraphValidation;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
......@@ -255,6 +256,28 @@ public PageList<per_employee> GetPersons(int allotId, int userId, PersonParamsRe
}
/// <summary>
/// 获取所有员工记录分页
/// </summary>
/// <param name="allotId"></param>
/// <returns></returns>
public PageList<per_employee> GetEmployee(int allotId, string personnelNumber, string personnelName, string unitType, string accountingUnit, string searchText, int pageIndex, int pageSize)
{
Expression<Func<per_employee, bool>> exp = t => t.AllotId == allotId;
if (!string.IsNullOrEmpty(personnelNumber))
exp = exp.And(w => w.PersonnelNumber.Contains(personnelNumber));
if (!string.IsNullOrEmpty(personnelName))
exp = exp.And(w => w.DoctorName.Contains(personnelName));
if (!string.IsNullOrEmpty(unitType))
exp = exp.And(w => w.UnitType.Equals(unitType));
if (!string.IsNullOrEmpty(accountingUnit))
exp = exp.And(w => w.AccountingUnit.Contains(accountingUnit));
if (!string.IsNullOrEmpty(searchText))
exp = exp.And(w => w.PersonnelNumber.Contains(searchText) || w.DoctorName.Contains(searchText) || w.UnitType.Contains(searchText) || w.AccountingUnit.Contains(searchText));
return peremployeeRepository.GetEntitiesForPaging(pageIndex, pageSize, exp);
}
/// <summary>
/// 新增员工信息
/// </summary>
/// <param name="request"></param>
......
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