...
|
...
|
@@ -719,9 +719,8 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
|
|
|
assessReps := factory.CreateStaffAssessRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
// 获取员工的评估
|
|
|
_, assessList, err := assessReps.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
...
|
...
|
@@ -739,15 +738,11 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
}
|
|
|
assessData := assessList[0]
|
|
|
|
|
|
assessContentList := []*domain.StaffAssessContent{}
|
|
|
var assessContentList []*domain.StaffAssessContent
|
|
|
if assessData.Status == domain.StaffAssessCompleted {
|
|
|
//已完成
|
|
|
assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
_, assessContentList, err = assessContentRepo.Find(map[string]interface{}{
|
|
|
"staffAssessId": assessData.Id,
|
|
|
})
|
|
|
assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, assessContentList, err = assessContentRepo.Find(map[string]interface{}{"staffAssessId": assessData.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目填写内容"+err.Error())
|
|
|
}
|
...
|
...
|
@@ -759,13 +754,37 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
}
|
|
|
}
|
|
|
|
|
|
// 恢复缓存数据
|
|
|
//获取员工描述
|
|
|
staffDesc, _ := srv.getStaffDescrip(transactionContext, int64(param.TargetUserId))
|
|
|
|
|
|
var cache *domain.StaffAssessCache
|
|
|
// 恢复缓存数据(填写内容)
|
|
|
if param.AcquireCache != 0 {
|
|
|
srv.recoverAssessCache(transactionContext, assessData.Id, assessContentList)
|
|
|
cache = srv.recoverAssessCache(transactionContext, assessData.Id, assessContentList)
|
|
|
}
|
|
|
// 获取项目信息
|
|
|
projectRepository := factory.CreateEvaluationProjectRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
project, err := projectRepository.FindOne(map[string]interface{}{"id": assessData.EvaluationProjectId})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取项目错误:"+err.Error())
|
|
|
}
|
|
|
|
|
|
taskRecords := make([]*domain.TaskRecord, 0)
|
|
|
// 任务负责人才能显示里程碑数据
|
|
|
if project.PrincipalId == strconv.Itoa(param.TargetUserId) {
|
|
|
// 获取里程碑数据
|
|
|
taskRecordRepository := factory.CreateTaskRecordRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, taskRecords, err = taskRecordRepository.Find(map[string]interface{}{"staffAssessId": assessData.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
|
|
|
}
|
|
|
|
|
|
// 恢复缓存数据(里程碑记录)
|
|
|
if param.AcquireCache != 0 {
|
|
|
srv.recoverCacheWithTaskRecord(cache, taskRecords)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//获取员工描述
|
|
|
staffDesc, _ := srv.getStaffDescrip(transactionContext, int64(param.TargetUserId))
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
...
|
...
|
@@ -788,6 +807,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
SupperUser: "",
|
|
|
DutyTime: "",
|
|
|
AssessContent: assessContentList,
|
|
|
TaskRecords: taskRecords,
|
|
|
}
|
|
|
if staffDesc != nil {
|
|
|
result.CompanyName = staffDesc.CompanyName
|
...
|
...
|
|