...
|
...
|
@@ -45,13 +45,21 @@ func (service *ApplyCompleteTaskService) ApplyComplete(taskId int64, receiverUid |
|
|
return nil, fmt.Errorf("无效的任务")
|
|
|
}
|
|
|
if task.TaskType == domain.TASK_TYPE_ROB {
|
|
|
if receiver.EmployeeInfo.Uid != task.RobInfo.Receiver.Uid {
|
|
|
return nil, fmt.Errorf("无法申请完成别人领取的任务")
|
|
|
if task.RobInfo.Receiver != nil {
|
|
|
if receiver.EmployeeInfo.Uid != task.RobInfo.Receiver.Uid {
|
|
|
return nil, fmt.Errorf("无法申请完成别人领取的任务")
|
|
|
}
|
|
|
} else {
|
|
|
return nil, fmt.Errorf("无法申请完成任务,任务可能已经被驳回")
|
|
|
}
|
|
|
}
|
|
|
if task.TaskType == domain.TASK_TYPE_BID {
|
|
|
if receiver.EmployeeInfo.Uid != task.BidInfo.SuccessfulBidder.Uid {
|
|
|
return nil, fmt.Errorf("无法申请完成别人领取的任务")
|
|
|
if task.BidInfo.SuccessfulBidder != nil {
|
|
|
if receiver.EmployeeInfo.Uid != task.BidInfo.SuccessfulBidder.Uid {
|
|
|
return nil, fmt.Errorf("无法申请完成别人领取的任务")
|
|
|
}
|
|
|
} else {
|
|
|
return nil, fmt.Errorf("无法申请完成任务,任务可能已经被驳回")
|
|
|
}
|
|
|
}
|
|
|
if err := task.ApplyComplete(); err != nil {
|
...
|
...
|
|