作者 陈志颖

fix:修改验收任务实际素币

@@ -316,6 +316,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac @@ -316,6 +316,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
316 defer func() { 316 defer func() {
317 transactionContext.RollbackTransaction() 317 transactionContext.RollbackTransaction()
318 }() 318 }()
  319 +
319 var acceptanceTaskService service.AcceptanceTaskService 320 var acceptanceTaskService service.AcceptanceTaskService
320 if value, err := factory.CreateAcceptanceTaskService(map[string]interface{}{ 321 if value, err := factory.CreateAcceptanceTaskService(map[string]interface{}{
321 "transactionContext": transactionContext, 322 "transactionContext": transactionContext,
@@ -326,7 +327,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac @@ -326,7 +327,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
326 acceptanceTaskService.Subscribe(&subscriber.AbilityServiceSubscriber{}) 327 acceptanceTaskService.Subscribe(&subscriber.AbilityServiceSubscriber{})
327 } 328 }
328 329
329 - if task, err := acceptanceTaskService.Acceptance(acceptanceTaskCommand.TaskId, acceptanceTaskCommand.Operator, acceptanceTaskCommand.Participators, acceptanceTaskCommand.TaskPercentage, acceptanceTaskCommand.ReferenceResourceScore, acceptanceTaskCommand.SolveReport, acceptanceTaskCommand.SolvePictureUrls, acceptanceTaskCommand.ActualCompletionTime); err != nil { 330 + if task, err := acceptanceTaskService.Acceptance(acceptanceTaskCommand.TaskId, acceptanceTaskCommand.Operator, acceptanceTaskCommand.Participators, acceptanceTaskCommand.SuMoney, acceptanceTaskCommand.TaskPercentage, acceptanceTaskCommand.ReferenceResourceScore, acceptanceTaskCommand.SolveReport, acceptanceTaskCommand.SolvePictureUrls, acceptanceTaskCommand.ActualCompletionTime); err != nil {
330 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 331 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
331 } else { 332 } else {
332 if err := transactionContext.CommitTransaction(); err != nil { 333 if err := transactionContext.CommitTransaction(); err != nil {
@@ -8,5 +8,5 @@ import ( @@ -8,5 +8,5 @@ import (
8 8
9 type AcceptanceTaskService interface { 9 type AcceptanceTaskService interface {
10 coreDomain.DomainEventPublisher 10 coreDomain.DomainEventPublisher
11 - Acceptance(taskId int64, operatorUid int64, participators []int64, taskPercentage []*domain.TaskPercentageItem, referenceResourceScore []*domain.ReferenceResourceItem, solveReport string, solvePictureUrls []string, actualCompletionTime time.Time) (*domain.Task, error) 11 + Acceptance(taskId int64, operatorUid int64, participators []int64, suMoney float64, taskPercentage []*domain.TaskPercentageItem, referenceResourceScore []*domain.ReferenceResourceItem, solveReport string, solvePictureUrls []string, actualCompletionTime time.Time) (*domain.Task, error)
12 } 12 }
@@ -16,7 +16,7 @@ type AcceptanceTaskService struct { @@ -16,7 +16,7 @@ type AcceptanceTaskService struct {
16 transactionContext *pgTransaction.TransactionContext 16 transactionContext *pgTransaction.TransactionContext
17 } 17 }
18 18
19 -func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64, participators []int64, taskPercentage []*domain.TaskPercentageItem, referenceResourceScore []*domain.ReferenceResourceItem, solveReport string, solvePictureUrls []string, actualCompletionTime time.Time) (*domain.Task, error) { 19 +func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64, participators []int64, suMoney float64, taskPercentage []*domain.TaskPercentageItem, referenceResourceScore []*domain.ReferenceResourceItem, solveReport string, solvePictureUrls []string, actualCompletionTime time.Time) (*domain.Task, error) {
20 var employeeRepository domain.EmployeeRepository 20 var employeeRepository domain.EmployeeRepository
21 var taskRepository domain.TaskRepository 21 var taskRepository domain.TaskRepository
22 var suMoneyTransactionRecordRepository domain.SuMoneyTransactionRecordRepository 22 var suMoneyTransactionRecordRepository domain.SuMoneyTransactionRecordRepository
@@ -74,7 +74,7 @@ func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64 @@ -74,7 +74,7 @@ func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64
74 participatorInfos = append(participatorInfos, participator.EmployeeInfo) 74 participatorInfos = append(participatorInfos, participator.EmployeeInfo)
75 } 75 }
76 } 76 }
77 - if err := task.Acceptance(participatorInfos, taskPercentage, referenceResourceScore, solveReport, solvePictureUrls, actualCompletionTime); err != nil { 77 + if err := task.Acceptance(participatorInfos, suMoney, taskPercentage, referenceResourceScore, solveReport, solvePictureUrls, actualCompletionTime); err != nil {
78 return nil, err 78 return nil, err
79 } 79 }
80 for _, taskPercentageItem := range taskPercentage { 80 for _, taskPercentageItem := range taskPercentage {