|
@@ -596,6 +596,8 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu |
|
@@ -596,6 +596,8 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu |
596
|
// 员工提交自评内容后,
|
596
|
// 员工提交自评内容后,
|
597
|
// 员工作为被评估人,
|
597
|
// 员工作为被评估人,
|
598
|
// 变更360评估/人资评估/的开始时间
|
598
|
// 变更360评估/人资评估/的开始时间
|
|
|
599
|
+// 或者上级评估的开始时间
|
|
|
600
|
+// 或者生成考核结果
|
599
|
func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain.SummaryEvaluation) error {
|
601
|
func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain.SummaryEvaluation) error {
|
600
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
602
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
601
|
if err != nil {
|
603
|
if err != nil {
|
|
@@ -619,7 +621,18 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain. |
|
@@ -619,7 +621,18 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain. |
619
|
if err != nil {
|
621
|
if err != nil {
|
620
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
622
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
621
|
}
|
623
|
}
|
622
|
-
|
624
|
+ if len(evaluationList) == 0 {
|
|
|
625
|
+ //如果没有360评估和hrbp 评估,查找上级评估
|
|
|
626
|
+ _, evaluationList, err = evaluationRepo.Find(map[string]interface{}{
|
|
|
627
|
+ "targetUserId": param.TargetUser.UserId,
|
|
|
628
|
+ "typesList": []int{int(domain.EvaluationSuper)},
|
|
|
629
|
+ "cycleId": param.CycleId,
|
|
|
630
|
+ "limit": 10,
|
|
|
631
|
+ })
|
|
|
632
|
+ if err != nil {
|
|
|
633
|
+ return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
634
|
+ }
|
|
|
635
|
+ }
|
623
|
nowTime := time.Now()
|
636
|
nowTime := time.Now()
|
624
|
updatedId := []int{}
|
637
|
updatedId := []int{}
|
625
|
// 变更360评估/人资评估/上级评估的开始时间
|
638
|
// 变更360评估/人资评估/上级评估的开始时间
|
|
@@ -632,12 +645,16 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain. |
|
@@ -632,12 +645,16 @@ func (srv *SummaryEvaluationService) AfterCompletedEvaluationSelf(param *domain. |
632
|
evaluationDao := dao.NewSummaryEvaluationDao(map[string]interface{}{
|
645
|
evaluationDao := dao.NewSummaryEvaluationDao(map[string]interface{}{
|
633
|
"transactionContext": transactionContext,
|
646
|
"transactionContext": transactionContext,
|
634
|
})
|
647
|
})
|
635
|
-
|
|
|
636
|
err = evaluationDao.UpdateBeginTime(updatedId, nowTime)
|
648
|
err = evaluationDao.UpdateBeginTime(updatedId, nowTime)
|
637
|
if err != nil {
|
649
|
if err != nil {
|
638
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
650
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
639
|
}
|
651
|
}
|
640
|
|
652
|
|
|
|
653
|
+ if len(evaluationList) == 0 {
|
|
|
654
|
+ //没有上级评估、360评估、hrbp 评估
|
|
|
655
|
+ //直接生成考核结果记录
|
|
|
656
|
+ //
|
|
|
657
|
+ }
|
641
|
if err := transactionContext.CommitTransaction(); err != nil {
|
658
|
if err := transactionContext.CommitTransaction(); err != nil {
|
642
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
659
|
return application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
643
|
}
|
660
|
}
|