作者 tangxvhui

更新

1 package service 1 package service
2 2
3 import ( 3 import (
  4 + "time"
  5 +
4 "github.com/linmadan/egglib-go/core/application" 6 "github.com/linmadan/egglib-go/core/application"
5 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory" 7 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/factory"
6 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter" 8 "gitlab.fjmaimaimai.com/allied-creation/performance/pkg/application/summary_evaluation/adapter"
@@ -156,6 +158,7 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit @@ -156,6 +158,7 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit
156 newItemValueList = append(newItemValueList, &temp) 158 newItemValueList = append(newItemValueList, &temp)
157 } 159 }
158 160
  161 + nowTime := time.Now()
159 // 处理人资评估 162 // 处理人资评估
160 if evalutionHrbp != nil { 163 if evalutionHrbp != nil {
161 evalutionHrbp.EvaluationTotalScore(newHrbpItemValueList) 164 evalutionHrbp.EvaluationTotalScore(newHrbpItemValueList)
@@ -167,6 +170,9 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit @@ -167,6 +170,9 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit
167 170
168 evalutionHrbp.HrCheckResult = domain.EvaluationCheckCompleted 171 evalutionHrbp.HrCheckResult = domain.EvaluationCheckCompleted
169 evalutionHrbp.Status = domain.EvaluationCompleted 172 evalutionHrbp.Status = domain.EvaluationCompleted
  173 + if evalutionHrbp.BeginTime.After(nowTime) {
  174 + evalutionHrbp.BeginTime = nowTime
  175 + }
170 err = evaluationRepo.Save(evalutionHrbp) 176 err = evaluationRepo.Save(evalutionHrbp)
171 if err != nil { 177 if err != nil {
172 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 178 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -186,8 +192,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit @@ -186,8 +192,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit
186 if err != nil { 192 if err != nil {
187 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 193 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
188 } 194 }
189 - 195 + val.Status = domain.EvaluationCompleted
190 val.HrCheckResult = domain.EvaluationCheckCompleted 196 val.HrCheckResult = domain.EvaluationCheckCompleted
  197 + if val.BeginTime.After(nowTime) {
  198 + val.BeginTime = nowTime
  199 + }
191 err = evaluationRepo.Save(val) 200 err = evaluationRepo.Save(val)
192 if err != nil { 201 if err != nil {
193 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 202 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -207,8 +216,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit @@ -207,8 +216,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit
207 if err != nil { 216 if err != nil {
208 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 217 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
209 } 218 }
210 - evalutionHrbp.Status = domain.EvaluationCompleted 219 + evaluationSuper.Status = domain.EvaluationCompleted
211 evaluationSuper.HrCheckResult = domain.EvaluationCheckCompleted 220 evaluationSuper.HrCheckResult = domain.EvaluationCheckCompleted
  221 + if evaluationSuper.BeginTime.After(nowTime) {
  222 + evaluationSuper.BeginTime = nowTime
  223 + }
212 err = evaluationRepo.Save(evaluationSuper) 224 err = evaluationRepo.Save(evaluationSuper)
213 if err != nil { 225 if err != nil {
214 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 226 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
@@ -228,8 +240,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit @@ -228,8 +240,11 @@ func (srv *SummaryEvaluationService) EditEvaluationByHrCheck(param *command.Edit
228 if err != nil { 240 if err != nil {
229 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 241 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
230 } 242 }
231 - evalutionHrbp.Status = domain.EvaluationCompleted 243 + evalutionFinish.Status = domain.EvaluationCompleted
232 evalutionFinish.HrCheckResult = domain.EvaluationCheckCompleted 244 evalutionFinish.HrCheckResult = domain.EvaluationCheckCompleted
  245 + if evalutionFinish.BeginTime.After(nowTime) {
  246 + evalutionFinish.BeginTime = nowTime
  247 + }
233 err = evaluationRepo.Save(evalutionFinish) 248 err = evaluationRepo.Save(evalutionFinish)
234 if err != nil { 249 if err != nil {
235 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 250 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())