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