审核调整

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