作者 陈志颖

fix:修复更新兑换清单功能

... ... @@ -1258,7 +1258,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
}
// 获取兑换清单
person, err := exchangeCashPersonListRepository.FindOne(map[string]interface{}{"id": updateExchangeCashPersonCommand.ListId})
person, err := exchangeCashPersonListRepository.FindOne(map[string]interface{}{"listId": updateExchangeCashPersonCommand.ListId})
if err != nil {
return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
}
... ... @@ -1271,8 +1271,6 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
}
fmt.Print(person, "\n")
var exchangeCashActivityRepository domain.ExchangeActivityRepository
if value, err := factory.CreateExchangeCashActivityRepository(map[string]interface{}{
"transactionContext": transactionContext,
... ... @@ -1310,7 +1308,6 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateExchangeCashActivityCommand.ExchangeCashActivityId)))
}
var cashPoolDao *dao.CashPoolDao
if value, err := factory.CreateCashPoolDao(map[string]interface{}{
"transactionContext": transactionContext,
... ...
... ... @@ -156,7 +156,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
// 系统未兑换现金
cashPool := new(models.CashPool)
if err := tx.Model(cashPool).
Column("exchanged_cash").
ColumnExpr("exchanged_cash").
Where("cash_pool.company_id = ?", companyId).
Order("id DESC").
Limit(1).
... ... @@ -164,7 +164,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
return nil, err
}
if err := tx.Model(cashPool).
Column("un_exchange_cash").
ColumnExpr("un_exchange_cash").
Where("cash_pool.company_id = ?", companyId).
Order("id DESC").
Limit(1).
... ...