Commit e3eed673 by 纪旭 韦

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

parent e8c37b1d
......@@ -291,24 +291,7 @@ public ApiResponse GetAprGroupList([FromRoute] int isAudit, [FromBody] AllotIdRe
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = 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();
var result = employeeService.GetAprList(request.AllotId, claim.GetUserId(), isAudit);
return new ApiResponse(ResponseType.OK, "ok", result);
}
......@@ -322,9 +305,9 @@ public ApiResponse GetAprGroupList([FromRoute] int isAudit, [FromBody] AllotIdRe
public ApiResponse SubmitDeptList([FromBody] SubmitAmountRequest request)
{
if (employeeService.SubmitDeptList(request))
return new ApiResponse(ResponseType.OK,"提交成功");
return new ApiResponse(ResponseType.OK, "提交成功");
else
return new ApiResponse(ResponseType.Fail,"提交失败");
return new ApiResponse(ResponseType.Fail, "提交失败");
}
/// <summary>
/// 医院其他绩效审核详情
......@@ -647,24 +630,7 @@ public ApiResponse GetAprHideGroupList([FromRoute] int isAudit, [FromBody] Allot
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = 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();
var result = employeeService.GetAprHideList(request.AllotId, claim.GetUserId(), isAudit);
return new ApiResponse(ResponseType.OK, "ok", result);
}
......
......@@ -38,7 +38,7 @@ public class SubmitAmountRequest
{
public int AllotId { get; set; }
public string TypeInDepartment { get; set; }
public string PerforType { get; set; }
public string CreateDate { get; set; }
public string Remark { get; set; }
}
}
......@@ -74,7 +74,7 @@ public class per_apr_amount
/// <summary>
///
/// </summary>
public DateTime CreateDate { get; set; }
public DateTime? CreateDate { get; set; }
/// <summary>
///
......
......@@ -69,7 +69,7 @@ public class per_apr_amount_hide
/// <summary>
///
/// </summary>
public DateTime CreateDate { get; set; }
public DateTime? CreateDate { get; set; }
/// <summary>
///
......
......@@ -5,6 +5,7 @@
using NPOI.SS.UserModel;
using NPOI.XSSF.UserModel;
using Performance.DtoModels;
using Performance.DtoModels.Response;
using Performance.EntityModels;
using Performance.Infrastructure;
using Performance.Repository;
......@@ -430,7 +431,7 @@ public bool Audit(int allotId)
/// <param name="allotId"></param>
/// <param name="userId"></param>
/// <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);
if (userrole == null) throw new PerformanceException("用户未绑定角色");
......@@ -443,12 +444,39 @@ public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit)
if (isAudit == 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())
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>
......@@ -456,8 +484,8 @@ public List<per_apr_amount> GetAprList(int allotId, int userId, int isAudit)
/// <returns></returns>
public bool SubmitDeptList(SubmitAmountRequest request)
{
string[] perforTypes = request.PerforType.Split("/");
var result = perapramountRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && perforTypes.Contains(w.PerforType));
var createDate = DateTime.Parse(request.CreateDate);
var result = perapramountRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && w.CreateDate == createDate);
result.ForEach(w =>
{
w.Status = 2;
......@@ -921,7 +949,7 @@ public string GetTypeInDepartment(int userId)
/// <param name="allotId"></param>
/// <param name="userId"></param>
/// <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);
if (userrole == null) throw new PerformanceException("用户未绑定角色");
......@@ -934,11 +962,36 @@ public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isA
if (isAudit == 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())
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>
/// 不公示其他绩效提交
......@@ -946,8 +999,8 @@ public List<per_apr_amount_hide> GetAprHideList(int allotId, int userId, int isA
/// <returns></returns>
public bool SubmitHideDeptList(SubmitAmountRequest request)
{
string[] perforTypes = request.PerforType.Split("/");
var result = _hideRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && perforTypes.Contains(w.PerforType));
var createDate = DateTime.Parse(request.CreateDate);
var result = _hideRepository.GetEntities(w => w.AllotId == request.AllotId && w.TypeInDepartment == request.TypeInDepartment && w.CreateDate == createDate);
result.ForEach(w =>
{
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