作者 陈志颖

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

@@ -1258,7 +1258,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC @@ -1258,7 +1258,7 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
1258 } 1258 }
1259 1259
1260 // 获取兑换清单 1260 // 获取兑换清单
1261 - person, err := exchangeCashPersonListRepository.FindOne(map[string]interface{}{"id": updateExchangeCashPersonCommand.ListId}) 1261 + person, err := exchangeCashPersonListRepository.FindOne(map[string]interface{}{"listId": updateExchangeCashPersonCommand.ListId})
1262 if err != nil { 1262 if err != nil {
1263 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error()) 1263 return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, err.Error())
1264 } 1264 }
@@ -1271,8 +1271,6 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC @@ -1271,8 +1271,6 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
1271 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) 1271 return nil, application.ThrowError(application.BUSINESS_ERROR, err.Error())
1272 } 1272 }
1273 1273
1274 - fmt.Print(person, "\n")  
1275 -  
1276 var exchangeCashActivityRepository domain.ExchangeActivityRepository 1274 var exchangeCashActivityRepository domain.ExchangeActivityRepository
1277 if value, err := factory.CreateExchangeCashActivityRepository(map[string]interface{}{ 1275 if value, err := factory.CreateExchangeCashActivityRepository(map[string]interface{}{
1278 "transactionContext": transactionContext, 1276 "transactionContext": transactionContext,
@@ -1310,7 +1308,6 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC @@ -1310,7 +1308,6 @@ func (cashPoolService *CashPoolService) UpdateExchangeCashPerson(updateExchangeC
1310 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateExchangeCashActivityCommand.ExchangeCashActivityId))) 1308 return nil, application.ThrowError(application.RES_NO_FIND_ERROR, fmt.Sprintf("%s", string(updateExchangeCashActivityCommand.ExchangeCashActivityId)))
1311 } 1309 }
1312 1310
1313 -  
1314 var cashPoolDao *dao.CashPoolDao 1311 var cashPoolDao *dao.CashPoolDao
1315 if value, err := factory.CreateCashPoolDao(map[string]interface{}{ 1312 if value, err := factory.CreateCashPoolDao(map[string]interface{}{
1316 "transactionContext": transactionContext, 1313 "transactionContext": transactionContext,
@@ -156,7 +156,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf @@ -156,7 +156,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
156 // 系统未兑换现金 156 // 系统未兑换现金
157 cashPool := new(models.CashPool) 157 cashPool := new(models.CashPool)
158 if err := tx.Model(cashPool). 158 if err := tx.Model(cashPool).
159 - Column("exchanged_cash"). 159 + ColumnExpr("exchanged_cash").
160 Where("cash_pool.company_id = ?", companyId). 160 Where("cash_pool.company_id = ?", companyId).
161 Order("id DESC"). 161 Order("id DESC").
162 Limit(1). 162 Limit(1).
@@ -164,7 +164,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf @@ -164,7 +164,7 @@ func (dao *EmployeeDao) CalculateSystemCash(companyId int64) (map[string] interf
164 return nil, err 164 return nil, err
165 } 165 }
166 if err := tx.Model(cashPool). 166 if err := tx.Model(cashPool).
167 - Column("un_exchange_cash"). 167 + ColumnExpr("un_exchange_cash").
168 Where("cash_pool.company_id = ?", companyId). 168 Where("cash_pool.company_id = ?", companyId).
169 Order("id DESC"). 169 Order("id DESC").
170 Limit(1). 170 Limit(1).