...
|
...
|
@@ -763,13 +763,11 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
cache = srv.recoverAssessCache(transactionContext, assessData.Id, assessContentList)
|
|
|
}
|
|
|
|
|
|
taskRecords := make([]*domain.TaskRecord, 0) // 类别任务反馈记录
|
|
|
//categoryTaskRecords := make([]*domain.TaskRecord, 0) // 类别任务反馈记录
|
|
|
//assessTaskRecords := make([]*domain.TaskRecord, 0) // 评估项任务反馈记录
|
|
|
taskRecordAdapter := make([]*adapter.TaskRecordAdapter, 0) // 类别任务反馈记录
|
|
|
// 如果评估类型为自评、目标是登录用户时,获取所有任务记录数据
|
|
|
if param.UserId == param.TargetUserId {
|
|
|
taskRecordRepository := factory.CreateTaskRecordRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, taskRecords, err = taskRecordRepository.Find(map[string]interface{}{"staffAssessId": assessData.Id})
|
|
|
_, taskRecords, err := taskRecordRepository.Find(map[string]interface{}{"staffAssessId": assessData.Id})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
|
|
|
}
|
...
|
...
|
@@ -777,15 +775,35 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
if param.AcquireCache != 0 {
|
|
|
srv.recoverCacheWithTaskRecord(cache, taskRecords)
|
|
|
}
|
|
|
//// 区分任务来源分类
|
|
|
//for i := range taskRecords {
|
|
|
// it := taskRecords[i]
|
|
|
// if it.TaskCreatedBy == 0 {
|
|
|
// categoryTaskRecords = append(categoryTaskRecords, it)
|
|
|
// } else {
|
|
|
// assessTaskRecords = append(assessTaskRecords, it)
|
|
|
// }
|
|
|
//}
|
|
|
|
|
|
taskIdMap := map[int]int{}
|
|
|
taskIdArray := make([]int, 0)
|
|
|
for _, v := range taskRecords {
|
|
|
taskIdMap[v.TaskId] = v.TaskId
|
|
|
}
|
|
|
for _, v := range taskIdMap {
|
|
|
taskIdArray = append(taskIdArray, v)
|
|
|
}
|
|
|
|
|
|
taskMap := map[int]*domain.Task{}
|
|
|
taskRepository := factory.CreateTaskRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
_, tasks, err := taskRepository.Find(map[string]interface{}{"ids": taskIdArray, "limit": len(taskIdArray)})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取里程碑数据:"+err.Error())
|
|
|
}
|
|
|
for i := range tasks {
|
|
|
taskMap[tasks[i].Id] = tasks[i]
|
|
|
}
|
|
|
|
|
|
for i := range taskRecords {
|
|
|
it := taskRecords[i]
|
|
|
a := &adapter.TaskRecordAdapter{}
|
|
|
a.TaskRecord = it
|
|
|
if v, ok := taskMap[it.TaskId]; ok {
|
|
|
a.EndTime = v.EndTime
|
|
|
}
|
|
|
taskRecordAdapter = append(taskRecordAdapter, a)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
...
|
...
|
@@ -810,9 +828,7 @@ func (srv StaffAssessServeice) GetAssessSelfInfoV2(param *query.GetExecutorSelfA |
|
|
SupperUser: "",
|
|
|
DutyTime: "",
|
|
|
AssessContent: assessContentList,
|
|
|
//CategoryTaskRecords: categoryTaskRecords,
|
|
|
//AssessTaskRecords: assessTaskRecords,
|
|
|
TaskRecords: taskRecords,
|
|
|
TaskRecords: taskRecordAdapter,
|
|
|
}
|
|
|
if staffDesc != nil {
|
|
|
result.CompanyName = staffDesc.CompanyName
|
...
|
...
|
|