作者 tangxvhui

调整 反馈列表的输出

... ... @@ -910,10 +910,14 @@ func (srv TaskService) ReplyTaskStage(transactionContext application.Transaction
"transactionContext": transactionContext,
})
for _, val := range param {
taskData, err := taskRepo.FindOne(map[string]interface{}{"id": val.TaskId})
_, taskDataList, err := taskRepo.Find(map[string]interface{}{"id": val.TaskId})
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务数据"+err.Error())
}
if len(taskDataList) == 0 {
continue
}
taskData := taskDataList[0]
_, stageList, err := taskStageRepo.Find(map[string]interface{}{"taskId": []int{val.TaskId}})
if err != nil {
return application.ThrowError(application.INTERNAL_SERVER_ERROR, "找不到任务里程碑数据"+err.Error())
... ... @@ -975,8 +979,13 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
}
resultList := []adapter.TaskRecordAdapter{}
nowDay := time.Now().Format("2006-01-02")
for _, val := range taskRecordList {
// 跳过今天
createdAtDay := val.CreatedAt.Local().Format("2006-01-02")
if createdAtDay == nowDay {
continue
}
item := adapter.TaskRecordAdapter{
Id: val.Id,
StaffAssessId: val.StaffAssessId,
... ... @@ -995,7 +1004,7 @@ func (srv TaskService) ListTaskRecord(param *command.ListTaskRecordCommand) (map
PlanCompletedAt: "",
RealCompletedAt: "",
},
CreatedAt: val.CreatedAt.Local().Format("2006-01-02"),
CreatedAt: createdAtDay,
}
t1 := time.Unix(val.TaskStageCheck.PlanCompletedAt, 0).Local().Format("2006-01-02")
item.TaskStageCheck.PlanCompletedAt = t1
... ... @@ -1190,6 +1199,7 @@ func (srv TaskService) ListTask3(param *command.SearchTaskCommand) (map[string]i
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务里程碑总数"+err.Error())
}
//反馈异常数
taskAnomalyCnt, err := taskDao.CountTaskAnomalyNotHrbp(condition)
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "统计任务里程碑总数"+err.Error())
... ...
... ... @@ -462,7 +462,7 @@ func (d *TaskDao) TaskAnomalyByLeader(leaderId []string, anomaly int) ([]TaskDat
return result, err
}
// 统计任务异常的数量,以非hrbp角色统计
// 统计任务反馈异常的数量,以非hrbp角色统计
func (d *TaskDao) CountTaskAnomalyNotHrbp(param ListTaskCondition) (int, error) {
task1 := d.catchTaskIdByPermission(param.UserId)
withSql := task1 + ` select count(*)
... ... @@ -487,7 +487,7 @@ func (d *TaskDao) CountTaskAnomalyNotHrbp(param ListTaskCondition) (int, error)
return cnt, err
}
// 统计任务异常的数量,以hrbp角色统计
// 统计任务反馈异常的数量,以hrbp角色统计
func (d *TaskDao) CountTaskAnomalyByHrbp(param ListTaskCondition) (int, error) {
withSql := `with
t_task_ignore as (
... ...
... ... @@ -130,7 +130,9 @@ func (repo *TaskRepository) Find(queryOptions map[string]interface{}) (int, []*d
if val, ok := queryOptions["companyId"]; ok {
query.Where("task.company_id = ?", val)
}
if val, ok := queryOptions["id"]; ok {
query.Where("task.id=?", val)
}
if val, ok := queryOptions["leaderId"]; ok {
query.Where("task.leader->>'id'=?", val)
}
... ...