作者 tangxvhui

调整数据输出

... ... @@ -666,11 +666,21 @@ func (srv TaskService) MarkTaskAnomaly(param *command.MarkTaskAnomalyCommand) (m
if err := transactionContext.CommitTransaction(); err != nil {
return map[string]interface{}{}, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if assessList[0].Executor.UserId != param.UserId {
result := map[string]interface{}{
"have": false,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
}
return result, nil
}
result := map[string]interface{}{
"have": true,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
"userId": assessList[0].Executor.UserId,
}
return result, nil
}
... ... @@ -1053,14 +1063,25 @@ func (srv TaskService) MarkTaskAnomalyByTask(param *command.MarkTaskAnomalyComma
}
return result, nil
}
if err := transactionContext.CommitTransaction(); err != nil {
return map[string]interface{}{}, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
if assessList[0].Executor.UserId != param.UserId {
result := map[string]interface{}{
"have": false,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
}
return result, nil
}
result := map[string]interface{}{
"have": true,
"cycleId": strconv.FormatInt(assessList[0].CycleId, 10),
"beginDay": today,
"taskRecordId": recordList[0].Id,
"userId": assessList[0].Executor.UserId,
}
return result, nil
}
... ...