作者 陈志颖

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

... ... @@ -316,6 +316,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
defer func() {
transactionContext.RollbackTransaction()
}()
var acceptanceTaskService service.AcceptanceTaskService
if value, err := factory.CreateAcceptanceTaskService(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -326,7 +327,7 @@ func (taskService *TaskService) AcceptanceTask(acceptanceTaskCommand *command.Ac
acceptanceTaskService.Subscribe(&subscriber.AbilityServiceSubscriber{})
}
if task, err := acceptanceTaskService.Acceptance(acceptanceTaskCommand.TaskId, acceptanceTaskCommand.Operator, acceptanceTaskCommand.Participators, acceptanceTaskCommand.TaskPercentage, acceptanceTaskCommand.ReferenceResourceScore, acceptanceTaskCommand.SolveReport, acceptanceTaskCommand.SolvePictureUrls, acceptanceTaskCommand.ActualCompletionTime); err != nil {
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 {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
} else {
if err := transactionContext.CommitTransaction(); err != nil {
... ...
... ... @@ -8,5 +8,5 @@ import (
type AcceptanceTaskService interface {
coreDomain.DomainEventPublisher
Acceptance(taskId int64, operatorUid int64, participators []int64, taskPercentage []*domain.TaskPercentageItem, referenceResourceScore []*domain.ReferenceResourceItem, solveReport string, solvePictureUrls []string, actualCompletionTime time.Time) (*domain.Task, error)
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)
}
... ...
... ... @@ -16,7 +16,7 @@ type AcceptanceTaskService struct {
transactionContext *pgTransaction.TransactionContext
}
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) {
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) {
var employeeRepository domain.EmployeeRepository
var taskRepository domain.TaskRepository
var suMoneyTransactionRecordRepository domain.SuMoneyTransactionRecordRepository
... ... @@ -74,7 +74,7 @@ func (service *AcceptanceTaskService) Acceptance(taskId int64, operatorUid int64
participatorInfos = append(participatorInfos, participator.EmployeeInfo)
}
}
if err := task.Acceptance(participatorInfos, taskPercentage, referenceResourceScore, solveReport, solvePictureUrls, actualCompletionTime); err != nil {
if err := task.Acceptance(participatorInfos, suMoney, taskPercentage, referenceResourceScore, solveReport, solvePictureUrls, actualCompletionTime); err != nil {
return nil, err
}
for _, taskPercentageItem := range taskPercentage {
... ...