审核调整

parent 0c18ca8a
......@@ -283,9 +283,9 @@ public ApiResponse GetAprGroupList([FromBody] per_apr_amount request)
if (employee == null || !employee.Any())
return new ApiResponse(ResponseType.OK, "ok", employee);
var result = employee.GroupBy(t => new { AccountingUnit = t.AccountingUnit ?? "", TypeInDepartment = t.TypeInDepartment ?? "" }).Select(t => new per_apr_amount
var result = employee.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "" })
.Select(t => new per_apr_amount
{
AccountingUnit = t.Key.AccountingUnit,
TypeInDepartment = t.Key.TypeInDepartment,
Amount = t.Sum(s => s.Amount ?? 0),
Status = t.Any(s => s.Status == 2) ? 2 : t.Any(s => s.Status == 4) ? 4 : t.FirstOrDefault().Status,
......@@ -305,14 +305,15 @@ public ApiResponse GetAprDetail([FromBody] per_apr_amount request)
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = employeeService.GetAprList(request.AllotId, request.AccountingUnit, request.TypeInDepartment);
var employee = employeeService.GetAprList(request.AllotId, request.TypeInDepartment);
if (employee == null || !employee.Any())
return new ApiResponse(ResponseType.OK, "ok", employee);
var result = employee.GroupBy(t => new { t.PersonnelNumber, t.DoctorName }).Select(t => new
var result = employee.GroupBy(t => new { t.AccountingUnit, t.PersonnelNumber, t.DoctorName }).Select(t => new
{
PersonnelNumber = t.Key.PersonnelNumber,
DoctorName = t.Key.DoctorName,
AccountingUnit = t.Key.AccountingUnit,
Status = t.Any(s => s.Status == 2) ? 2 : t.Any(s => s.Status == 4) ? 4 : t.FirstOrDefault().Status,
Detail = t.GroupBy(group => group.PerforType).Select(s => new TitleValue<decimal>
{
......
......@@ -1715,8 +1715,8 @@
路径
</summary>
</member>
<member name="P:Performance.DtoModels.AprAmountAuditRequest.Id">
<summary> 二次绩效Id </summary>
<member name="P:Performance.DtoModels.AprAmountAuditRequest.AllotId">
<summary> 绩效ID </summary>
</member>
<member name="P:Performance.DtoModels.AprAmountAuditRequest.IsPass">
<summary> 审核结果 1、审核通过 2、驳回 </summary>
......
......@@ -5298,6 +5298,11 @@
是否开启行政后勤二次绩效分配 1 启用 2 禁用
</summary>
</member>
<member name="P:Performance.EntityModels.sys_hospital.IsSingleProject">
<summary>
抽取项目是否在同一环境 1 是 2 否
</summary>
</member>
<member name="T:Performance.EntityModels.sys_hospitalconfig">
<summary>
......
......@@ -7,16 +7,16 @@ namespace Performance.DtoModels
{
public class AprAmountAuditRequest
{
/// <summary> 二次绩效Id </summary>
public int[] Id { get; set; }
public class Member
{
public string PersonnelNumber { get; set; }
public string DoctorName { get; set; }
}
/// <summary> 绩效ID </summary>
public int AllotId { get; set; }
public List<Member> Members { get; set; }
/// <summary> 审核结果 1、审核通过 2、驳回 </summary>
public int IsPass { get; set; }
/// <summary> 备注 </summary>
public string Remark { get; set; }
}
......
......@@ -383,9 +383,9 @@ public List<per_apr_amount> GetAprList(int allotId)
return list;
}
public List<per_apr_amount> GetAprList(int allotId, string accountingUnit, string department)
public List<per_apr_amount> GetAprList(int allotId, string department)
{
var list = perapramountRepository.GetEntities(t => t.AllotId == allotId && (t.Amount ?? 0) != 0 && (t.AccountingUnit ?? "") == accountingUnit && (t.TypeInDepartment ?? "") == department);
var list = perapramountRepository.GetEntities(t => t.AllotId == allotId && (t.Amount ?? 0) != 0 && (t.TypeInDepartment ?? "") == department);
if (list != null && list.Any())
list = list.OrderBy(t => t.DoctorName).ToList();
......@@ -443,19 +443,32 @@ public bool DeleteApr(int id)
/// <returns></returns>
public bool ConfirmAudit(int userid, AprAmountAuditRequest request)
{
if (string.IsNullOrEmpty(request.DoctorName) && string.IsNullOrEmpty(request.PersonnelNumber))
if (request?.Members == null)
throw new PerformanceException("审核信息无效,请确认");
foreach (var item in request.Members)
{
if (string.IsNullOrEmpty(item.DoctorName) && string.IsNullOrEmpty(item.PersonnelNumber))
throw new PerformanceException("审核信息无效,请确认");
}
var allApramounts = perapramountRepository.GetEntities(t => t.AllotId == request.AllotId);
foreach (var member in request.Members)
{
var apramounts = allApramounts?.Where(t => (t.DoctorName ?? "") == member.DoctorName && (t.PersonnelNumber ?? "") == member.PersonnelNumber);
if (apramounts == null)
throw new PerformanceException("审核信息无效,请确认");
var apramounts = perapramountRepository.GetEntities(t => (t.DoctorName ?? "") == request.DoctorName && (t.PersonnelNumber ?? "") == request.PersonnelNumber);
foreach (var item in apramounts)
{
item.Status = (request.IsPass == 1) ? 3 : 4;
item.AuditUser = userid;
item.AuditTime = DateTime.Now;
item.Remark = request.Remark;
perapramountRepository.UpdateRange(apramounts.ToArray());
}
return perapramountRepository.UpdateRange(apramounts.ToArray());
}
return true;
}
public void ImpoerAprEmployees(int allotid, string path, int userid)
......
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