...
|
...
|
@@ -801,12 +801,10 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map |
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{"transactionContext": transactionContext})
|
|
|
//assessContentRepo := factory.CreateStaffAssessContentRepository(map[string]interface{}{
|
|
|
// "transactionContext": transactionContext,
|
|
|
//})
|
|
|
cnt, taskRecordList, err := taskRecordRepo.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
"taskId": param.TaskId,
|
...
|
...
|
@@ -814,6 +812,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map |
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取任务反馈数据"+err.Error())
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
|
|
|
resultList := []adapter.TaskRecordAdapter{}
|
|
|
nowDay := time.Now().Format("2006-01-02")
|
...
|
...
|
@@ -831,7 +832,9 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map |
|
|
TaskName: val.TaskName,
|
|
|
TaskAlias: val.TaskAlias,
|
|
|
TaskLeader: val.TaskLeader.Name,
|
|
|
AssistContent: "",
|
|
|
RemarkContent: val.RemarkContent, // 填写反馈内容
|
|
|
AssistLevel: val.AssistLevel, // 上级辅助等级
|
|
|
AssistContent: val.AssistContent, // 上级辅助内容
|
|
|
AnomalyState: val.AnomalyState,
|
|
|
TaskStageCheck: adapter.TaskStage{
|
|
|
Id: val.Id,
|
...
|
...
|
@@ -852,24 +855,24 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map |
|
|
t2 := time.Unix(val.TaskStageCheck.RealCompletedAt, 0).Local().Format("2006-01-02")
|
|
|
item.TaskStageCheck.RealCompletedAt = t2
|
|
|
}
|
|
|
_, contentList, err := assessContentRepo.Find(map[string]interface{}{
|
|
|
"staffAssessId": val.StaffAssessId,
|
|
|
"category": val.TaskCategory,
|
|
|
"name": val.TaskName,
|
|
|
})
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估反馈数据"+err.Error())
|
|
|
}
|
|
|
if len(contentList) > 0 {
|
|
|
for _, val2 := range contentList[0].Remark {
|
|
|
item.AssistContent += val2.RemarkText + "\n"
|
|
|
}
|
|
|
}
|
|
|
//_, contentList, err := assessContentRepo.Find(map[string]interface{}{
|
|
|
// "staffAssessId": val.StaffAssessId,
|
|
|
// "category": val.TaskCategory,
|
|
|
// "name": val.TaskName,
|
|
|
//})
|
|
|
//if err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "获取评估反馈数据"+err.Error())
|
|
|
//}
|
|
|
//if len(contentList) > 0 {
|
|
|
// for _, val2 := range contentList[0].Remark {
|
|
|
// item.AssistContent += val2.RemarkText + "\n"
|
|
|
// }
|
|
|
//}
|
|
|
resultList = append(resultList, item)
|
|
|
}
|
|
|
if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
}
|
|
|
//if err := transactionContext.CommitTransaction(); err != nil {
|
|
|
// return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
//}
|
|
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList)
|
|
|
return result, nil
|
|
|
}
|
...
|
...
|
|