Commit cd52fcaa by lcx

新增根据工号自动补全功能

parent 8228ebed
......@@ -152,8 +152,8 @@ public ApiResponse SecondDetail([CustomizeValidator(RuleSet = "Refresh"), FromBo
[HttpPost]
public ApiResponse AutoComplete([FromBody] SecondEmpRequest request)
{
//var result = secondAllotService.AutoComplete(request, claimService.GetUserId());
var result = secondAllotService.AutoComplete(request.SecondId, request.JobNumber);
var result = secondAllotService.AutoComplete(request, claimService.GetUserId());
//var result = secondAllotService.AutoComplete(request.SecondId, request.JobNumber);
return new ApiResponse(ResponseType.OK, result);
}
......@@ -517,5 +517,17 @@ public ApiResponse SaveValue([FromRoute] int secondId, [FromBody] dynamic reques
secondAllotService.SaveSecondAllotData(secondId, request);
return new ApiResponse(ResponseType.OK);
}
/// <summary>
/// 二次绩效录入页面自动补全
/// </summary>
/// <returns></returns>
[Route("api/second/autocomplete/{secondId}/{jobNumber}")]
[HttpPost]
public ApiResponse AutoCompleteBodyData([FromRoute] int secondId, string jobNumber)
{
var result = secondAllotService.AutoComplete(secondId, jobNumber);
return new ApiResponse(ResponseType.OK, result);
}
}
}
......@@ -32,11 +32,6 @@ public class ag_workload_source
public int BodyId { get; set; }
/// <summary>
///
/// </summary>
public string UnitType { get; set; }
/// <summary>
/// 工作量考核项ID
/// </summary>
public string ItemId { get; set; }
......
......@@ -316,8 +316,9 @@ private JArray GetBodyResultAfterAudit(int hospitalId, ag_secondallot second, Li
{
int usingTempId = (int)Temp.other;
var usedTemp = agusetempRepository.GetEntity(t => t.HospitalId == hospitalId && t.Department == second.Department && t.UnitType == second.UnitType);
if (usedTemp != null)
if (usedTemp != null && usedTemp.UseTempId.HasValue)
{
usingTempId = usedTemp.UseTempId.Value;
if (IsAudit(second.Status))
usingTempId = (second.UseTempId ?? 0) == 0 ? (int)Temp.other : second.UseTempId.Value;
}
......@@ -413,7 +414,7 @@ public dynamic GetWorkloadDict(int secondId)
var allot = perallotRepository.GetEntity(t => t.ID == second.AllotId);
if (allot == null) throw new PerformanceException("绩效记录不存在!");
var workloads = agworkloadRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType)
var workloads = agworkloadRepository.GetEntities(t => t.HospitalId == allot.HospitalId && t.Department == second.Department && t.UnitType == second.UnitType)
?? new List<ag_workload>();
return workloads.OrderBy(t => t.WorkTypeId).ThenBy(t => t.Sort).Select(t => new
{
......
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