Commit 4d55acf9 by Licx

修改提交获取列表接口

parent 1390990c
......@@ -268,12 +268,12 @@ public ApiResponse Audit(int allotid)
/// <returns></returns>
[Route("apr/getlist")]
[HttpPost]
public ApiResponse GetAprList([FromBody] AllotIdRequest request)
public ApiResponse GetAprList([FromBody] per_apr_amount request)
{
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = employeeService.GetAprList(request.AllotId, claim.GetUserId());
var employee = employeeService.GetAprByTypeInDepartment(request.AllotId, request.TypeInDepartment);
return new ApiResponse(ResponseType.OK, "ok", employee);
}
......@@ -398,12 +398,12 @@ public ApiResponse DeleteApr([FromBody] IdRequest request)
/// <returns></returns>
[HttpPost]
[Route("apr/commit")]
public ApiResponse CommitResult([FromBody] AprAmountAuditRequest request)
public ApiResponse CommitResult([FromBody] per_apr_amount request)
{
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var result = employeeService.CommitApr(request.AllotId, claim.GetUserId(), request.IsPass);
var result = employeeService.CommitApr(request.AllotId, request.TypeInDepartment, request.Status ?? 1);
return new ApiResponse(ResponseType.OK);
}
......@@ -540,6 +540,18 @@ public ApiResponse AprOverview(int allotId)
});
return new ApiResponse(ResponseType.OK, "ok", result);
}
/// <summary>
/// 清理该科室录入数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("apr/clear")]
public ApiResponse<List<TitleValue>> ClearAprData([FromBody] per_apr_amount request)
{
var result = employeeService.ClearAprData(request);
return new ApiResponse<List<TitleValue>>(ResponseType.OK, "删除成功");
}
#endregion
/// <summary>
......@@ -587,12 +599,12 @@ public ApiResponse GetDeptAssessment(int allotId)
/// <returns></returns>
[Route("apr/hide/getlist")]
[HttpPost]
public ApiResponse GetAprHideList([FromBody] AllotIdRequest request)
public ApiResponse GetAprHideList([FromBody] per_apr_amount request)
{
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var employee = employeeService.GetAprHideList(request.AllotId, claim.GetUserId());
var employee = employeeService.GetAprHideByTypeInDepartment(request.AllotId, request.TypeInDepartment);
return new ApiResponse(ResponseType.OK, "ok", employee);
}
......@@ -717,12 +729,12 @@ public ApiResponse DeleteAprHide([FromBody] IdRequest request)
/// <returns></returns>
[HttpPost]
[Route("apr/hide/commit")]
public ApiResponse CommitResultHide([FromBody] AprAmountAuditRequest request)
public ApiResponse CommitResultHide([FromBody] per_apr_amount request)
{
if (request.AllotId == 0)
return new ApiResponse(ResponseType.ParameterError, "参数AllotId无效!");
var result = employeeService.CommitAprHide(request.AllotId, claim.GetUserId(), request.IsPass);
var result = employeeService.CommitAprHide(request.AllotId, request.TypeInDepartment, request.Status ?? 1);
return new ApiResponse(ResponseType.OK);
}
......@@ -848,6 +860,18 @@ public ApiResponse AprHideOverview(int allotId)
});
return new ApiResponse(ResponseType.OK, "ok", result);
}
/// <summary>
/// 清理该科室录入不公示数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("apr/hide/clear")]
public ApiResponse<List<TitleValue>> ClearAprHideData([FromBody] per_apr_amount request)
{
var result = employeeService.ClearAprHideData(request);
return new ApiResponse<List<TitleValue>>(ResponseType.OK, "删除成功");
}
#endregion
/// <summary>
......
......@@ -489,7 +489,7 @@ public bool InsertApr(per_apr_amount request, int userId)
throw new PerformanceException("工号在字典中不存在");
request.TypeInDepartment = GetTypeInDepartment(userId);
request.Status = 2;
request.Status = 1;
request.CreateDate = DateTime.Now;
request.CreateUser = userId;
return perapramountRepository.Add(request);
......@@ -513,7 +513,7 @@ public bool UpdateApr(per_apr_amount request)
if (data == null)
throw new PerformanceException("修改数据无效");
data.Status = 2;
data.Status = 1;
data.PersonnelNumber = request.PersonnelNumber;
data.DoctorName = request.DoctorName;
data.PerforType = request.PerforType;
......@@ -542,11 +542,12 @@ public bool DeleteApr(int id)
/// 提交、撤销医院其他绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="userId"></param>
/// <param name="department">录入科室</param>
/// <param name="department"></param>
/// <returns></returns>
public bool CommitApr(int allotId, int userId, int status)
public bool CommitApr(int allotId, string department, int status)
{
var list = GetAprList(allotId, userId);
var list = GetAprByTypeInDepartment(allotId, department);
if (list == null) return true;
list.ForEach(t => t.Status = status);
......@@ -636,15 +637,13 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
var userrole = userroleRepository.GetEntity(t => t.UserID == userid);
if (userrole == null) throw new PerformanceException("用户未绑定角色");
//var data = new List<per_apr_amount>();
//var roles = new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 };
//if (roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办查看所有科室的数据
// data = perapramountRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0);
//else
// data = perapramountRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0 && t.CreateUser == userid);
//if (data != null && data.Any())
// perapramountRepository.RemoveRange(data.ToArray());
var typeIn = GetTypeInDepartment(userid);
var data = perapramountRepository.GetEntities(t => t.AllotId == allotid && t.TypeInDepartment == typeIn);
if (data != null && data.Any())
{
data.ForEach(t => t.Status = 1);
perapramountRepository.UpdateRange(data.ToArray());
}
try
{
......@@ -685,7 +684,6 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
var entities = new List<per_apr_amount>();
var createtime = DateTime.Now;
var typeIn = GetTypeInDepartment(userid);
var employees = peremployeeRepository.GetEntities(t => t.AllotId == allotid);
for (int rowindex = 1; rowindex < sheet.LastRowNum + 1; rowindex++)
......@@ -695,7 +693,7 @@ public string ImpoerAprEmployees(int allotid, string path, int userid)
var entity = new per_apr_amount
{
Status = 2,
Status = 1,
PersonnelNumber = dict["人员工号"] < 0 ? "" : row.GetCell(dict["人员工号"]).GetValue(),
DoctorName = dict["姓名"] < 0 ? "" : row.GetCell(dict["姓名"]).GetValue(),
PerforType = dict["绩效类型"] < 0 ? "" : row.GetCell(dict["绩效类型"]).GetValue(),
......@@ -959,7 +957,7 @@ public bool InsertAprHide(per_apr_amount_hide request, int userId)
throw new PerformanceException("工号在字典中不存在");
request.TypeInDepartment = GetTypeInDepartment(userId);
request.Status = 2;
request.Status = 1;
request.CreateDate = DateTime.Now;
request.CreateUser = userId;
return _hideRepository.Add(request);
......@@ -983,7 +981,7 @@ public bool UpdateAprHide(per_apr_amount_hide request)
if (data == null)
throw new PerformanceException("修改数据无效");
data.Status = 2;
data.Status = 1;
data.PersonnelNumber = request.PersonnelNumber;
data.DoctorName = request.DoctorName;
data.PerforType = request.PerforType;
......@@ -1015,9 +1013,9 @@ public bool DeleteAprHide(int id)
/// <param name="userId"></param>
/// <param name="status"></param>
/// <returns></returns>
public bool CommitAprHide(int allotId, int userId, int status)
public bool CommitAprHide(int allotId, string department, int status)
{
var list = GetAprHideList(allotId, userId);
var list = GetAprHideByTypeInDepartment(allotId, department);
if (list == null) return true;
list.ForEach(t => t.Status = status);
......@@ -1107,15 +1105,13 @@ public void ImpoerAprHideEmployees(int allotid, string path, int userid)
var userrole = userroleRepository.GetEntity(t => t.UserID == userid);
if (userrole == null) throw new PerformanceException("用户未绑定角色");
//var data = new List<per_apr_amount_hide>();
//var roles = new int[] { (int)Role.绩效管理员, (int)Role.医院管理员, (int)Role.绩效核算办, (int)Role.院领导, (int)Role.审计 };
//if (roles.Contains(userrole.RoleID)) // 绩效管理员、医院管理员、绩效核算办查看所有科室的数据
// data = _hideRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0);
//else
// data = _hideRepository.GetEntities(t => t.AllotId == allotid && (t.Amount ?? 0) != 0 && t.CreateUser == userid);
//if (data != null && data.Any())
// _hideRepository.RemoveRange(data.ToArray());
var typeIn = GetTypeInDepartment(userid);
var data = _hideRepository.GetEntities(t => t.AllotId == allotid && t.TypeInDepartment == typeIn);
if (data != null && data.Any())
{
data.ForEach(t => t.Status = 1);
_hideRepository.UpdateRange(data.ToArray());
}
try
{
......@@ -1156,7 +1152,6 @@ public void ImpoerAprHideEmployees(int allotid, string path, int userid)
var entities = new List<per_apr_amount_hide>();
var createtime = DateTime.Now;
var typeIn = GetTypeInDepartment(userid);
for (int rowindex = 1; rowindex < sheet.LastRowNum + 1; rowindex++)
{
var row = sheet.GetRow(rowindex);
......@@ -1164,7 +1159,7 @@ public void ImpoerAprHideEmployees(int allotid, string path, int userid)
var entity = new per_apr_amount_hide
{
Status = 2,
Status = 1,
PersonnelNumber = dict["人员工号"] < 0 ? "" : row.GetCell(dict["人员工号"]).GetValue(),
DoctorName = dict["姓名"] < 0 ? "" : row.GetCell(dict["姓名"]).GetValue(),
PerforType = dict["绩效类型"] < 0 ? "" : row.GetCell(dict["绩效类型"]).GetValue(),
......@@ -1879,6 +1874,56 @@ public void AuditGather(List<Gather> gather)
_service.SyncDataToResult(gatherFirst.AllotId);
}
}
/// <summary>
/// 清理该科室录入数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool ClearAprData(per_apr_amount request)
{
var data = perapramountRepository.GetEntities(t => t.AllotId == request.AllotId && t.TypeInDepartment == request.TypeInDepartment);
if (data == null || !data.Any()) return true;
return perapramountRepository.RemoveRange(data.ToArray());
}
/// <summary>
/// 清理该科室录入不公示数据
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
public bool ClearAprHideData(per_apr_amount request)
{
var data = _hideRepository.GetEntities(t => t.AllotId == request.AllotId && t.TypeInDepartment == request.TypeInDepartment);
if (data == null || !data.Any()) return true;
return _hideRepository.RemoveRange(data.ToArray());
}
/// <summary>
/// 根据录入科室获取其他绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="department">录入科室</param>
/// <returns></returns>
public List<per_apr_amount> GetAprByTypeInDepartment(int allotId, string department)
{
var data = perapramountRepository.GetEntities(t => t.AllotId == allotId && t.TypeInDepartment == department);
return data;
}
/// <summary>
/// 根据录入科室获取不公示其他绩效
/// </summary>
/// <param name="allotId"></param>
/// <param name="department">录入科室</param>
/// <returns></returns>
public List<per_apr_amount_hide> GetAprHideByTypeInDepartment(int allotId, string department)
{
var data = _hideRepository.GetEntities(t => t.AllotId == allotId && t.TypeInDepartment == department);
return data;
}
}
public class ComparisonConfig
......
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