Commit c5bc9ba5 by wyc

绩效考核模块(指标修改条件优化)

parent cc590084
...@@ -105,7 +105,7 @@ public ApiResponse CategoryUpdate(UpdateAssessCategoryRequest request, int useri ...@@ -105,7 +105,7 @@ public ApiResponse CategoryUpdate(UpdateAssessCategoryRequest request, int useri
throw new PerformanceException("当前绩效记录不存在"); throw new PerformanceException("当前绩效记录不存在");
var any = perforPerAssessCategoryRepository.GetEntity(w => w.Id == request.CategoryId); var any = perforPerAssessCategoryRepository.GetEntity(w => w.Id == request.CategoryId);
if (any == null) if (any == null)
throw new PerformanceException("当前操作错误,请刷新后重试"); throw new PerformanceException("暂无数据,请刷新后重试");
any.AllotId = request.AllotId; any.AllotId = request.AllotId;
any.AssessName = request.Category; any.AssessName = request.Category;
any.UpdateBy = userid; any.UpdateBy = userid;
...@@ -122,7 +122,7 @@ public ApiResponse CategoryDelete(BatchAssessCategoryRequest request) ...@@ -122,7 +122,7 @@ public ApiResponse CategoryDelete(BatchAssessCategoryRequest request)
throw new PerformanceException("请先删除类别下的方案"); throw new PerformanceException("请先删除类别下的方案");
var any = perforPerAssessCategoryRepository.GetEntities(w => request.CategoryId.Contains(w.Id)); var any = perforPerAssessCategoryRepository.GetEntities(w => request.CategoryId.Contains(w.Id));
if (any == null) if (any == null)
throw new PerformanceException("当前操作错误,请刷新后重试"); throw new PerformanceException("暂无数据,请刷新后重试");
if (perforPerAssessCategoryRepository.RemoveRange(any.ToArray())) if (perforPerAssessCategoryRepository.RemoveRange(any.ToArray()))
return new ApiResponse(ResponseType.OK, "删除成功"); return new ApiResponse(ResponseType.OK, "删除成功");
else return new ApiResponse(ResponseType.Fail, "删除失败"); else return new ApiResponse(ResponseType.Fail, "删除失败");
...@@ -513,7 +513,7 @@ public ApiResponse<UpdateAssessSchemeItemsRequest> SchemeItemsUpdate(UpdateAsses ...@@ -513,7 +513,7 @@ public ApiResponse<UpdateAssessSchemeItemsRequest> SchemeItemsUpdate(UpdateAsses
if (cofAccounting == null) if (cofAccounting == null)
throw new PerformanceException("当前的核算组别或者核算单元错误"); throw new PerformanceException("当前的核算组别或者核算单元错误");
var categoryData = perforPerAssessSchemeItemsRepository.GetEntities(); var categoryData = perforPerAssessSchemeItemsRepository.GetEntities();
var temp = categoryData.FirstOrDefault(w => w.SchemeId == request.SchemeId && w.ItemName2 == request.ItemName2); var temp = categoryData.FirstOrDefault(w => w.SchemeId == request.SchemeId && w.ItemName2 == request.ItemName2 && w.Id != request.SchemeItemsId);
if (temp != null) if (temp != null)
throw new PerformanceException("当前指标已存在"); throw new PerformanceException("当前指标已存在");
var any = perforPerAssessSchemeItemsRepository.GetEntity(w => w.AllotId == request.AllotId && w.Id == request.SchemeItemsId); var any = perforPerAssessSchemeItemsRepository.GetEntity(w => w.AllotId == request.AllotId && w.Id == request.SchemeItemsId);
......
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