...
|
...
|
@@ -704,7 +704,7 @@ func (srv TaskService) ListTask2(param *command.SearchTaskCommand) (map[string]i |
|
|
}
|
|
|
|
|
|
// 以hrbp角色权限获取任务列表
|
|
|
// TODO 统计里程碑异常数,反馈异常数
|
|
|
// 统计里程碑异常数,反馈异常数
|
|
|
func (srv TaskService) listTask2ForHrbp(param *command.SearchTaskCommand) (map[string]interface{}, error) {
|
|
|
var limit = 20
|
|
|
var offset = 0
|
...
|
...
|
@@ -848,3 +848,62 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction |
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
// 获取任务的反馈
|
|
|
func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map[string]interface{}, error) {
|
|
|
transactionContext, err := factory.CreateTransactionContext(nil)
|
|
|
if err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
if err := transactionContext.StartTransaction(); err != nil {
|
|
|
return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
|
|
|
}
|
|
|
defer func() {
|
|
|
_ = transactionContext.RollbackTransaction()
|
|
|
}()
|
|
|
taskRecordRepo := factory.CreateTaskRecordRepository(map[string]interface{}{
|
|
|
"transactionContext": transactionContext,
|
|
|
})
|
|
|
cnt, taskRecordList, err := taskRecordRepo.Find(map[string]interface{}{
|
|
|
"companyId": param.CompanyId,
|
|
|
"taskId": param.TaskId,
|
|
|
})
|
|
|
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{}
|
|
|
for _, val := range taskRecordList {
|
|
|
item := adapter.TaskRecordAdapter{
|
|
|
Id: val.Id,
|
|
|
StaffAssessId: val.StaffAssessId,
|
|
|
TaskId: val.TaskId,
|
|
|
TaskCategory: val.TaskCategory,
|
|
|
TaskName: val.TaskName,
|
|
|
TaskAlias: val.TaskAlias,
|
|
|
TaskLeader: val.TaskLeader.Name,
|
|
|
AssistLevel: val.AssistLevel,
|
|
|
AssistContent: val.AssistContent,
|
|
|
TaskStageCheck: adapter.TaskStage{
|
|
|
Id: val.Id,
|
|
|
Name: val.TaskStageCheck.Name,
|
|
|
StatusDescription: val.TaskStageCheck.StatusDescription(),
|
|
|
SortBy: val.TaskStageCheck.SortBy,
|
|
|
PlanCompletedAt: "",
|
|
|
RealCompletedAt: "",
|
|
|
},
|
|
|
CreatedAt: val.CreatedAt.Local().Format("2006-01-02"),
|
|
|
}
|
|
|
t1 := time.Unix(val.TaskStageCheck.PlanCompletedAt, 0).Local().Format("2006-01-02")
|
|
|
item.TaskStageCheck.PlanCompletedAt = t1
|
|
|
if val.TaskStageCheck.RealCompletedAt > 0 {
|
|
|
t2 := time.Unix(val.TaskStageCheck.RealCompletedAt, 0).Local().Format("2006-01-02")
|
|
|
item.TaskStageCheck.RealCompletedAt = t2
|
|
|
}
|
|
|
resultList = append(resultList, item)
|
|
|
}
|
|
|
result := tool_funs.SimpleWrapGridMap(int64(cnt), resultList)
|
|
|
return result, nil
|
|
|
} |
...
|
...
|
|