作者 linmadan

修复驳回任务后,任务人还显示的bug

... ... @@ -58,14 +58,16 @@ func (service *RejectTaskReceiverService) Reject(taskId int64, operatorUid int64
if err := task.RejectReceiver(); err != nil {
return nil, err
}
rejectTaskRecord := &domain.RejectTaskRecord{
newRejectTaskRecord := &domain.RejectTaskRecord{
Task: task,
Operator: operator.EmployeeInfo,
RejectReason: rejectReason,
CreateTime: time.Now(),
}
if _, err := rejectTaskRecordRepository.Save(rejectTaskRecord); err != nil {
if rejectTaskRecord, err := rejectTaskRecordRepository.Save(newRejectTaskRecord); err != nil {
return nil, err
} else {
newRejectTaskRecord = rejectTaskRecord
}
if task, err := taskRepository.Save(task); err != nil {
return nil, err
... ... @@ -80,7 +82,7 @@ func (service *RejectTaskReceiverService) Reject(taskId int64, operatorUid int64
taskRejectedEvent.TaskStatus = task.TaskStatus
taskRejectedEvent.RobInfo = task.RobInfo
taskRejectedEvent.BidInfo = task.BidInfo
taskRejectedEvent.RejectTaskRecord = rejectTaskRecord
taskRejectedEvent.RejectTaskRecord = newRejectTaskRecord
if err := service.Publish(taskRejectedEvent); err != nil {
return nil, err
}
... ...
... ... @@ -45,6 +45,9 @@ func (repository *TaskRepository) Save(task *domain.Task) (*domain.Task, error)
if task.BidInfo != nil && task.BidInfo.SuccessfulBidder != nil {
taskReceiverUid = task.BidInfo.SuccessfulBidder.Uid
}
if (task.RobInfo == nil || task.RobInfo.Receiver == nil) && (task.BidInfo == nil || task.BidInfo.SuccessfulBidder == nil) {
taskReceiverUid = 0
}
if _, err := tx.QueryOne(
pg.Scan(&task.TaskId, &task.CompanyId, &task.TaskName, &task.TaskType, &task.Sponsor, &task.TaskStatus, &task.ReferenceResource, &task.ProjectBelong, pg.Array(&task.CustomerValues), &task.TaskNature, &task.SuMoney, &task.AcceptanceStandard, &task.TaskDescription, pg.Array(&task.TaskPictureUrls), &task.IsRewardTake, &task.CreateTime, &task.ReleaseTime, &task.Participators, &task.TaskPercentage, &task.SolveReport, pg.Array(&task.SolvePictureUrls), &task.AssignedPerson, &task.PlannedCompletionTime, &task.ActualCompletionTime, &task.ReceiveTime, &task.CompleteTime, &task.AcceptanceTime),
"UPDATE tasks SET company_id=?, task_name=?, task_type=?, sponsor=?, task_status=?, reference_resource=?, project_belong=?, customer_values=?, task_nature=?, su_money=?, acceptance_standard=?, task_description=?, task_picture_urls=?, is_reward_take=?, receiver_uid=?, create_time=?, release_time=?, participators=?, task_percentage=?, solve_report=?, solve_picture_urls=?, assigned_person=?, planned_completion_time=?, actual_completion_time=?, receive_time=?, complete_time=?, acceptance_time=? WHERE id=? RETURNING id, company_id, task_name, task_type, sponsor, task_status, reference_resource, project_belong, customer_values, task_nature, su_money, acceptance_standard, task_description, task_picture_urls, is_reward_take, create_time, release_time, participators, task_percentage, solve_report, solve_picture_urls, assigned_person, planned_completion_time, actual_completion_time, receive_time, complete_time, acceptance_time",
... ...