Commit f0eef106 by ruyun.zhang

自动补全带出人员系数

parent c23e0d4e
...@@ -612,10 +612,22 @@ public ApiResponse<List<TitleValue>> ClearAprData([FromBody] AprAmountAuditReque ...@@ -612,10 +612,22 @@ public ApiResponse<List<TitleValue>> ClearAprData([FromBody] AprAmountAuditReque
/// <param name="request"></param> /// <param name="request"></param>
/// <returns></returns> /// <returns></returns>
[HttpPost("autocomplate")] [HttpPost("autocomplate")]
public ApiResponse<List<view_per_apr_amount>> GetEmployeeMessage([FromBody] per_apr_amount request) public ApiResponse<List<AutocomplateEmployeeResponse>> GetEmployeeMessage([FromBody] per_apr_amount request)
{ {
var result = employeeService.GetEmployeeMessage(request.AllotId, request.PersonnelNumber, request.DoctorName, claim.GetUserId()); var userId = claim.GetUserId();
return new ApiResponse<List<view_per_apr_amount>>(ResponseType.OK, "人员信息", result); var user = userService.GetUserIdentity(userId);
var result = employeeService.GetEmployeeMessage(request.AllotId, request.PersonnelNumber, request.DoctorName, userId);
var res = result.Select(t => new AutocomplateEmployeeResponse
{
AllotId = request.AllotId,
PersonnelNumber = t.PersonnelNumber,
DoctorName = t.DoctorName,
TypeInDepartment = user.Department,
AccountingUnit = t.AccountingUnit,
PermanentStaff = t.PermanentStaff,
}).ToList();
return new ApiResponse<List<AutocomplateEmployeeResponse>>(ResponseType.OK, "人员信息", res);
} }
/// <summary> /// <summary>
...@@ -1193,10 +1205,10 @@ public ApiResponse<List<per_apr_amount_type>> GetAprTypeList([FromRoute] int all ...@@ -1193,10 +1205,10 @@ public ApiResponse<List<per_apr_amount_type>> GetAprTypeList([FromRoute] int all
[HttpPost] [HttpPost]
public ApiResponse<AprTypeRequest> InsertAprType([FromBody] AprTypeRequest request) public ApiResponse<AprTypeRequest> InsertAprType([FromBody] AprTypeRequest request)
{ {
var createUser = claim.GetUserId(); var createUser = claim.GetUserId();
return employeeService.InsertAprType(createUser, request); return employeeService.InsertAprType(createUser, request);
} }
/// <summary> /// <summary>
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Performance.DtoModels.Response
{
public class AutocomplateEmployeeResponse
{
/// <summary>
///
/// </summary>
public int AllotId { get; set; }
/// <summary>
/// 人员工号
/// </summary>
public string PersonnelNumber { get; set; }
/// <summary>
/// 医生姓名
/// </summary>
public string DoctorName { get; set; }
/// <summary>
/// 录入科室
/// </summary>
public string TypeInDepartment { get; set; }
/// <summary>
/// 核算单元
/// </summary>
public string AccountingUnit { get; set; }
/// <summary>
/// 人员系数
/// </summary>
public decimal? PermanentStaff { get; set; }
}
}
...@@ -959,7 +959,7 @@ public ApiResponse<AprTypeRequest> UpdateAprType(int typeId, AprTypeRequest requ ...@@ -959,7 +959,7 @@ public ApiResponse<AprTypeRequest> UpdateAprType(int typeId, AprTypeRequest requ
{ {
if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0) if (string.IsNullOrEmpty(request.PerforType.Trim()) || request.AllotId <= 0)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能为空!"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "输入参数不能为空!");
var tepm = perAprAmountTypeRepository.GetEntity(t =>t.Id!=t.Id && t.AllotId == request.AllotId && t.PerforType == request.PerforType); var tepm = perAprAmountTypeRepository.GetEntity(t => t.Id != t.Id && t.AllotId == request.AllotId && t.PerforType == request.PerforType);
if (tepm != null) if (tepm != null)
return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型"); return new ApiResponse<AprTypeRequest>(ResponseType.ParameterError, "已存在该类型");
var res = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId); var res = perAprAmountTypeRepository.GetEntity(t => t.Id == typeId);
...@@ -996,9 +996,9 @@ public ApiResponse DeleteAprType(int typeId) ...@@ -996,9 +996,9 @@ public ApiResponse DeleteAprType(int typeId)
/// <param name="doctorName"></param> /// <param name="doctorName"></param>
/// <param name="userId"></param> /// <param name="userId"></param>
/// <returns></returns> /// <returns></returns>
public List<view_per_apr_amount> GetEmployeeMessage(int allotId, string personnelNumber, string doctorName, int userId) public List<per_employee> GetEmployeeMessage(int allotId, string personnelNumber, string doctorName, int userId)
{ {
if (string.IsNullOrEmpty(personnelNumber) && string.IsNullOrEmpty(doctorName)) return new List<view_per_apr_amount>(); if (string.IsNullOrEmpty(personnelNumber) && string.IsNullOrEmpty(doctorName)) return new List<per_employee>();
var user = userRepository.GetEntity(w => w.ID == userId && w.IsDelete == 1); var user = userRepository.GetEntity(w => w.ID == userId && w.IsDelete == 1);
if (user == null) throw new PerformanceException("操作用户不存在或用户信息错误!"); if (user == null) throw new PerformanceException("操作用户不存在或用户信息错误!");
...@@ -1007,8 +1007,7 @@ public List<view_per_apr_amount> GetEmployeeMessage(int allotId, string personne ...@@ -1007,8 +1007,7 @@ public List<view_per_apr_amount> GetEmployeeMessage(int allotId, string personne
var employeeId = 0; var employeeId = 0;
if (!string.IsNullOrEmpty(personnelNumber)) if (!string.IsNullOrEmpty(personnelNumber))
{ {
var employee = peremployeeRepository.GetEntity(w => w.AllotId == allotId && w.PersonnelNumber != null var employee = peremployeeRepository.GetEntity(w => w.AllotId == allotId && w.PersonnelNumber != null && w.PersonnelNumber.Trim() == personnelNumber.Trim());
&& w.PersonnelNumber.Trim() == personnelNumber.Trim());
if (employee != null) if (employee != null)
{ {
employees.Add(employee); employees.Add(employee);
...@@ -1022,18 +1021,8 @@ public List<view_per_apr_amount> GetEmployeeMessage(int allotId, string personne ...@@ -1022,18 +1021,8 @@ public List<view_per_apr_amount> GetEmployeeMessage(int allotId, string personne
&& w.DoctorName.Trim().Contains(doctorName.Trim()) && w.Id != employeeId); && w.DoctorName.Trim().Contains(doctorName.Trim()) && w.Id != employeeId);
if (filterEmployees != null && filterEmployees.Any()) employees.AddRange(filterEmployees); if (filterEmployees != null && filterEmployees.Any()) employees.AddRange(filterEmployees);
} }
if (employees == null || !employees.Any()) return employees ?? new List<per_employee>();
return new List<view_per_apr_amount>();
return employees.Select(t => new view_per_apr_amount
{
AllotId = allotId,
PersonnelNumber = t.PersonnelNumber,
DoctorName = t.DoctorName,
TypeInDepartment = user.Department,
AccountingUnit = t.AccountingUnit
}).ToList();
} }
/// <summary> /// <summary>
......
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