正在显示
1 个修改的文件
包含
16 行增加
和
1 行删除
@@ -2486,6 +2486,8 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC | @@ -2486,6 +2486,8 @@ func (cashPoolService *CashPoolService) CreateExchangeCashPerson(createExchangeC | ||
2486 | if err := transactionContext.CommitTransaction(); err != nil { | 2486 | if err := transactionContext.CommitTransaction(); err != nil { |
2487 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 2487 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
2488 | } | 2488 | } |
2489 | + personSaved.ExchangedCash, _ = decimal.NewFromFloatWithExponent(personSaved.ExchangedCash, -2).Float64() | ||
2490 | + personSaved.ExchangedSuMoney, _ = decimal.NewFromFloatWithExponent(personSaved.ExchangedSuMoney, -2).Float64() | ||
2489 | return personSaved, nil | 2491 | return personSaved, nil |
2490 | } | 2492 | } |
2491 | 2493 | ||
@@ -2527,6 +2529,8 @@ func (cashPoolService *CashPoolService) GetExchangeCashPerson(getExchangeCashPer | @@ -2527,6 +2529,8 @@ func (cashPoolService *CashPoolService) GetExchangeCashPerson(getExchangeCashPer | ||
2527 | if err := transactionContext.CommitTransaction(); err != nil { | 2529 | if err := transactionContext.CommitTransaction(); err != nil { |
2528 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 2530 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
2529 | } | 2531 | } |
2532 | + personFound.ExchangedCash, _ = decimal.NewFromFloatWithExponent(personFound.ExchangedCash, -2).Float64() | ||
2533 | + personFound.ExchangedSuMoney, _ = decimal.NewFromFloatWithExponent(personFound.ExchangedSuMoney, -2).Float64() | ||
2530 | return personFound, nil | 2534 | return personFound, nil |
2531 | } | 2535 | } |
2532 | } | 2536 | } |
@@ -2593,7 +2597,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP | @@ -2593,7 +2597,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP | ||
2593 | if err := transactionContext.CommitTransaction(); err != nil { | 2597 | if err := transactionContext.CommitTransaction(); err != nil { |
2594 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 2598 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
2595 | } | 2599 | } |
2596 | - | 2600 | + for i, _ := range people { |
2601 | + people[i].ExchangedSuMoney, _ = decimal.NewFromFloatWithExponent(people[i].ExchangedSuMoney, -2).Float64() | ||
2602 | + people[i].ExchangedCash, _ = decimal.NewFromFloatWithExponent(people[i].ExchangedCash, -2).Float64() | ||
2603 | + } | ||
2597 | return map[string]interface{}{ | 2604 | return map[string]interface{}{ |
2598 | "count": count, | 2605 | "count": count, |
2599 | "people": people, | 2606 | "people": people, |
@@ -2608,6 +2615,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP | @@ -2608,6 +2615,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashPerson(listExchangeCashP | ||
2608 | if err := transactionContext.CommitTransaction(); err != nil { | 2615 | if err := transactionContext.CommitTransaction(); err != nil { |
2609 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 2616 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
2610 | } | 2617 | } |
2618 | + for i, _ := range people { | ||
2619 | + people[i].ExchangedSuMoney, _ = decimal.NewFromFloatWithExponent(people[i].ExchangedSuMoney, -2).Float64() | ||
2620 | + people[i].ExchangedCash, _ = decimal.NewFromFloatWithExponent(people[i].ExchangedCash, -2).Float64() | ||
2621 | + } | ||
2611 | return map[string]interface{}{ | 2622 | return map[string]interface{}{ |
2612 | "count": count, | 2623 | "count": count, |
2613 | "people": people, | 2624 | "people": people, |
@@ -2894,6 +2905,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashPersonById(exportExchang | @@ -2894,6 +2905,10 @@ func (cashPoolService *CashPoolService) ListExchangeCashPersonById(exportExchang | ||
2894 | if err := transactionContext.CommitTransaction(); err != nil { | 2905 | if err := transactionContext.CommitTransaction(); err != nil { |
2895 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) | 2906 | return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) |
2896 | } | 2907 | } |
2908 | + for i, _ := range people { | ||
2909 | + people[i].ExchangedSuMoney, _ = decimal.NewFromFloatWithExponent(people[i].ExchangedSuMoney, -2).Float64() | ||
2910 | + people[i].ExchangedCash, _ = decimal.NewFromFloatWithExponent(people[i].ExchangedCash, -2).Float64() | ||
2911 | + } | ||
2897 | return people, nil | 2912 | return people, nil |
2898 | } | 2913 | } |
2899 | } | 2914 | } |
-
请 注册 或 登录 后发表评论