...
|
...
|
@@ -62,9 +62,7 @@ func (service *RejectTaskReceiverService) Reject(taskId int64, operatorUid int64 |
|
|
if operator.EmployeeInfo.Uid != task.Sponsor.Uid {
|
|
|
return nil, fmt.Errorf("无效的任务发布者")
|
|
|
}
|
|
|
if err := task.RejectReceiver(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
var beRejectedPerson *domain.EmployeeInfo
|
|
|
newRejectTaskRecord := &domain.RejectTaskRecord{
|
|
|
Task: task,
|
|
|
Operator: operator.EmployeeInfo,
|
...
|
...
|
@@ -72,11 +70,17 @@ func (service *RejectTaskReceiverService) Reject(taskId int64, operatorUid int64 |
|
|
CreateTime: time.Now(),
|
|
|
}
|
|
|
if task.TaskType == domain.TASK_TYPE_ROB {
|
|
|
if task.RobInfo != nil && task.RobInfo.Receiver != nil{
|
|
|
beRejectedPerson = task.RobInfo.Receiver
|
|
|
}
|
|
|
if err := taskDao.DeleteRobInfo(taskId); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
}
|
|
|
if task.TaskType == domain.TASK_TYPE_BID {
|
|
|
if task.BidInfo != nil && task.BidInfo.SuccessfulBidder != nil{
|
|
|
beRejectedPerson = task.BidInfo.SuccessfulBidder
|
|
|
}
|
|
|
if err := taskDao.CancelSuccessfulBidder(taskId); err != nil {
|
|
|
return nil, err
|
|
|
}
|
...
|
...
|
@@ -86,6 +90,9 @@ func (service *RejectTaskReceiverService) Reject(taskId int64, operatorUid int64 |
|
|
} else {
|
|
|
newRejectTaskRecord = rejectTaskRecord
|
|
|
}
|
|
|
if err := task.RejectReceiver(); err != nil {
|
|
|
return nil, err
|
|
|
}
|
|
|
if task, err := taskRepository.Save(task); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
...
|
...
|
@@ -97,8 +104,7 @@ func (service *RejectTaskReceiverService) Reject(taskId int64, operatorUid int64 |
|
|
taskRejectedEvent.TaskType = task.TaskType
|
|
|
taskRejectedEvent.Sponsor = task.Sponsor
|
|
|
taskRejectedEvent.TaskStatus = task.TaskStatus
|
|
|
taskRejectedEvent.RobInfo = task.RobInfo
|
|
|
taskRejectedEvent.BidInfo = task.BidInfo
|
|
|
taskRejectedEvent.BeRejectedPerson = beRejectedPerson
|
|
|
taskRejectedEvent.RejectTaskRecord = newRejectTaskRecord
|
|
|
if err := service.Publish(taskRejectedEvent); err != nil {
|
|
|
return nil, err
|
...
|
...
|
|