|
@@ -218,7 +218,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que |
|
@@ -218,7 +218,7 @@ func (srv StaffAssessServeice) AssessTaskDescV2(param *query.AssessTaskDescV2Que |
218
|
}
|
218
|
}
|
219
|
|
219
|
|
220
|
//根据周期获取,我的自评任务添加的邀请人
|
220
|
//根据周期获取,我的自评任务添加的邀请人
|
221
|
-func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
|
221
|
+func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListInviteUserQuery) (*adapter.AssessInviteUserResp, error) {
|
222
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
222
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
223
|
if err != nil {
|
223
|
if err != nil {
|
224
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
224
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
@@ -240,7 +240,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
|
@@ -240,7 +240,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
240
|
_, myAssessTask, err := assessTaskRepo.Find(map[string]interface{}{
|
240
|
_, myAssessTask, err := assessTaskRepo.Find(map[string]interface{}{
|
241
|
"cycleId": param.CycleId,
|
241
|
"cycleId": param.CycleId,
|
242
|
"beginDay": param.BeginDay,
|
242
|
"beginDay": param.BeginDay,
|
243
|
- "executorId": param.UserId,
|
243
|
+ "executorId": param.TargetUserId,
|
244
|
"limit": 1,
|
244
|
"limit": 1,
|
245
|
})
|
245
|
})
|
246
|
if err != nil {
|
246
|
if err != nil {
|
|
@@ -256,7 +256,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
|
@@ -256,7 +256,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
256
|
_, assessList, err := assessReps.Find(map[string]interface{}{
|
256
|
_, assessList, err := assessReps.Find(map[string]interface{}{
|
257
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
257
|
"typesList": []string{string(domain.AssessInviteDiffSuper), string(domain.AssessInviteSameSuper)},
|
258
|
"staffAssessTaskId": assessTaskData.Id,
|
258
|
"staffAssessTaskId": assessTaskData.Id,
|
259
|
- "targetUserId": param.UserId,
|
259
|
+ "targetUserId": param.TargetUserId,
|
260
|
})
|
260
|
})
|
261
|
if err != nil {
|
261
|
if err != nil {
|
262
|
return nil, application.ThrowError(application.ARG_ERROR, "获取个人邀请列表"+err.Error())
|
262
|
return nil, application.ThrowError(application.ARG_ERROR, "获取个人邀请列表"+err.Error())
|
|
@@ -292,7 +292,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
|
@@ -292,7 +292,7 @@ func (srv StaffAssessServeice) ListAssessInviteUserV2(param query.ListAssessInvi |
292
|
}
|
292
|
}
|
293
|
|
293
|
|
294
|
// 根据周期和日期获取我要执行的的360评估,用户列表和评估填写的值
|
294
|
// 根据周期和日期获取我要执行的的360评估,用户列表和评估填写的值
|
295
|
-func (srv StaffAssessServeice) ListExecutorDayInviteAssess(param *query.ListExecutorAssessQuery) (
|
295
|
+func (srv StaffAssessServeice) ListExecutorInviteAssessV2(param *query.ListExecutorAssessQuery) (
|
296
|
*adapter.ListInviteUserAssessResp, error) {
|
296
|
*adapter.ListInviteUserAssessResp, error) {
|
297
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
297
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
298
|
if err != nil {
|
298
|
if err != nil {
|
|
@@ -459,7 +459,7 @@ func (srv StaffAssessServeice) ListExecutorDayInviteAssess(param *query.ListExec |
|
@@ -459,7 +459,7 @@ func (srv StaffAssessServeice) ListExecutorDayInviteAssess(param *query.ListExec |
459
|
}
|
459
|
}
|
460
|
|
460
|
|
461
|
//根据周期和日期获取我需要执行的上级评估成员列表
|
461
|
//根据周期和日期获取我需要执行的上级评估成员列表
|
462
|
-func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExecutorAssessQuery) (map[string]interface{}, error) {
|
462
|
+func (srv StaffAssessServeice) ListExecutorSupperAssessV2(param *query.ListExecutorAssessQuery) (map[string]interface{}, error) {
|
463
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
463
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
464
|
if err != nil {
|
464
|
if err != nil {
|
465
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
465
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
@@ -605,3 +605,87 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
|
@@ -605,3 +605,87 @@ func (srv StaffAssessServeice) ListExecutorDaySupperAssess(param *query.ListExec |
605
|
}
|
605
|
}
|
606
|
return result, nil
|
606
|
return result, nil
|
607
|
}
|
607
|
}
|
|
|
608
|
+
|
|
|
609
|
+//根据周期和日期,获取员工的自评内容
|
|
|
610
|
+func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfAssessQuery) (*adapter.AssessInfoResp, error) {
|
|
|
611
|
+ transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
612
|
+ if err != nil {
|
|
|
613
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
614
|
+ }
|
|
|
615
|
+ if err := transactionContext.StartTransaction(); err != nil {
|
|
|
616
|
+ return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
617
|
+ }
|
|
|
618
|
+ defer func() {
|
|
|
619
|
+ _ = transactionContext.RollbackTransaction()
|
|
|
620
|
+ }()
|
|
|
621
|
+ assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
622
|
+ "transactionContext": transactionContext,
|
|
|
623
|
+ })
|
|
|
624
|
+ // 获取员工的评估
|
|
|
625
|
+ _, assessList, err := assessReps.Find(map[string]interface{}{
|
|
|
626
|
+ "companyId": param.CompanyId,
|
|
|
627
|
+ "executorId": param.ExecutorId,
|
|
|
628
|
+ "cycleId": param.CycleId,
|
|
|
629
|
+ "beginDay": param.BeginDay,
|
|
|
630
|
+ "typesList": []string{string(domain.AssessSelf)},
|
|
|
631
|
+ "limit": 1,
|
|
|
632
|
+ })
|
|
|
633
|
+ if err != nil {
|
|
|
634
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取员工的评估"+err.Error())
|
|
|
635
|
+ }
|
|
|
636
|
+ if len(assessList) == 0 {
|
|
|
637
|
+ return &adapter.AssessInfoResp{}, nil
|
|
|
638
|
+ }
|
|
|
639
|
+ assessData := assessList[0]
|
|
|
640
|
+
|
|
|
641
|
+ assessContentList := []*domain.StaffAssessContent{}
|
|
|
642
|
+ if assessData.Status == domain.StaffAssessCompleted {
|
|
|
643
|
+ //已完成
|
|
|
644
|
+ assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
645
|
+ "transactionContext": transactionContext,
|
|
|
646
|
+ })
|
|
|
647
|
+ _, assessContentList, err = assessContentRepo.Find(map[string]interface{}{
|
|
|
648
|
+ "staffAssessId": assessData.Id,
|
|
|
649
|
+ })
|
|
|
650
|
+ if err != nil {
|
|
|
651
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
652
|
+ }
|
|
|
653
|
+ } else if assessData.Status == domain.StaffAssessUncompleted {
|
|
|
654
|
+ //未完成
|
|
|
655
|
+ assessContentList, err = srv.getAssessSelfInfoUncompleted(transactionContext, assessData)
|
|
|
656
|
+ if err != nil {
|
|
|
657
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
658
|
+ }
|
|
|
659
|
+ }
|
|
|
660
|
+
|
|
|
661
|
+ //获取员工描述
|
|
|
662
|
+ staffDesc, _ := srv.getStaffDescrip(transactionContext, int64(param.ExecutorId))
|
|
|
663
|
+ if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
664
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
665
|
+ }
|
|
|
666
|
+ result := adapter.AssessInfoResp{
|
|
|
667
|
+ AssessId: assessData.Id,
|
|
|
668
|
+ CycleId: assessData.CycleId,
|
|
|
669
|
+ CycleName: assessData.CycleName,
|
|
|
670
|
+ LinkNodeId: assessData.LinkNodeId,
|
|
|
671
|
+ LinkNodeName: assessData.LinkNodeName,
|
|
|
672
|
+ EvaluationProjectId: assessData.EvaluationProjectId,
|
|
|
673
|
+ EvaluationProjectName: assessData.EvaluationProjectName,
|
|
|
674
|
+ BeginTime: assessData.BeginTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
675
|
+ EndTime: assessData.EndTime.Local().Format("2006-01-02 15:04:05"),
|
|
|
676
|
+ Status: string(assessData.Status),
|
|
|
677
|
+ TargetUserId: assessData.TargetUser.UserId,
|
|
|
678
|
+ TargetUserName: assessData.TargetUser.UserName,
|
|
|
679
|
+ CompanyId: assessData.CompanyId,
|
|
|
680
|
+ CompanyName: "",
|
|
|
681
|
+ SupperUser: "",
|
|
|
682
|
+ DutyTime: "",
|
|
|
683
|
+ AssessContent: assessContentList,
|
|
|
684
|
+ }
|
|
|
685
|
+ if staffDesc != nil {
|
|
|
686
|
+ result.CompanyName = staffDesc.CompanyName
|
|
|
687
|
+ result.SupperUser = staffDesc.SupperUserName
|
|
|
688
|
+ result.DutyTime = staffDesc.DutyTime
|
|
|
689
|
+ }
|
|
|
690
|
+ return &result, nil
|
|
|
691
|
+} |