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