正在显示
1 个修改的文件
包含
3 行增加
和
1 行删除
| 1 | package transform | 1 | package transform |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | + "github.com/shopspring/decimal" | ||
| 4 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" | 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/domain" |
| 5 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" | 6 | "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg/models" |
| 6 | ) | 7 | ) |
| 7 | 8 | ||
| 8 | func TransformToCreditAccountDomainModelFromPgModels(creditAccountModel *models.CreditAccount) (*domain.CreditAccount, error) { | 9 | func TransformToCreditAccountDomainModelFromPgModels(creditAccountModel *models.CreditAccount) (*domain.CreditAccount, error) { |
| 10 | + settlementAmount, _ := decimal.NewFromFloatWithExponent(creditAccountModel.SettlementAmount, -2).Float64() | ||
| 9 | return &domain.CreditAccount{ | 11 | return &domain.CreditAccount{ |
| 10 | CreditAccountId: creditAccountModel.CreditAccountId, | 12 | CreditAccountId: creditAccountModel.CreditAccountId, |
| 11 | ActuallyPaidAmount: creditAccountModel.ActuallyPaidAmount, | 13 | ActuallyPaidAmount: creditAccountModel.ActuallyPaidAmount, |
| 12 | CreditAccountOrderNum: creditAccountModel.CreditAccountOrderNum, | 14 | CreditAccountOrderNum: creditAccountModel.CreditAccountOrderNum, |
| 13 | PaymentStatus: creditAccountModel.PaymentStatus, | 15 | PaymentStatus: creditAccountModel.PaymentStatus, |
| 14 | PaymentTime: creditAccountModel.PaymentTime, | 16 | PaymentTime: creditAccountModel.PaymentTime, |
| 15 | - SettlementAmount: creditAccountModel.SettlementAmount, | 17 | + SettlementAmount: settlementAmount, |
| 16 | SettlementTime: creditAccountModel.SettlementTime, | 18 | SettlementTime: creditAccountModel.SettlementTime, |
| 17 | CooperationContractNumber: creditAccountModel.CooperationContractNumber, | 19 | CooperationContractNumber: creditAccountModel.CooperationContractNumber, |
| 18 | Participator: creditAccountModel.Participator, | 20 | Participator: creditAccountModel.Participator, |
-
请 注册 或 登录 后发表评论