...
|
...
|
@@ -18,22 +18,26 @@ type OperationSuMoneyService struct { |
|
|
func (service *OperationSuMoneyService) Operation(uid int64, operatorUid int64, suMoney float64, operationType int, recordDescription string) (*domain.SuMoneyTransactionRecord, error) {
|
|
|
var employeeRepository domain.EmployeeRepository
|
|
|
var suMoneyTransactionRecordRepository domain.SuMoneyTransactionRecordRepository
|
|
|
|
|
|
var employeeDao *dao.EmployeeDao
|
|
|
if repository, err := repository.NewEmployeeRepository(service.transactionContext); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
employeeRepository = repository
|
|
|
}
|
|
|
|
|
|
if repository, err := repository.NewSuMoneyTransactionRecordRepository(service.transactionContext); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
suMoneyTransactionRecordRepository = repository
|
|
|
}
|
|
|
|
|
|
if dao, err := dao.NewEmployeeDao(service.transactionContext); err != nil {
|
|
|
return nil, err
|
|
|
} else {
|
|
|
employeeDao = dao
|
|
|
}
|
|
|
|
|
|
employee, err := employeeRepository.FindOne(map[string]interface{}{
|
|
|
"uid": uid,
|
|
|
})
|
...
|
...
|
|