|
@@ -249,8 +249,8 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua |
|
@@ -249,8 +249,8 @@ func (srv *SummaryEvaluationService) GetEvaluation360(param *command.QueryEvalua |
249
|
return &itemValuesAdapter, nil
|
249
|
return &itemValuesAdapter, nil
|
250
|
}
|
250
|
}
|
251
|
|
251
|
|
252
|
-// GetEvaluation360All 获取360综评详情-上级综评(所有的评估人,评估内容)
|
|
|
253
|
-func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEvaluation360) (*[]adapter.EvaluationItemAdapter, error) {
|
252
|
+// GetEvaluation360Complete 获取360综评详情(他人评估目标用户)(已完成状态)
|
|
|
253
|
+func (srv *SummaryEvaluationService) GetEvaluation360Complete(param *command.QueryEvaluation360) (*[]adapter.EvaluationItemAdapter, error) {
|
254
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
254
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
255
|
if err != nil {
|
255
|
if err != nil {
|
256
|
return nil, err
|
256
|
return nil, err
|
|
@@ -263,12 +263,13 @@ func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEva |
|
@@ -263,12 +263,13 @@ func (srv *SummaryEvaluationService) GetEvaluation360All(param *command.QueryEva |
263
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
263
|
evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
264
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
264
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
265
|
_, evaluations, err := evaluationRepo.Find(map[string]interface{}{
|
265
|
_, evaluations, err := evaluationRepo.Find(map[string]interface{}{
|
266
|
- "limit": 1,
|
|
|
267
|
"companyId": param.CompanyId,
|
266
|
"companyId": param.CompanyId,
|
268
|
"cycleId": param.CycleId,
|
267
|
"cycleId": param.CycleId,
|
269
|
"targetUserId": param.TargetUserId,
|
268
|
"targetUserId": param.TargetUserId,
|
270
|
- "types": domain.Evaluation360},
|
|
|
271
|
- )
|
269
|
+ "types": domain.Evaluation360,
|
|
|
270
|
+ "status": domain.EvaluationCompleted,
|
|
|
271
|
+ "limit": 99999,
|
|
|
272
|
+ })
|
272
|
if err != nil {
|
273
|
if err != nil {
|
273
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
274
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
274
|
}
|
275
|
}
|
|
@@ -583,7 +584,53 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval |
|
@@ -583,7 +584,53 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval |
583
|
}
|
584
|
}
|
584
|
|
585
|
|
585
|
// GetEvaluationHRBP 获取人资综评详情
|
586
|
// GetEvaluationHRBP 获取人资综评详情
|
586
|
-func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvaluationHRBP) (*[]adapter.EvaluationItemAdapter, error) {
|
587
|
+func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvaluationHRBPMy) (*[]adapter.EvaluationItemAdapter, error) {
|
|
|
588
|
+ transactionContext, err := factory.ValidateStartTransaction(param)
|
|
|
589
|
+ if err != nil {
|
|
|
590
|
+ return nil, err
|
|
|
591
|
+ }
|
|
|
592
|
+ defer func() {
|
|
|
593
|
+ _ = transactionContext.RollbackTransaction()
|
|
|
594
|
+ }()
|
|
|
595
|
+
|
|
|
596
|
+ evaluationRepo := factory.CreateSummaryEvaluationRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
597
|
+ evaluationItemRepo := factory.CreateEvaluationItemUsedRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
598
|
+ itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
599
|
+
|
|
|
600
|
+ sEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
601
|
+ if err != nil {
|
|
|
602
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
603
|
+ }
|
|
|
604
|
+
|
|
|
605
|
+ // 自评评估内容(自评模板、筛选项目评估人)
|
|
|
606
|
+ _, itemList, err := evaluationItemRepo.Find(map[string]interface{}{
|
|
|
607
|
+ "evaluationProjectId": sEvaluation.EvaluationProjectId,
|
|
|
608
|
+ "nodeType": domain.LinkNodeSelfAssessment,
|
|
|
609
|
+ "evaluatorId": -1,
|
|
|
610
|
+ })
|
|
|
611
|
+ if err != nil {
|
|
|
612
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
613
|
+ }
|
|
|
614
|
+
|
|
|
615
|
+ // 评估内容对应的分数
|
|
|
616
|
+ _, itemValues, err := itemValueRepo.Find(map[string]interface{}{"summaryEvaluationId": sEvaluation.Id})
|
|
|
617
|
+ if err != nil {
|
|
|
618
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
619
|
+ }
|
|
|
620
|
+
|
|
|
621
|
+ if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
622
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
623
|
+ }
|
|
|
624
|
+
|
|
|
625
|
+ itemValuesAdapter := srv.buildSummaryItemValue(itemList, itemValues)
|
|
|
626
|
+ for i := range itemValuesAdapter { // 评估人名称赋值
|
|
|
627
|
+ itemValuesAdapter[i].EvaluatorName = sEvaluation.Executor.UserName
|
|
|
628
|
+ }
|
|
|
629
|
+ return &itemValuesAdapter, nil
|
|
|
630
|
+}
|
|
|
631
|
+
|
|
|
632
|
+// GetEvaluationHRBPComplete 获取人资综评详情(已完成状态)
|
|
|
633
|
+func (srv *SummaryEvaluationService) GetEvaluationHRBPComplete(param *command.QueryEvaluationHRBP) (*[]adapter.EvaluationItemAdapter, error) {
|
587
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
634
|
transactionContext, err := factory.ValidateStartTransaction(param)
|
588
|
if err != nil {
|
635
|
if err != nil {
|
589
|
return nil, err
|
636
|
return nil, err
|
|
@@ -597,13 +644,13 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu |
|
@@ -597,13 +644,13 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu |
597
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
644
|
itemValueRepo := factory.CreateSummaryEvaluationValueRepository(map[string]interface{}{"transactionContext": transactionContext})
|
598
|
|
645
|
|
599
|
_, evaluations, err := evaluationRepo.Find(map[string]interface{}{
|
646
|
_, evaluations, err := evaluationRepo.Find(map[string]interface{}{
|
600
|
- "limit": 1,
|
647
|
+ "limit": 99999,
|
601
|
"companyId": param.CompanyId,
|
648
|
"companyId": param.CompanyId,
|
602
|
"cycleId": param.CycleId,
|
649
|
"cycleId": param.CycleId,
|
603
|
"targetUserId": param.TargetUserId,
|
650
|
"targetUserId": param.TargetUserId,
|
|
|
651
|
+ "status": domain.EvaluationCompleted,
|
604
|
"types": domain.EvaluationHrbp},
|
652
|
"types": domain.EvaluationHrbp},
|
605
|
)
|
653
|
)
|
606
|
- // sEvaluation, err := evaluationRepo.FindOne(map[string]interface{}{"id": param.SummaryEvaluationId})
|
|
|
607
|
if err != nil {
|
654
|
if err != nil {
|
608
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
655
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
609
|
}
|
656
|
}
|
|
@@ -653,21 +700,6 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu |
|
@@ -653,21 +700,6 @@ func (srv *SummaryEvaluationService) GetEvaluationHRBP(param *command.QueryEvalu |
653
|
itemValuesAdapter[i].EvaluatorName = executor.UserName
|
700
|
itemValuesAdapter[i].EvaluatorName = executor.UserName
|
654
|
}
|
701
|
}
|
655
|
}
|
702
|
}
|
656
|
-
|
|
|
657
|
- //result := adapter.EvaluationInfoAdapter{
|
|
|
658
|
- // SummaryEvaluationId: sEvaluation.Id,
|
|
|
659
|
- // CycleId: int(sEvaluation.CycleId),
|
|
|
660
|
- // CycleName: sEvaluation.CycleName,
|
|
|
661
|
- // EvaluationProjectId: sEvaluation.EvaluationProjectId,
|
|
|
662
|
- // EvaluationProjectName: sEvaluation.EvaluationProjectName,
|
|
|
663
|
- // LinkNodeId: sEvaluation.NodeId,
|
|
|
664
|
- // BeginTime: sEvaluation.BeginTime.Format("2006-01-02 15:04:05"),
|
|
|
665
|
- // EndTime: sEvaluation.EndTime.Format("2006-01-02 15:04:05"),
|
|
|
666
|
- // TargetUserId: sEvaluation.TargetUser.UserId,
|
|
|
667
|
- // TargetUserName: sEvaluation.TargetUser.UserName,
|
|
|
668
|
- // Status: string(sEvaluation.Status),
|
|
|
669
|
- // EvaluationItems: itemValuesAdapter,
|
|
|
670
|
- //}
|
|
|
671
|
return &itemValuesAdapter, nil
|
703
|
return &itemValuesAdapter, nil
|
672
|
}
|
704
|
}
|
673
|
|
705
|
|