|
@@ -37,15 +37,6 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
|
@@ -37,15 +37,6 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
37
|
transactionContext.RollbackTransaction()
|
37
|
transactionContext.RollbackTransaction()
|
38
|
}()
|
38
|
}()
|
39
|
|
39
|
|
40
|
- var cashPoolRepository domain.CashPoolRepository
|
|
|
41
|
- if value, err := factory.CreateCashPoolRepository(map[string] interface{} {
|
|
|
42
|
- "transactionContext": transactionContext,
|
|
|
43
|
- }); err != nil {
|
|
|
44
|
- return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
45
|
- } else {
|
|
|
46
|
- cashPoolRepository = value
|
|
|
47
|
- }
|
|
|
48
|
-
|
|
|
49
|
var employeeRepository domain.EmployeeRepository
|
40
|
var employeeRepository domain.EmployeeRepository
|
50
|
if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
|
41
|
if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
|
51
|
"transactionContext": transactionContext,
|
42
|
"transactionContext": transactionContext,
|
|
@@ -105,6 +96,15 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
|
@@ -105,6 +96,15 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
105
|
rate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", systemExchangedCash / systemExchangedSuMoney), 64) // 平均兑换汇率
|
96
|
rate, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", systemExchangedCash / systemExchangedSuMoney), 64) // 平均兑换汇率
|
106
|
}
|
97
|
}
|
107
|
|
98
|
|
|
|
99
|
+ var cashPoolRepository domain.CashPoolRepository
|
|
|
100
|
+ if value, err := factory.CreateCashPoolRepository(map[string] interface{} {
|
|
|
101
|
+ "transactionContext": transactionContext,
|
|
|
102
|
+ }); err != nil {
|
|
|
103
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
104
|
+ } else {
|
|
|
105
|
+ cashPoolRepository = value
|
|
|
106
|
+ }
|
|
|
107
|
+
|
108
|
// 新建现金池
|
108
|
// 新建现金池
|
109
|
newCashPool := &domain.CashPool{
|
109
|
newCashPool := &domain.CashPool{
|
110
|
CompanyId: createCashPoolCommand.CompanyId,
|
110
|
CompanyId: createCashPoolCommand.CompanyId,
|
|
@@ -143,6 +143,26 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC |
|
@@ -143,6 +143,26 @@ func (cashPoolService *CashPoolService) GetCashPool(getCashPoolQuery *query.GetC |
143
|
transactionContext.RollbackTransaction()
|
143
|
transactionContext.RollbackTransaction()
|
144
|
}()
|
144
|
}()
|
145
|
|
145
|
|
|
|
146
|
+ var employeeRepository domain.EmployeeRepository
|
|
|
147
|
+ if value, err := factory.CreateEmployeeRepository(map[string]interface{}{
|
|
|
148
|
+ "transactionContext": transactionContext,
|
|
|
149
|
+ }); err != nil {
|
|
|
150
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
151
|
+ } else {
|
|
|
152
|
+ employeeRepository = value
|
|
|
153
|
+ }
|
|
|
154
|
+
|
|
|
155
|
+ // 增加公司id判断
|
|
|
156
|
+ count, _, err := employeeRepository.Find(map[string]interface{}{
|
|
|
157
|
+ "companyId": getCashPoolQuery.CompanyId,
|
|
|
158
|
+ })
|
|
|
159
|
+ if err != nil {
|
|
|
160
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
|
|
161
|
+ }
|
|
|
162
|
+ if count == 0 {
|
|
|
163
|
+ return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "无效的公司id")
|
|
|
164
|
+ }
|
|
|
165
|
+
|
146
|
var employeeDao *dao.EmployeeDao
|
166
|
var employeeDao *dao.EmployeeDao
|
147
|
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
|
167
|
if value, err := factory.CreateEmployeeDao(map[string]interface{}{
|
148
|
"transactionContext": transactionContext,
|
168
|
"transactionContext": transactionContext,
|