Merge branch 'test' of http://gitlab.fjmaimaimai.com/allied-creation/performance into test
正在显示
1 个修改的文件
包含
15 行增加
和
5 行删除
@@ -1371,6 +1371,16 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | @@ -1371,6 +1371,16 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | ||
1371 | return application.ThrowError(application.TRANSACTION_ERROR, "前面流程暂未完成提交评估内容") | 1371 | return application.ThrowError(application.TRANSACTION_ERROR, "前面流程暂未完成提交评估内容") |
1372 | } | 1372 | } |
1373 | 1373 | ||
1374 | + // 按评估项优先级顺序(已确认考核结果 ->上级评估 ->HR或360评估或自评) | ||
1375 | + _, itemValues, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": result.Id, "limit": 1}) | ||
1376 | + if err != nil { | ||
1377 | + return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
1378 | + } | ||
1379 | + // 如果已经存在考核结果分数,不再进行分数计算(如.超管多次修改员工多次确认) | ||
1380 | + if len(itemValues) > 0 { | ||
1381 | + // do nothing... | ||
1382 | + } else { | ||
1383 | + // 周期内所有评估类型 | ||
1374 | _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ | 1384 | _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ |
1375 | "companyId": result.CompanyId, | 1385 | "companyId": result.CompanyId, |
1376 | "cycleId": result.CycleId, | 1386 | "cycleId": result.CycleId, |
@@ -1393,13 +1403,12 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | @@ -1393,13 +1403,12 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | ||
1393 | var itemList []*domain.EvaluationItemUsed | 1403 | var itemList []*domain.EvaluationItemUsed |
1394 | var itemValues []*domain.SummaryEvaluationValue | 1404 | var itemValues []*domain.SummaryEvaluationValue |
1395 | 1405 | ||
1396 | - // 获取自评模板内容 | 1406 | + // 获取自评模板 |
1397 | _, itemList, err = evaluationItemRepo.Find(map[string]interface{}{"evaluationProjectId": result.EvaluationProjectId, "nodeType": domain.LinkNodeSelfAssessment}) | 1407 | _, itemList, err = evaluationItemRepo.Find(map[string]interface{}{"evaluationProjectId": result.EvaluationProjectId, "nodeType": domain.LinkNodeSelfAssessment}) |
1398 | if err != nil { | 1408 | if err != nil { |
1399 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 1409 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
1400 | } | 1410 | } |
1401 | 1411 | ||
1402 | - // 按评估项优先级顺序(已确认考核结果 ->上级评估 ->HR或360评估或自评) | ||
1403 | if super != nil { | 1412 | if super != nil { |
1404 | _, itemValues, err = itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": super.Id}) // 获取已填写的评估内容 | 1413 | _, itemValues, err = itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": super.Id}) // 获取已填写的评估内容 |
1405 | if err != nil { | 1414 | if err != nil { |
@@ -1420,7 +1429,7 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | @@ -1420,7 +1429,7 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | ||
1420 | } | 1429 | } |
1421 | } | 1430 | } |
1422 | if len(evaluationIds) > 0 { | 1431 | if len(evaluationIds) > 0 { |
1423 | - // 获取已填写的评估内容 | 1432 | + // 已填写的评估内容 |
1424 | _, itemValues, err = itemValueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds}) | 1433 | _, itemValues, err = itemValueRepo.Find(map[string]interface{}{"summaryEvaluationIdList": evaluationIds}) |
1425 | if err != nil { | 1434 | if err != nil { |
1426 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 1435 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
@@ -1442,15 +1451,16 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | @@ -1442,15 +1451,16 @@ func (srv *SummaryEvaluationService) ConfirmScoreEvaluation(param *command.Confi | ||
1442 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 1451 | return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
1443 | } | 1452 | } |
1444 | } | 1453 | } |
1445 | - //重置评级汇总 | 1454 | + // 重置评级汇总 |
1446 | result.TotalRating = nil | 1455 | result.TotalRating = nil |
1447 | for i := range itemList { | 1456 | for i := range itemList { |
1448 | result.ResetTotalRating(itemList[i]) | 1457 | result.ResetTotalRating(itemList[i]) |
1449 | } | 1458 | } |
1450 | - //重新计算总分 | 1459 | + // 计算分数 |
1451 | if err := result.EvaluationTotalScore(itemValues); err != nil { | 1460 | if err := result.EvaluationTotalScore(itemValues); err != nil { |
1452 | return application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 1461 | return application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
1453 | } | 1462 | } |
1463 | + } | ||
1454 | 1464 | ||
1455 | result.CheckResult = domain.EvaluationCheckCompleted | 1465 | result.CheckResult = domain.EvaluationCheckCompleted |
1456 | if err := evaluationRepo.Save(result); err != nil { | 1466 | if err := evaluationRepo.Save(result); err != nil { |
-
请 注册 或 登录 后发表评论