Commit 1c94729e by ruyun.zhang@suvalue.com

Merge branch 'feature/多工作量模板自动补全' into develop

parents bf7cacaf e74e97ee
......@@ -522,11 +522,11 @@ public ApiResponse SaveValue([FromRoute] int secondId, [FromBody] dynamic reques
/// 二次绩效录入页面自动补全
/// </summary>
/// <returns></returns>
[Route("api/second/autocomplete/{secondId}/{jobNumber}")]
[Route("api/second/autocomplete/{secondId}")]
[HttpPost]
public ApiResponse AutoCompleteBodyData([FromRoute] int secondId, string jobNumber)
public ApiResponse AutoCompleteBodyData([FromRoute] int secondId, SecondEmployeeRequest request)
{
var result = secondAllotService.AutoComplete(secondId, jobNumber);
var result = secondAllotService.AutoComplete(secondId, request);
return new ApiResponse(ResponseType.OK, result);
}
}
......
......@@ -1436,7 +1436,7 @@
<param name="request"></param>
<returns></returns>
</member>
<member name="M:Performance.Api.Controllers.SecondAllotController.AutoCompleteBodyData(System.Int32,System.String)">
<member name="M:Performance.Api.Controllers.SecondAllotController.AutoCompleteBodyData(System.Int32,Performance.DtoModels.SecondEmployeeRequest)">
<summary>
二次绩效录入页面自动补全
</summary>
......
......@@ -5,17 +5,20 @@
namespace Performance.DtoModels
{
public class SecondEmpRequest
public class SecondEmployeeRequest
{
public int TempId { get; set; }
public int SecondId { get; set; }
public string EmployeeName { get; set; }
public string JobNumber { get; set; }
}
public class SecondEmpRequest : SecondEmployeeRequest
{
public int TempId { get; set; }
public int SecondId { get; set; }
}
public class SecondEmpRequestValidator : AbstractValidator<SecondEmpRequest>
{
public SecondEmpRequestValidator()
......
......@@ -351,9 +351,9 @@ private ag_secondallot GetPreviousSecondAllot(int hospitalId, ag_secondallot sec
/// 二次绩效分配录入人员自动补全信息
/// </summary>
/// <param name="secodId"></param>
/// <param name="workNumber">工号</param>
/// <param name="request">工号、姓名</param>
/// <returns></returns>
public JArray AutoComplete(int secodId, string workNumber)
public JArray AutoComplete(int secodId, SecondEmployeeRequest request)
{
var second = agsecondallotRepository.GetEntity(t => t.Id == secodId);
if (second == null)
......@@ -367,8 +367,14 @@ public JArray AutoComplete(int secodId, string workNumber)
if (usetemp == null)
throw new PerformanceException("当前科室暂未配置绩效模板");
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allot.ID && !string.IsNullOrEmpty(t.PersonnelNumber) && t.PersonnelNumber.IndexOf(workNumber) > -1)
?.OrderBy(t => t.PersonnelNumber).ThenByDescending(t => t.DoctorName).ToList();
var employees = personService.GetPerEmployee(second.AllotId.Value);
if (!string.IsNullOrEmpty(request?.EmployeeName))
employees = employees?.Where(w => w.DoctorName?.Trim() == request?.EmployeeName?.Trim()).ToList();
if (!string.IsNullOrEmpty(request?.JobNumber))
employees = employees?.Where(w => w.PersonnelNumber.Trim() == request?.JobNumber.Trim()).ToList();
employees = employees?.OrderBy(t => t.PersonnelNumber).ThenByDescending(t => t.DoctorName).ToList();
if (employees == null || !employees.Any()) return new JArray();
var bodysources = new List<ag_bodysource>();
......
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