|
@@ -97,13 +97,13 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
|
@@ -97,13 +97,13 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
97
|
systemExchangedSuMoney := systemSuMoneyStatistics["systemExchangedSuMoney"].(float64) // 平台已兑换素币
|
97
|
systemExchangedSuMoney := systemSuMoneyStatistics["systemExchangedSuMoney"].(float64) // 平台已兑换素币
|
98
|
systemUnExchangeSuMoney := systemSuMoneyStatistics["systemUnExchangeSuMoney"].(float64) // 平台未兑换素币
|
98
|
systemUnExchangeSuMoney := systemSuMoneyStatistics["systemUnExchangeSuMoney"].(float64) // 平台未兑换素币
|
99
|
|
99
|
|
|
|
100
|
+
|
|
|
101
|
+
|
100
|
// 获取当前公司现金池
|
102
|
// 获取当前公司现金池
|
101
|
count, cashPools, err := cashPoolRepository.Find(tool_funs.SimpleStructToMap(createCashPoolCommand))
|
103
|
count, cashPools, err := cashPoolRepository.Find(tool_funs.SimpleStructToMap(createCashPoolCommand))
|
102
|
if err != nil {
|
104
|
if err != nil {
|
103
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
105
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
|
104
|
}
|
106
|
}
|
105
|
- cashPoolExchangeCash := cashPools[0].ExchangedCash
|
|
|
106
|
- cashPoolUnExchangeCash := cashPools[0].UnExchangeCash
|
|
|
107
|
|
107
|
|
108
|
// 不存在现金池
|
108
|
// 不存在现金池
|
109
|
if count == 0 { // 新增现金池
|
109
|
if count == 0 { // 新增现金池
|
|
@@ -132,6 +132,9 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
|
@@ -132,6 +132,9 @@ func (cashPoolService *CashPoolService) CreateCashPool(createCashPoolCommand *co |
132
|
return cashPool, nil
|
132
|
return cashPool, nil
|
133
|
}
|
133
|
}
|
134
|
} else { // 更新现金池
|
134
|
} else { // 更新现金池
|
|
|
135
|
+ cashPoolExchangeCash := cashPools[0].ExchangedCash
|
|
|
136
|
+ cashPoolUnExchangeCash := cashPools[0].UnExchangeCash
|
|
|
137
|
+
|
135
|
if createCashPoolCommand.Cash < cashPoolExchangeCash {
|
138
|
if createCashPoolCommand.Cash < cashPoolExchangeCash {
|
136
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "投入的现金值必须大于当前已兑换现金值")
|
139
|
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "投入的现金值必须大于当前已兑换现金值")
|
137
|
}
|
140
|
}
|