|
@@ -11,6 +11,7 @@ import ( |
|
@@ -11,6 +11,7 @@ import ( |
11
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
11
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/staff_assess/query"
|
12
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
12
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/domain"
|
13
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
13
|
"gitlab.fjmaimaimai.com/allied-creation/performance/pkg/infrastructure/dao"
|
|
|
14
|
+ "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/log"
|
14
|
)
|
15
|
)
|
15
|
|
16
|
|
16
|
//获取我的项目周期列表
|
17
|
//获取我的项目周期列表
|
|
@@ -510,7 +511,7 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
|
@@ -510,7 +511,7 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
510
|
if err != nil {
|
511
|
if err != nil {
|
511
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
512
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
512
|
}
|
513
|
}
|
513
|
-
|
514
|
+ //获取目标用户
|
514
|
userIds := []int{}
|
515
|
userIds := []int{}
|
515
|
for _, v := range assessList {
|
516
|
for _, v := range assessList {
|
516
|
userIds = append(userIds, v.TargetUser.UserId)
|
517
|
userIds = append(userIds, v.TargetUser.UserId)
|
|
@@ -540,33 +541,26 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
|
@@ -540,33 +541,26 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
540
|
})
|
541
|
})
|
541
|
userPositionMap[v.Id] = positionList
|
542
|
userPositionMap[v.Id] = positionList
|
542
|
}
|
543
|
}
|
543
|
-
|
|
|
544
|
- //获取员工邀请的人完成360评估的数量
|
544
|
+ //获取目标员工邀请的人完成360评估的数量
|
545
|
var inviteCompletedCount []dao.CountData
|
545
|
var inviteCompletedCount []dao.CountData
|
546
|
- if len(userIds) > 0 {
|
|
|
547
|
- // d := dao.NewStaffAssessDao(map[string]interface{}{
|
|
|
548
|
- // "transactionContext": transactionContext,
|
|
|
549
|
- // })
|
|
|
550
|
- // inviteCompletedCount, err = d.CountInviteAssessByTargetUser(userIds, param.AssessTaskId)
|
|
|
551
|
- // if err != nil {
|
|
|
552
|
- // log.Logger.Error("获取员工邀请的人完成情况" + err.Error())
|
|
|
553
|
- // }
|
|
|
554
|
- }
|
|
|
555
|
- assessTaskRepo := factory.CreateStaffAssessTaskRepository(map[string]interface{}{
|
546
|
+ d := dao.NewStaffAssessDao(map[string]interface{}{
|
556
|
"transactionContext": transactionContext,
|
547
|
"transactionContext": transactionContext,
|
557
|
})
|
548
|
})
|
558
|
- assessTaskData, err := assessTaskRepo.FindOne(map[string]interface{}{
|
|
|
559
|
- // "id": param.AssessTaskId,
|
|
|
560
|
- })
|
|
|
561
|
- if err != nil {
|
|
|
562
|
- return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取评估任务"+err.Error())
|
549
|
+ if len(userIds) > 0 {
|
|
|
550
|
+ inviteCompletedCount, err = d.CountTargetUserInviteAssess1(userIds, param.CycleId, param.BeginDay)
|
|
|
551
|
+ if err != nil {
|
|
|
552
|
+ log.Logger.Error("获取员工邀请的人完成情况" + err.Error())
|
|
|
553
|
+ }
|
563
|
}
|
554
|
}
|
|
|
555
|
+
|
564
|
//我评估别人,被邀请评估
|
556
|
//我评估别人,被邀请评估
|
565
|
cnnt, _, err := assessRepo.Find(map[string]interface{}{
|
557
|
cnnt, _, err := assessRepo.Find(map[string]interface{}{
|
566
|
- // "staffAssessTaskId": param.AssessTaskId,
|
558
|
+ "beginDay": param.BeginDay,
|
|
|
559
|
+ "cycleId": param.CycleId,
|
567
|
"executorId": param.ExecutorId,
|
560
|
"executorId": param.ExecutorId,
|
568
|
"typesList": []string{string(domain.AssessSuper)},
|
561
|
"typesList": []string{string(domain.AssessSuper)},
|
569
|
"status": string(domain.StaffAssessUncompleted),
|
562
|
"status": string(domain.StaffAssessUncompleted),
|
|
|
563
|
+ "limit": 1,
|
570
|
})
|
564
|
})
|
571
|
if err != nil {
|
565
|
if err != nil {
|
572
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
566
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, "获取个人的评估环节"+err.Error())
|
|
@@ -616,15 +610,9 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
|
@@ -616,15 +610,9 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
616
|
resultList = append(resultList, item)
|
610
|
resultList = append(resultList, item)
|
617
|
}
|
611
|
}
|
618
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList)
|
612
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList)
|
619
|
- result["linkNodeName"] = ""
|
|
|
620
|
- result["linkNodeId"] = ""
|
|
|
621
|
result["lintNodeDesc"] = ""
|
613
|
result["lintNodeDesc"] = ""
|
622
|
- for _, v := range assessTaskData.StepList {
|
|
|
623
|
- if v.LinkNodeType == domain.LinkNodeSuperiorAssessment {
|
|
|
624
|
- result["linkNodeName"] = v.LinkNodeName
|
|
|
625
|
- result["linkNodeId"] = fmt.Sprintf("%d", v.LinkNodeId)
|
|
|
626
|
- result["lintNodeDesc"] = fmt.Sprintf("截止时间 %s 待评估 %d 人", v.EndTime.Local().Format("2006-01-02 15:04:05"), cnnt)
|
|
|
627
|
- }
|
614
|
+ if len(assessList) > 0 {
|
|
|
615
|
+ result["lintNodeDesc"] = fmt.Sprintf("截止时间 %s 待评估 %d 人", assessList[0].EndTime.Local().Format("2006-01-02 15:04:05"), cnnt)
|
628
|
}
|
616
|
}
|
629
|
return result, nil
|
617
|
return result, nil
|
630
|
} |
618
|
} |