From 1b61242847bc74594fe0f5c4afe2a5add91cf305 Mon Sep 17 00:00:00 2001 From: lzh <1625167628@qq.com> Date: Fri, 7 Nov 2025 13:44:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/bundle/bundle.pb.go | 6 +++--- api/bundle/bundle.validator.pb.go | 2 +- pkg/service/bundle/bundleMetrics.go | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/api/bundle/bundle.pb.go b/api/bundle/bundle.pb.go index 3de5546..53c5414 100644 --- a/api/bundle/bundle.pb.go +++ b/api/bundle/bundle.pb.go @@ -12291,7 +12291,7 @@ type MetricsBundlePurchaseItem struct { PaymentAmount float32 `protobuf:"fixed32,11,opt,name=paymentAmount,proto3" json:"paymentAmount,omitempty"` FinalAmount float32 `protobuf:"fixed32,12,opt,name=finalAmount,proto3" json:"finalAmount,omitempty"` FeeAmount float32 `protobuf:"fixed32,13,opt,name=feeAmount,proto3" json:"feeAmount,omitempty"` - Rate float32 `protobuf:"fixed32,14,opt,name=rate,proto3" json:"rate,omitempty"` + Rate int64 `protobuf:"varint,14,opt,name=rate,proto3" json:"rate,omitempty"` } func (x *MetricsBundlePurchaseItem) Reset() { @@ -12417,7 +12417,7 @@ func (x *MetricsBundlePurchaseItem) GetFeeAmount() float32 { return 0 } -func (x *MetricsBundlePurchaseItem) GetRate() float32 { +func (x *MetricsBundlePurchaseItem) GetRate() int64 { if x != nil { return x.Rate } @@ -15470,7 +15470,7 @@ var file_pb_bundle_proto_rawDesc = []byte{ 0x6e, 0x61, 0x6c, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x66, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x66, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x74, 0x65, 0x18, - 0x0e, 0x20, 0x01, 0x28, 0x02, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x22, 0x35, 0x0a, 0x1d, 0x4d, + 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x72, 0x61, 0x74, 0x65, 0x22, 0x35, 0x0a, 0x1d, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x45, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x6e, 0x74, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6d, 0x6f, 0x6e, diff --git a/api/bundle/bundle.validator.pb.go b/api/bundle/bundle.validator.pb.go index 58c37aa..2bbb41c 100644 --- a/api/bundle/bundle.validator.pb.go +++ b/api/bundle/bundle.validator.pb.go @@ -7,8 +7,8 @@ import ( fmt "fmt" math "math" proto "github.com/golang/protobuf/proto" - _ "google.golang.org/protobuf/types/descriptorpb" _ "github.com/mwitkow/go-proto-validators" + _ "google.golang.org/protobuf/types/descriptorpb" github_com_mwitkow_go_proto_validators "github.com/mwitkow/go-proto-validators" ) diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index 9e33a49..589b5b1 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -83,9 +83,9 @@ func MetricsBundlePurchaseExport(ctx *gin.Context) { f.SetCellValue(sheet, fmt.Sprintf("B%d", endRow), "合计结算金额(美元)") f.SetCellValue(sheet, fmt.Sprintf("C%d", endRow), "合计手续费金额(美元)") - f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow+1), fmt.Sprintf("%.2f", lo.SumBy(data, func(i *bundle.MetricsBundlePurchaseItem) float32 { return i.PaymentAmount }))) - f.SetCellValue(sheet, fmt.Sprintf("B%d", endRow+1), fmt.Sprintf("%.2f", lo.SumBy(data, func(i *bundle.MetricsBundlePurchaseItem) float32 { return i.FinalAmount }))) - f.SetCellValue(sheet, fmt.Sprintf("C%d", endRow+1), fmt.Sprintf("%.2f", lo.SumBy(data, func(i *bundle.MetricsBundlePurchaseItem) float32 { return i.FeeAmount }))) + f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow+1), fmt.Sprintf("$%.2f", lo.SumBy(data, func(i *bundle.MetricsBundlePurchaseItem) float32 { return i.PaymentAmount }))) + f.SetCellValue(sheet, fmt.Sprintf("B%d", endRow+1), fmt.Sprintf("$%.2f", lo.SumBy(data, func(i *bundle.MetricsBundlePurchaseItem) float32 { return i.FinalAmount }))) + f.SetCellValue(sheet, fmt.Sprintf("C%d", endRow+1), fmt.Sprintf("$%.2f", lo.SumBy(data, func(i *bundle.MetricsBundlePurchaseItem) float32 { return i.FeeAmount }))) // 创建黑色边框样式 borderStyle, err := f.NewStyle(&excelize.Style{ Border: []excelize.Border{