作者 tangxvhui

调整MarkTaskAnomaly输出

... ... @@ -589,6 +589,10 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
if len(anomalyList) == 0 {
return map[string]interface{}{
"have": false,
"cycleId": "0",
"beginDay": "",
"taskRecordId": "0",
"userId": "0",
}, nil
}
... ... @@ -610,7 +614,14 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
}
// c :找上级 ,
if !(param.MarkType == "a" || param.MarkType == "b") {
return map[string]interface{}{"have": false}, nil
rst := map[string]interface{}{
"have": false,
"cycleId": "0",
"beginDay": "",
"taskRecordId": "0",
"userId": "0",
}
return rst, nil
}
taskId := anomalyData.TaskId
... ... @@ -660,6 +671,8 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
"have": false,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": "0",
"userId": strconv.Itoa(assessList[0].Executor.UserId),
}
return result, nil
}
... ... @@ -671,7 +684,8 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
"have": false,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
"taskRecordId": strconv.Itoa(recordList[0].Id),
"userId": strconv.Itoa(assessList[0].Executor.UserId),
}
return result, nil
}
... ... @@ -679,7 +693,7 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
"have": true,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
"taskRecordId": strconv.Itoa(recordList[0].Id),
"userId": strconv.Itoa(assessList[0].Executor.UserId),
}
return result, nil
... ... @@ -987,6 +1001,10 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
if len(taskList) == 0 {
return map[string]interface{}{
"have": false,
"cycleId": "0",
"beginDay": "",
"taskRecordId": "0",
"userId": "0",
}, nil
}
taskData := taskList[0]
... ... @@ -1013,6 +1031,10 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
if len(anomalyList) == 0 {
return map[string]interface{}{
"have": false,
"cycleId": "0",
"beginDay": "",
"taskRecordId": "0",
"userId": "0",
}, nil
}
for _, val := range anomalyList {
... ... @@ -1048,6 +1070,10 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
if len(assessList) == 0 {
return map[string]interface{}{
"have": false,
"cycleId": "0",
"beginDay": "",
"taskRecordId": "0",
"userId": "0",
}, nil
}
taskRecordReps := factory.CreateTaskRecordRepository(map[string]interface{}{"transactionContext": transactionContext})
... ... @@ -1060,6 +1086,8 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
"have": false,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": "0",
"userId": "0",
}
return result, nil
}
... ... @@ -1073,6 +1101,7 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
"userId": strconv.Itoa(assessList[0].Executor.UserId),
}
return result, nil
}
... ...