正在显示
10 个修改的文件
包含
102 行增加
和
21 行删除
@@ -26,6 +26,7 @@ type EvaluationBaseAdapter struct { | @@ -26,6 +26,7 @@ type EvaluationBaseAdapter struct { | ||
26 | Types int `json:"types"` //评估类型 | 26 | Types int `json:"types"` //评估类型 |
27 | DutyTime string `json:"dutyTime"` //入职时间 | 27 | DutyTime string `json:"dutyTime"` //入职时间 |
28 | Status string `json:"status"` //完成状态 | 28 | Status string `json:"status"` //完成状态 |
29 | + CompletedAt int64 `json:"completedAt"` // | ||
29 | CheckResult string `json:"checkResult"` //确认绩效结果 | 30 | CheckResult string `json:"checkResult"` //确认绩效结果 |
30 | TotalScore string `json:"totalScore"` //评估总分 | 31 | TotalScore string `json:"totalScore"` //评估总分 |
31 | Version string `json:"version"` //评估填写方式 | 32 | Version string `json:"version"` //评估填写方式 |
@@ -150,15 +150,22 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua | @@ -150,15 +150,22 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua | ||
150 | if summaryEvaluation.CompanyId != param.CompanyId { | 150 | if summaryEvaluation.CompanyId != param.CompanyId { |
151 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 151 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") |
152 | } | 152 | } |
153 | + | ||
153 | // 按照 被评估人加锁 | 154 | // 按照 被评估人加锁 |
154 | lock := xredis.NewLockSummaryEvaluation(summaryEvaluation.TargetUser.UserId) | 155 | lock := xredis.NewLockSummaryEvaluation(summaryEvaluation.TargetUser.UserId) |
155 | err = lock.Lock() | 156 | err = lock.Lock() |
156 | if err != nil { | 157 | if err != nil { |
157 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未能完全提交评估内容") | 158 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "未能完全提交评估内容"+err.Error()) |
158 | } | 159 | } |
159 | defer func() { | 160 | defer func() { |
160 | lock.UnLock() | 161 | lock.UnLock() |
161 | }() | 162 | }() |
163 | + // 检查是否逾期完成 | ||
164 | + if summaryEvaluation.EndTime.Unix() < summaryEvaluation.CompletedAt { | ||
165 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "已经逾期提交一次,不能再次编辑") | ||
166 | + } | ||
167 | + | ||
168 | + //检查被评估人是否已经确认考核结果 | ||
162 | _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ | 169 | _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ |
163 | "targetUserId": summaryEvaluation.TargetUser.UserId, | 170 | "targetUserId": summaryEvaluation.TargetUser.UserId, |
164 | "typesList": []int{int(domain.EvaluationFinish)}, | 171 | "typesList": []int{int(domain.EvaluationFinish)}, |
@@ -172,9 +179,10 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua | @@ -172,9 +179,10 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua | ||
172 | if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted { | 179 | if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted { |
173 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!") | 180 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!") |
174 | } | 181 | } |
175 | - if ok := summaryEvaluation.EndTime.Before(time.Now()); ok { | ||
176 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "评估时间已截止") | ||
177 | - } | 182 | + // 取消时间限制 |
183 | + // if ok := summaryEvaluation.EndTime.Before(time.Now()); ok { | ||
184 | + // return nil, application.ThrowError(application.BUSINESS_ERROR, "评估时间已截止") | ||
185 | + // } | ||
178 | 186 | ||
179 | // 自评评估内容(自评模板、筛选项目评估人) | 187 | // 自评评估内容(自评模板、筛选项目评估人) |
180 | _, itemList, err := itemUsedRepo.Find(map[string]interface{}{ | 188 | _, itemList, err := itemUsedRepo.Find(map[string]interface{}{ |
@@ -246,6 +254,7 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua | @@ -246,6 +254,7 @@ func (srv *SummaryEvaluationService) EditEvaluation360(param *command.EditEvalua | ||
246 | if !param.IsTemporary { | 254 | if !param.IsTemporary { |
247 | //变更评估状态为已填写 | 255 | //变更评估状态为已填写 |
248 | summaryEvaluation.Status = domain.EvaluationCompleted | 256 | summaryEvaluation.Status = domain.EvaluationCompleted |
257 | + summaryEvaluation.CompletedAt = time.Now().Unix() | ||
249 | //删除旧的填写值,使用新的填写内容 | 258 | //删除旧的填写值,使用新的填写内容 |
250 | err = itemValueRepo.RemoveBySummaryEvaluationId(summaryEvaluation.Id) | 259 | err = itemValueRepo.RemoveBySummaryEvaluationId(summaryEvaluation.Id) |
251 | if err != nil { | 260 | if err != nil { |
@@ -274,11 +274,12 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | @@ -274,11 +274,12 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | ||
274 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 274 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
275 | } | 275 | } |
276 | if summaryEvaluation.Types != domain.EvaluationHrbp { | 276 | if summaryEvaluation.Types != domain.EvaluationHrbp { |
277 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 277 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限") |
278 | } | 278 | } |
279 | if summaryEvaluation.CompanyId != param.CompanyId { | 279 | if summaryEvaluation.CompanyId != param.CompanyId { |
280 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 280 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限") |
281 | } | 281 | } |
282 | + | ||
282 | // 按照 被评估人加锁 | 283 | // 按照 被评估人加锁 |
283 | lock := xredis.NewLockSummaryEvaluation(summaryEvaluation.TargetUser.UserId) | 284 | lock := xredis.NewLockSummaryEvaluation(summaryEvaluation.TargetUser.UserId) |
284 | err = lock.Lock() | 285 | err = lock.Lock() |
@@ -288,6 +289,10 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | @@ -288,6 +289,10 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | ||
288 | defer func() { | 289 | defer func() { |
289 | lock.UnLock() | 290 | lock.UnLock() |
290 | }() | 291 | }() |
292 | + // 检查是否逾期完成 | ||
293 | + if summaryEvaluation.EndTime.Unix() < summaryEvaluation.CompletedAt { | ||
294 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "已经逾期提交一次,不能再次编辑") | ||
295 | + } | ||
291 | _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ | 296 | _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ |
292 | "targetUserId": summaryEvaluation.TargetUser.UserId, | 297 | "targetUserId": summaryEvaluation.TargetUser.UserId, |
293 | "typesList": []int{int(domain.EvaluationFinish)}, | 298 | "typesList": []int{int(domain.EvaluationFinish)}, |
@@ -301,9 +306,9 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | @@ -301,9 +306,9 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | ||
301 | if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted { | 306 | if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted { |
302 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!") | 307 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!") |
303 | } | 308 | } |
304 | - if ok := summaryEvaluation.EndTime.Before(time.Now()); ok { | ||
305 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "评估时间已截止") | ||
306 | - } | 309 | + // if ok := summaryEvaluation.EndTime.Before(time.Now()); ok { |
310 | + // return nil, application.ThrowError(application.BUSINESS_ERROR, "评估时间已截止") | ||
311 | + // } | ||
307 | // 自评评估内容(自评模板、筛选项目评估人) | 312 | // 自评评估内容(自评模板、筛选项目评估人) |
308 | _, itemList, err := itemUsedRepo.Find(map[string]interface{}{ | 313 | _, itemList, err := itemUsedRepo.Find(map[string]interface{}{ |
309 | "evaluationProjectId": summaryEvaluation.EvaluationProjectId, | 314 | "evaluationProjectId": summaryEvaluation.EvaluationProjectId, |
@@ -372,6 +377,7 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | @@ -372,6 +377,7 @@ func (srv *SummaryEvaluationService) EditEvaluationHRBP(param *command.EditEvalu | ||
372 | if !param.IsTemporary { | 377 | if !param.IsTemporary { |
373 | //变更评估状态为已填写 | 378 | //变更评估状态为已填写 |
374 | summaryEvaluation.Status = domain.EvaluationCompleted | 379 | summaryEvaluation.Status = domain.EvaluationCompleted |
380 | + summaryEvaluation.CompletedAt = time.Now().Unix() | ||
375 | //删除旧的填写值,使用新的填写内容 | 381 | //删除旧的填写值,使用新的填写内容 |
376 | err = itemValueRepo.RemoveBySummaryEvaluationId(summaryEvaluation.Id) | 382 | err = itemValueRepo.RemoveBySummaryEvaluationId(summaryEvaluation.Id) |
377 | if err != nil { | 383 | if err != nil { |
@@ -234,14 +234,18 @@ func (srv *SummaryEvaluationService) EditEvaluationSelfV2(param *command.EditEva | @@ -234,14 +234,18 @@ func (srv *SummaryEvaluationService) EditEvaluationSelfV2(param *command.EditEva | ||
234 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估"+err.Error()) | 234 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估"+err.Error()) |
235 | } | 235 | } |
236 | if evaluationData.Types != domain.EvaluationSelf { | 236 | if evaluationData.Types != domain.EvaluationSelf { |
237 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 237 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限") |
238 | } | 238 | } |
239 | 239 | ||
240 | if evaluationData.Executor.UserId != param.ExecutorId { | 240 | if evaluationData.Executor.UserId != param.ExecutorId { |
241 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 241 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限") |
242 | } | 242 | } |
243 | if evaluationData.CompanyId != param.CompanyId { | 243 | if evaluationData.CompanyId != param.CompanyId { |
244 | - return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 244 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "没有操作权限") |
245 | + } | ||
246 | + // 检查是否逾期完成 | ||
247 | + if evaluationData.EndTime.Unix() < evaluationData.CompletedAt { | ||
248 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "已经逾期提交一次,不能再次编辑") | ||
245 | } | 249 | } |
246 | //按照 被评估人加锁 | 250 | //按照 被评估人加锁 |
247 | lock := xredis.NewLockSummaryEvaluation(evaluationData.TargetUser.UserId) | 251 | lock := xredis.NewLockSummaryEvaluation(evaluationData.TargetUser.UserId) |
@@ -252,6 +256,20 @@ func (srv *SummaryEvaluationService) EditEvaluationSelfV2(param *command.EditEva | @@ -252,6 +256,20 @@ func (srv *SummaryEvaluationService) EditEvaluationSelfV2(param *command.EditEva | ||
252 | defer func() { | 256 | defer func() { |
253 | lock.UnLock() | 257 | lock.UnLock() |
254 | }() | 258 | }() |
259 | + | ||
260 | + _, evaluationList, err := evaluationRepo.Find(map[string]interface{}{ | ||
261 | + "targetUserId": evaluationData.TargetUser.UserId, | ||
262 | + "typesList": []int{int(domain.EvaluationFinish)}, | ||
263 | + "cycleId": evaluationData.CycleId, | ||
264 | + "limit": 1, | ||
265 | + }) | ||
266 | + if err != nil { | ||
267 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | ||
268 | + } | ||
269 | + // 如果目标员工已经确认考核结果,就不能在进行评估编辑 | ||
270 | + if len(evaluationList) > 0 && evaluationList[0].CheckResult == domain.EvaluationCheckCompleted { | ||
271 | + return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "用户已经确认该周期的考核结果,不能再编辑!") | ||
272 | + } | ||
255 | _, itemList, err := itemUsedRepo.Find(map[string]interface{}{ | 273 | _, itemList, err := itemUsedRepo.Find(map[string]interface{}{ |
256 | "evaluationProjectId": evaluationData.EvaluationProjectId, | 274 | "evaluationProjectId": evaluationData.EvaluationProjectId, |
257 | "nodeType": domain.LinkNodeSelfAssessment, | 275 | "nodeType": domain.LinkNodeSelfAssessment, |
@@ -320,6 +338,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSelfV2(param *command.EditEva | @@ -320,6 +338,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSelfV2(param *command.EditEva | ||
320 | 338 | ||
321 | if !param.IsTemporary { | 339 | if !param.IsTemporary { |
322 | evaluationData.Status = domain.EvaluationCompleted | 340 | evaluationData.Status = domain.EvaluationCompleted |
341 | + evaluationData.CompletedAt = time.Now().Unix() | ||
323 | //删除旧的填写值,使用新的填写内容 | 342 | //删除旧的填写值,使用新的填写内容 |
324 | err = itemValueRepo.RemoveBySummaryEvaluationId(evaluationData.Id) | 343 | err = itemValueRepo.RemoveBySummaryEvaluationId(evaluationData.Id) |
325 | if err != nil { | 344 | if err != nil { |
@@ -325,9 +325,13 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval | @@ -325,9 +325,13 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval | ||
325 | if evaluationData.CompanyId != param.CompanyId { | 325 | if evaluationData.CompanyId != param.CompanyId { |
326 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") | 326 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "没有操作权限") |
327 | } | 327 | } |
328 | - ok := evaluationData.EndTime.Before(time.Now()) | ||
329 | - if ok { | ||
330 | - return nil, application.ThrowError(application.BUSINESS_ERROR, "评估时间已截止") | 328 | + // ok := evaluationData.EndTime.Before(time.Now()) |
329 | + // if ok { | ||
330 | + // return nil, application.ThrowError(application.BUSINESS_ERROR, "评估时间已截止") | ||
331 | + // } | ||
332 | + // 检查是否逾期完成 | ||
333 | + if evaluationData.EndTime.Unix() < evaluationData.CompletedAt { | ||
334 | + return nil, application.ThrowError(application.BUSINESS_ERROR, "已经逾期提交一次,不能再次编辑") | ||
331 | } | 335 | } |
332 | //按照被评估人id ,加锁 | 336 | //按照被评估人id ,加锁 |
333 | lock := xredis.NewLockSummaryEvaluation(evaluationData.TargetUser.UserId) | 337 | lock := xredis.NewLockSummaryEvaluation(evaluationData.TargetUser.UserId) |
@@ -441,6 +445,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval | @@ -441,6 +445,7 @@ func (srv *SummaryEvaluationService) EditEvaluationSuper(param *command.EditEval | ||
441 | if !param.IsTemporary { | 445 | if !param.IsTemporary { |
442 | //变更评估状态为已填写 | 446 | //变更评估状态为已填写 |
443 | evaluationData.Status = domain.EvaluationCompleted | 447 | evaluationData.Status = domain.EvaluationCompleted |
448 | + evaluationData.CompletedAt = time.Now().Unix() | ||
444 | //删除旧的填写值,使用新的填写内容 | 449 | //删除旧的填写值,使用新的填写内容 |
445 | err = itemValueRepo.RemoveBySummaryEvaluationId(evaluationData.Id) | 450 | err = itemValueRepo.RemoveBySummaryEvaluationId(evaluationData.Id) |
446 | if err != nil { | 451 | if err != nil { |
@@ -463,8 +463,19 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app | @@ -463,8 +463,19 @@ func (srv *SummaryEvaluationService) getSummaryEvaluation(transactionContext app | ||
463 | Status: string(evaluationData.Status), | 463 | Status: string(evaluationData.Status), |
464 | CheckResult: string(evaluationData.CheckResult), | 464 | CheckResult: string(evaluationData.CheckResult), |
465 | TotalScore: evaluationData.TotalScore, | 465 | TotalScore: evaluationData.TotalScore, |
466 | + CompletedAt: evaluationData.CompletedAt, | ||
466 | Version: string(evaluationData.Version), | 467 | Version: string(evaluationData.Version), |
467 | } | 468 | } |
469 | + if evaluationData.CompletedAt == 0 { | ||
470 | + result.Status = string(domain.EvaluationUncompleted) //未完成 | ||
471 | + } else { | ||
472 | + if evaluationData.EndTime.Unix() < evaluationData.CompletedAt { | ||
473 | + result.Status = string(domain.EvaluationCompleted) + "_timeout" //超时完成 | ||
474 | + } else { | ||
475 | + result.Status = string(domain.EvaluationCompleted) // 正常完成 | ||
476 | + } | ||
477 | + } | ||
478 | + | ||
468 | //获取用户信息 | 479 | //获取用户信息 |
469 | companyRepo := factory.CreateCompanyRepository(map[string]interface{}{"transactionContext": transactionContext}) | 480 | companyRepo := factory.CreateCompanyRepository(map[string]interface{}{"transactionContext": transactionContext}) |
470 | userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext}) | 481 | userRepo := factory.CreateUserRepository(map[string]interface{}{"transactionContext": transactionContext}) |
@@ -869,12 +880,13 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command. | @@ -869,12 +880,13 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command. | ||
869 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) | 880 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) |
870 | } | 881 | } |
871 | evaluationListAdapter := []*adapter.EvaluationSuperListAdapter{} | 882 | evaluationListAdapter := []*adapter.EvaluationSuperListAdapter{} |
883 | + nowTime := time.Now() | ||
872 | for _, v := range evaluationList { | 884 | for _, v := range evaluationList { |
873 | item := adapter.EvaluationSuperListAdapter{ | 885 | item := adapter.EvaluationSuperListAdapter{ |
874 | SummaryEvaluationId: v.Id, | 886 | SummaryEvaluationId: v.Id, |
875 | TargetUserName: v.TargetUser.UserName, | 887 | TargetUserName: v.TargetUser.UserName, |
876 | TargetUserId: v.TargetUser.UserId, | 888 | TargetUserId: v.TargetUser.UserId, |
877 | - EvaluationStatus: string(v.Status), | 889 | + EvaluationStatus: "", |
878 | EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"), | 890 | EndTime: v.EndTime.Local().Format("2006-01-02 15:04:05"), |
879 | TotalScoreSelf: "", | 891 | TotalScoreSelf: "", |
880 | Department: "", | 892 | Department: "", |
@@ -882,6 +894,20 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command. | @@ -882,6 +894,20 @@ func (srv *SummaryEvaluationService) ListExecutorEvaluationSuper(param *command. | ||
882 | EntryTime: "", | 894 | EntryTime: "", |
883 | TotalScoreSuper: v.TotalScore, | 895 | TotalScoreSuper: v.TotalScore, |
884 | } | 896 | } |
897 | + if v.Status == domain.EvaluationCompleted { | ||
898 | + if v.CompletedAt > v.EndTime.Unix() { | ||
899 | + item.EvaluationStatus = "逾期完成" | ||
900 | + } else { | ||
901 | + item.EvaluationStatus = "已完成" | ||
902 | + } | ||
903 | + } else { | ||
904 | + if nowTime.After(v.EndTime) { | ||
905 | + item.EvaluationStatus = "已逾期" | ||
906 | + } else { | ||
907 | + item.EvaluationStatus = "待完成" | ||
908 | + } | ||
909 | + } | ||
910 | + | ||
885 | for _, dep := range v.TargetDepartment { | 911 | for _, dep := range v.TargetDepartment { |
886 | item.Department += dep.DepartmentName + " " | 912 | item.Department += dep.DepartmentName + " " |
887 | } | 913 | } |
@@ -129,7 +129,11 @@ func (srv *SummaryEvaluationService) Evaluation360List(param *command.QueryEvalu | @@ -129,7 +129,11 @@ func (srv *SummaryEvaluationService) Evaluation360List(param *command.QueryEvalu | ||
129 | endTime := v.EndTime.Local() | 129 | endTime := v.EndTime.Local() |
130 | statusVal := "" | 130 | statusVal := "" |
131 | if v.Status == domain.EvaluationCompleted { | 131 | if v.Status == domain.EvaluationCompleted { |
132 | - statusVal = "已完成" | 132 | + if v.CompletedAt > v.EndTime.Unix() { |
133 | + statusVal = "逾期完成" | ||
134 | + } else { | ||
135 | + statusVal = "已完成" | ||
136 | + } | ||
133 | } else { | 137 | } else { |
134 | if now.After(endTime) { | 138 | if now.After(endTime) { |
135 | statusVal = "已逾期" | 139 | statusVal = "已逾期" |
@@ -423,7 +427,11 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval | @@ -423,7 +427,11 @@ func (srv *SummaryEvaluationService) EvaluationHRBPList(param *command.QueryEval | ||
423 | // 状态 | 427 | // 状态 |
424 | statusVal := "" | 428 | statusVal := "" |
425 | if v.Status == domain.EvaluationCompleted { | 429 | if v.Status == domain.EvaluationCompleted { |
426 | - statusVal = "已完成" | 430 | + if v.CompletedAt > v.EndTime.Unix() { |
431 | + statusVal = "逾期完成" | ||
432 | + } else { | ||
433 | + statusVal = "已完成" | ||
434 | + } | ||
427 | } else { | 435 | } else { |
428 | if now.After(endTime) { | 436 | if now.After(endTime) { |
429 | statusVal = "已逾期" | 437 | statusVal = "已逾期" |
@@ -63,6 +63,7 @@ const ( | @@ -63,6 +63,7 @@ const ( | ||
63 | // EvaluationEditTotalScore EvaluationStatus = "completed_by_edit_score" //通过超级管理员直接修改分数完成的 | 63 | // EvaluationEditTotalScore EvaluationStatus = "completed_by_edit_score" //通过超级管理员直接修改分数完成的 |
64 | EvaluationUncompleted EvaluationStatus = "uncompleted" //未提交填写的内容 | 64 | EvaluationUncompleted EvaluationStatus = "uncompleted" //未提交填写的内容 |
65 | EvaluationCompleted EvaluationStatus = "completed" //已提交填写的内容 | 65 | EvaluationCompleted EvaluationStatus = "completed" //已提交填写的内容 |
66 | + | ||
66 | ) | 67 | ) |
67 | 68 | ||
68 | // 被执行的人确认评估结果 | 69 | // 被执行的人确认评估结果 |
@@ -19,13 +19,13 @@ type SummaryEvaluation struct { | @@ -19,13 +19,13 @@ type SummaryEvaluation struct { | ||
19 | TargetUser domain.StaffDesc //被评估的目标用户,被执行的 | 19 | TargetUser domain.StaffDesc //被评估的目标用户,被执行的 |
20 | TargetDepartment []domain.StaffDepartment //被评估的目标用户所在的部门 | 20 | TargetDepartment []domain.StaffDepartment //被评估的目标用户所在的部门 |
21 | Executor domain.StaffDesc //填写评估的用户,执行人 | 21 | Executor domain.StaffDesc //填写评估的用户,执行人 |
22 | - Types int //评估类型 | 22 | + Types int `pg:",use_zero"` //评估类型 |
23 | Status string //评估的填写状态 | 23 | Status string //评估的填写状态 |
24 | CheckResult string //被执行的人确认评估结果 | 24 | CheckResult string //被执行的人确认评估结果 |
25 | HrCheckResult string //存在人资稽查填写完成评估 | 25 | HrCheckResult string //存在人资稽查填写完成评估 |
26 | BeginTime time.Time //开始时间 | 26 | BeginTime time.Time //开始时间 |
27 | EndTime time.Time //截止时间 | 27 | EndTime time.Time //截止时间 |
28 | - CompletedAt int64 //完成时间 | 28 | + CompletedAt int64 `pg:",use_zero"` //完成时间 |
29 | TotalScore string //最终上级评估得分. | 29 | TotalScore string //最终上级评估得分. |
30 | Version string //填写评估值的规则版本 v1,v2 | 30 | Version string //填写评估值的规则版本 v1,v2 |
31 | TotalRating []domain.RatingCodeNumber //汇总评级 | 31 | TotalRating []domain.RatingCodeNumber //汇总评级 |
1 | ALTER TABLE public.summary_evaluation | 1 | ALTER TABLE public.summary_evaluation |
2 | - ADD completedat int8 NOT NULL DEFAULT 0; | 2 | + ADD completed_at int8 NOT NULL DEFAULT 0; |
3 | 3 | ||
4 | +UPDATE | ||
5 | + summary_evaluation | ||
6 | +SET | ||
7 | + completed_at = extract(epoch FROM summary_evaluation.end_time) - 10 | ||
8 | +WHERE | ||
9 | + status = 'completed' |
-
请 注册 或 登录 后发表评论