Commit e3eed673 by 纪旭 韦

医院其他绩效,不公示其他绩效

parent e8c37b1d
...@@ -291,24 +291,7 @@ public ApiResponse GetAprGroupList([FromRoute] int isAudit, [FromBody] AllotIdRe ...@@ -291,24 +291,7 @@ public ApiResponse GetAprGroupList([FromRoute] int isAudit, [FromBody] AllotIdRe
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, claim.GetUserId(), isAudit); var result = employeeService.GetAprList(request.AllotId, claim.GetUserId(), isAudit);
if (employee == null || !employee.Any())
return new ApiResponse(ResponseType.OK, "ok", employee);
var result = employee.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate })
.Select(t => new OhterAmountAuditResponse
{
TypeInDepartment = t.Key.TypeInDepartment,
CreateDate = t.Key.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
Amount = t.Sum(s => s.Amount ?? 0),
Status = t.OrderByDescending(w => w.Id).FirstOrDefault().Status,
PerforType = string.Join("/", t.Select(w => w.PerforType).Distinct()),
AuditTime = t.Any(s => s.Status == 2) ? "" : t.Max(w => w.AuditTime)?.ToString("yyyy-MM-dd HH:mm:ss"),
Remark = t.Any(s => !s.MarkStatus.HasValue) ? "" : $"已审计{t.Max(w => w.MarkTime)?.ToString("(yyyy-MM-dd HH:mm:ss)")}",
ShowCommit = t.FirstOrDefault(t => t.CreateUser.HasValue).CreateUser == claim.GetUserId(),
});
if (result != null && result.Any())
result = result.OrderByDescending(o => o.CreateDate).ToList();
return new ApiResponse(ResponseType.OK, "ok", result); return new ApiResponse(ResponseType.OK, "ok", result);
} }
...@@ -322,9 +305,9 @@ public ApiResponse GetAprGroupList([FromRoute] int isAudit, [FromBody] AllotIdRe ...@@ -322,9 +305,9 @@ public ApiResponse GetAprGroupList([FromRoute] int isAudit, [FromBody] AllotIdRe
public ApiResponse SubmitDeptList([FromBody] SubmitAmountRequest request) public ApiResponse SubmitDeptList([FromBody] SubmitAmountRequest request)
{ {
if (employeeService.SubmitDeptList(request)) if (employeeService.SubmitDeptList(request))
return new ApiResponse(ResponseType.OK,"提交成功"); return new ApiResponse(ResponseType.OK, "提交成功");
else else
return new ApiResponse(ResponseType.Fail,"提交失败"); return new ApiResponse(ResponseType.Fail, "提交失败");
} }
/// <summary> /// <summary>
/// 医院其他绩效审核详情 /// 医院其他绩效审核详情
...@@ -647,24 +630,7 @@ public ApiResponse GetAprHideGroupList([FromRoute] int isAudit, [FromBody] Allot ...@@ -647,24 +630,7 @@ public ApiResponse GetAprHideGroupList([FromRoute] int isAudit, [FromBody] Allot
if (request.AllotId == 0) if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!"); return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = employeeService.GetAprHideList(request.AllotId, claim.GetUserId(), isAudit); var result = employeeService.GetAprHideList(request.AllotId, claim.GetUserId(), isAudit);
if (employee == null || !employee.Any())
return new ApiResponse(ResponseType.OK, "ok", employee);
var result = employee.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate })
.Select(t => new OhterAmountAuditResponse
{
TypeInDepartment = t.Key.TypeInDepartment,
CreateDate = t.Key.CreateDate.ToString("yyyy-MM-dd HH:mm:ss"),
Amount = t.Sum(s => s.Amount ?? 0),
Status = t.OrderByDescending(w => w.Id).FirstOrDefault().Status,
PerforType = string.Join("/", t.Select(w => w.PerforType).Distinct()),
AuditTime = t.Any(s => s.Status == 2) ? "" : t.Max(w => w.AuditTime)?.ToString("yyyy-MM-dd HH:mm:ss"),
Remark = t.Any(s => !s.MarkStatus.HasValue) ? "" : $"已审计{t.Max(w => w.MarkTime)?.ToString("(yyyy-MM-dd HH:mm:ss)")}",
ShowCommit = t.FirstOrDefault(t => t.CreateUser.HasValue).CreateUser == claim.GetUserId(),
});
if (result != null && result.Any())
result = result.OrderByDescending(o => o.CreateDate).ToList();
return new ApiResponse(ResponseType.OK, "ok", result); return new ApiResponse(ResponseType.OK, "ok", result);
} }
......
...@@ -38,7 +38,7 @@ public class SubmitAmountRequest ...@@ -38,7 +38,7 @@ public class SubmitAmountRequest
{ {
public int AllotId { get; set; } public int AllotId { get; set; }
public string TypeInDepartment { get; set; } public string TypeInDepartment { get; set; }
public string PerforType { get; set; } public string CreateDate { get; set; }
public string Remark { get; set; } public string Remark { get; set; }
} }
} }
...@@ -74,7 +74,7 @@ public class per_apr_amount ...@@ -74,7 +74,7 @@ public class per_apr_amount
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime CreateDate { get; set; } public DateTime? CreateDate { get; set; }
/// <summary> /// <summary>
/// ///
......
...@@ -69,7 +69,7 @@ public class per_apr_amount_hide ...@@ -69,7 +69,7 @@ public class per_apr_amount_hide
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
public DateTime CreateDate { get; set; } public DateTime? CreateDate { get; set; }
/// <summary> /// <summary>
/// ///
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
using NPOI.SS.UserModel; using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel; using NPOI.XSSF.UserModel;
using Performance.DtoModels; using Performance.DtoModels;
using Performance.DtoModels.Response;
using Performance.EntityModels; using Performance.EntityModels;
using Performance.Infrastructure; using Performance.Infrastructure;
using Performance.Repository; using Performance.Repository;
...@@ -430,7 +431,7 @@ public bool Audit(int allotId) ...@@ -430,7 +431,7 @@ public bool Audit(int allotId)
/// <param name="allotId"></param> /// <param name="allotId"></param>
/// <param name="userId"></param> /// <param name="userId"></param>
/// <returns></returns> /// <returns></returns>
public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit) public List<OhterAmountAuditResponse> GetAprList(int allotId, int userId, int isAudit)
{ {
var userrole = userroleRepository.GetEntity(t => t.UserID == userId); var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
if (userrole == null) throw new PerformanceException("用户未绑定角色"); if (userrole == null) throw new PerformanceException("用户未绑定角色");
...@@ -443,12 +444,39 @@ public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit) ...@@ -443,12 +444,39 @@ public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit)
if (isAudit == 1) if (isAudit == 1)
expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1)); expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1));
var list = perapramountRepository.GetEntities(expression); var list = perapramountRepository.GetEntities(expression) ?? new List<per_apr_amount>();
if (list != null && list.Any()) if (list != null && list.Any())
list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList(); list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList();
return list; var result = list.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate })
.Select(t =>
{
string createDate = "";
if (t.Key.CreateDate != null)
createDate = t.Key.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
var status = t.OrderByDescending(w => w.Id).FirstOrDefault()?.Status ?? 0;
var perforTypes = string.Join("/", t.Select(w => w.PerforType).Distinct());
if (perforTypes.Length > 10) perforTypes = perforTypes.Substring(0, 10) + "……";
return new OhterAmountAuditResponse
{
TypeInDepartment = t.Key.TypeInDepartment,
CreateDate = createDate,
Amount = t.Sum(s => s.Amount ?? 0),
Status = status,
PerforType = perforTypes,
AuditTime = t.Any(s => s.Status == 2) ? "" : t.Max(w => w.AuditTime)?.ToString("yyyy-MM-dd HH:mm:ss"),
Remark = t.Any(s => !s.MarkStatus.HasValue) ? "" : $"已审计{t.Max(w => w.MarkTime)?.ToString("(yyyy-MM-dd HH:mm:ss)")}",
ShowCommit = (new int[] { 1, 4 }).Contains(status) && t.FirstOrDefault(t => t.CreateUser.HasValue).CreateUser == userId,
};
});
if (result != null && result.Any())
result = result.OrderByDescending(o => o.CreateDate).ToList();
return result.ToList();
} }
/// <summary> /// <summary>
/// 医院其他绩效提交 /// 医院其他绩效提交
/// </summary> /// </summary>
...@@ -456,8 +484,8 @@ public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit) ...@@ -456,8 +484,8 @@ public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit)
/// <returns></returns> /// <returns></returns>
public bool SubmitDeptList(SubmitAmountRequest request) public bool SubmitDeptList(SubmitAmountRequest request)
{ {
string[] perforTypes = request.PerforType.Split("/"); var createDate = DateTime.Parse(request.CreateDate);
var result = perapramountRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && perforTypes.Contains(w.PerforType)); var result = perapramountRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && w.CreateDate == createDate);
result.ForEach(w => result.ForEach(w =>
{ {
w.Status = 2; w.Status = 2;
...@@ -921,7 +949,7 @@ public string GetTypeInDepartment(int userId) ...@@ -921,7 +949,7 @@ public string GetTypeInDepartment(int userId)
/// <param name="allotId"></param> /// <param name="allotId"></param>
/// <param name="userId"></param> /// <param name="userId"></param>
/// <returns></returns> /// <returns></returns>
public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isAudit) public List<OhterAmountAuditResponse> GetAprHideList(int allotId, int userId, int isAudit)
{ {
var userrole = userroleRepository.GetEntity(t => t.UserID == userId); var userrole = userroleRepository.GetEntity(t => t.UserID == userId);
if (userrole == null) throw new PerformanceException("用户未绑定角色"); if (userrole == null) throw new PerformanceException("用户未绑定角色");
...@@ -934,11 +962,36 @@ public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isA ...@@ -934,11 +962,36 @@ public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isA
if (isAudit == 1) if (isAudit == 1)
expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1)); expression = expression.And(t => new int[] { 2, 3 }.Contains(t.Status ?? 1));
var list = _hideRepository.GetEntities(expression); var list = _hideRepository.GetEntities(expression) ?? new List<per_apr_amount_hide>();
if (list != null && list.Any()) if (list != null && list.Any())
list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList(); list = list.OrderBy(w => w.IsVerify).ThenBy(t => t.DoctorName).ToList();
return list; var result = list.GroupBy(t => new { TypeInDepartment = t.TypeInDepartment ?? "", t.CreateDate })
.Select(t =>
{
string createDate = "";
if (t.Key.CreateDate != null)
createDate = t.Key.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss");
var status = t.OrderByDescending(w => w.Id).FirstOrDefault()?.Status ?? 0;
var perforTypes = string.Join("/", t.Select(w => w.PerforType).Distinct());
if (perforTypes.Length > 10) perforTypes = perforTypes.Substring(0, 10) + "……";
return new OhterAmountAuditResponse()
{
TypeInDepartment = t.Key.TypeInDepartment,
CreateDate = createDate,
Amount = t.Sum(s => s.Amount ?? 0),
Status = status,
PerforType = perforTypes,
AuditTime = t.Any(s => s.Status == 2) ? "" : t.Max(w => w.AuditTime)?.ToString("yyyy-MM-dd HH:mm:ss"),
Remark = t.Any(s => !s.MarkStatus.HasValue) ? "" : $"已审计{t.Max(w => w.MarkTime)?.ToString("(yyyy-MM-dd HH:mm:ss)")}",
ShowCommit = (new int[] { 1, 4 }).Contains(status) && t.FirstOrDefault(t => t.CreateUser.HasValue).CreateUser == userId,
};
});
if (result != null && result.Any())
result = result.OrderByDescending(o => o.CreateDate).ToList();
return result.ToList();
} }
/// <summary> /// <summary>
/// 不公示其他绩效提交 /// 不公示其他绩效提交
...@@ -946,8 +999,8 @@ public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isA ...@@ -946,8 +999,8 @@ public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isA
/// <returns></returns> /// <returns></returns>
public bool SubmitHideDeptList(SubmitAmountRequest request) public bool SubmitHideDeptList(SubmitAmountRequest request)
{ {
string[] perforTypes = request.PerforType.Split("/"); var createDate = DateTime.Parse(request.CreateDate);
var result = _hideRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && perforTypes.Contains(w.PerforType)); var result = _hideRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && w.CreateDate == createDate);
result.ForEach(w => result.ForEach(w =>
{ {
w.Status = 2; w.Status = 2;
......
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