From 834eb4db1e8f7b8019b4a46d2c886b7acda8808d Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 15 Dec 2025 15:41:50 +0800 Subject: [PATCH 1/8] =?UTF-8?q?Updata=EF=BC=9A=E5=A2=9E=E5=8A=A0=E6=88=AA?= =?UTF-8?q?=E6=AD=A2=E6=97=B6=E9=97=B4=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/e/msg.go | 5 ++ pkg/service/bundle/bundleMetrics.go | 71 ++++++++++++++++++++++++++--- 2 files changed, 69 insertions(+), 7 deletions(-) diff --git a/pkg/e/msg.go b/pkg/e/msg.go index 7de2193..fec957e 100644 --- a/pkg/e/msg.go +++ b/pkg/e/msg.go @@ -155,6 +155,11 @@ const ( ErrorBalanceInsufficient = "余额不足" ) +const ( + BundlePurchaseExport = 1 + BundleDetailExport = 2 +) + // GetMsg 获取状态码对应信息 func GetMsg(code int) string { msg, ok := MsgFlags[code] diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index 04bd7f8..8b7f8af 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -6,6 +6,7 @@ import ( "fmt" "fonchain-fiee/api/bundle" "fonchain-fiee/api/cast" + "fonchain-fiee/pkg/e" logicCast "fonchain-fiee/pkg/logic/cast" "fonchain-fiee/pkg/model/login" "fonchain-fiee/pkg/service" @@ -32,7 +33,7 @@ func MetricsBusiness(ctx *gin.Context) { } resp, err := service.BundleProvider.MetricsBusiness(ctx, &req) if err != nil { - service.Error(ctx, err) + service.Error(ctx, errors.New(common.MetricsBusinessFailed)) return } service.Success(ctx, resp) @@ -133,8 +134,8 @@ func MetricsBundlePurchaseExport(ctx *gin.Context) { } if err := exportStructToExcel(resp.Data, []string{ - "订单编号", "套餐", "用户编号", "客户姓名", "手机号", "支付时间", "增值视频数", "套餐金额", "增值金额", "支付金额", "结算金额", "手续费", "汇率(%)", - }, filePath, statistic); err != nil { + "订单编号", "套餐", "用户编号", "客户姓名", "手机号", "支付时间", "套餐视频数", "增值视频数", "套餐金额", "增值金额", "支付金额", "结算金额", "手续费", "汇率(%)", + }, filePath, e.BundlePurchaseExport, req.EndTime, statistic); err != nil { service.Error(ctx, errors.New(common.MetricsBundlePurchaseExportFailed)) return } @@ -441,7 +442,7 @@ func MetricsBalanceDetailExport(ctx *gin.Context) { "所属月份", "用户编号", "姓名", "手机号", "购买套餐时间", "套餐金额", "增值金额", "支付金额", "币种", "手续费", "套餐视频总数", "增值视频总数", "套餐视频单价", "增值视频单价", "当前需要上传套餐视频数", "当前需要上传增值视频数", "当前已上传套餐视频数", "当前已上传增值视频数", "当前套餐视频已消费总金额", "当前增值视频已消费总金额", - }, filePath, yelloStyle, statistic); err != nil { + }, filePath, e.BundleDetailExport, "", statistic); err != nil { service.Error(ctx, errors.New(common.MetricsBalanceDetailExportFailed)) return } @@ -518,11 +519,28 @@ func BalanceMetricsExport(ctx *gin.Context) { }) } -func exportStructToExcel[T any](data []T, headers []string, filename string, fns ...func(data []T, headers []string, f *excelize.File)) error { +func exportStructToExcel[T any](data []T, headers []string, filename string, exportType int, endTime string, fns ...func(data []T, headers []string, f *excelize.File)) error { f := excelize.NewFile() sheet := f.GetSheetName(f.GetActiveSheetIndex()) + // 创建黄色背景样式(用于截止行) + yellowStyle, err := f.NewStyle(&excelize.Style{ + Fill: excelize.Fill{ + Type: "pattern", + Color: []string{"#FFFF00"}, // 黄色 + Pattern: 1, // 实心填充 + }, + Alignment: &excelize.Alignment{ + Horizontal: "center", + Vertical: "center", + }, + }) + if err != nil { + // 如果创建样式失败,继续执行但不应用样式 + yellowStyle = 0 + } + // 写入表头 for i, h := range headers { cell, _ := excelize.CoordinatesToCellName(i+1, 1) @@ -546,12 +564,50 @@ func exportStructToExcel[T any](data []T, headers []string, filename string, fns } // 写入数据 - for rowIdx, item := range data { + actualRowIdx := 0 + for _, item := range data { val := reflect.ValueOf(item) if val.Kind() == reflect.Ptr { val = val.Elem() } + if exportType == e.BundlePurchaseExport { + if endTime != "" { + // 通过反射获取 PayTime 字段 + payTimeField := val.FieldByName("PayTime") + if payTimeField.IsValid() && payTimeField.Kind() == reflect.String { + payTimeStr := payTimeField.String() + if payTimeStr != "" { + // 解析时间 + endTimeParsed, err1 := time.Parse(time.DateTime, endTime) + payTimeParsed, err2 := time.Parse(time.DateTime, payTimeStr) + + if err1 == nil && err2 == nil { + // 如果 endTime <= PayTime,需要插入截止行 + if !endTimeParsed.After(payTimeParsed) { + // 格式化截止时间显示 + endTimeFormatted := endTimeParsed.Format("2006年01月02日15点") + // 在当前行写入"截止xxxx年xx月xx点" + cell, _ := excelize.CoordinatesToCellName(1, actualRowIdx+2) + f.SetCellValue(sheet, cell, fmt.Sprintf("截止%s", endTimeFormatted)) + // 应用黄色背景样式 + if yellowStyle > 0 { + // 合并整行的单元格以显示截止信息 + lastCol, _ := excelize.ColumnNumberToName(len(headers)) + startCell := cell + endCell := fmt.Sprintf("%s%d", lastCol, actualRowIdx+2) + f.MergeCell(sheet, startCell, endCell) + f.SetCellStyle(sheet, startCell, endCell, yellowStyle) + } + // 移动到下一行 + actualRowIdx++ + } + } + } + } + } + } + for colIdx, fieldIdx := range exportedFields { field := val.Field(fieldIdx) @@ -563,9 +619,10 @@ func exportStructToExcel[T any](data []T, headers []string, filename string, fns cellValue = field.Interface() } - cell, _ := excelize.CoordinatesToCellName(colIdx+1, rowIdx+2) + cell, _ := excelize.CoordinatesToCellName(colIdx+1, actualRowIdx+2) f.SetCellValue(sheet, cell, cellValue) } + actualRowIdx++ } } From 46860506bc7ae3b02aa0d91feecf7b23537b5d48 Mon Sep 17 00:00:00 2001 From: JNG <365252428@qq.com> Date: Mon, 15 Dec 2025 15:44:51 +0800 Subject: [PATCH 2/8] Update bundleOrder.go --- pkg/service/bundle/bundleOrder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/service/bundle/bundleOrder.go b/pkg/service/bundle/bundleOrder.go index a61247c..2ed4638 100644 --- a/pkg/service/bundle/bundleOrder.go +++ b/pkg/service/bundle/bundleOrder.go @@ -627,7 +627,7 @@ func GetDocumentTypeText(documentType int32) string { case 6: return "社保卡" default: - return strconv.Itoa(int(documentType)) + return "" } } func OrderRecordsList(c *gin.Context) { From 37a27654fee2333f66f7bddaf570e983b490e53a Mon Sep 17 00:00:00 2001 From: JNG <365252428@qq.com> Date: Mon, 15 Dec 2025 15:47:17 +0800 Subject: [PATCH 3/8] 11 --- pkg/service/bundle/common/msg.go | 156 +++++++++++++++++++++++++------ pkg/service/bundle/pay.go | 13 ++- 2 files changed, 136 insertions(+), 33 deletions(-) diff --git a/pkg/service/bundle/common/msg.go b/pkg/service/bundle/common/msg.go index 10a1df4..2bc6eea 100644 --- a/pkg/service/bundle/common/msg.go +++ b/pkg/service/bundle/common/msg.go @@ -2,9 +2,53 @@ package common // 套餐 const ( - MissBundleUUID = "缺少套餐UUID" - MissOrderSignature = "缺少客户签名信息" - ErrorInsertSignature = "插入签名失败" + MissBundleUUID = "缺少套餐UUID" + MissOrderSignature = "缺少客户签名信息" + ErrorInsertSignature = "插入签名失败" + CreateValueAddBundleFailed = "创建增值套餐失败" + ValueAddBundleListFailed = "增值套餐列表查询失败" + ValueAddBundleDetailFailed = "增值套餐详情查询失败" + SaveValueAddServiceFailed = "保存增值套餐失败" + ValueAddServiceListFailed = "套餐服务列表查询失败" + ValueAddServiceDetailFailed = "套餐服务详情查询失败" + ValueAddServiceLangDetailFailed = "套餐服务语言详情查询失败" + CreateBundleFailed = "创建套餐失败" + UpdateBundleFailed = "更新套餐失败" + DeleteBundleFailed = "删除套餐失败" + BundleListFailed = "套餐列表查询失败" + BundleDetailFailed = "套餐详情查询失败" + HandShelfFailed = "更新套餐上下架失败" + OnlyAddValueListByOrderNoFailed = "根据订单号查询增值套餐失败" +) + +//官网报告 +const ( + ErrorCreateReportFailed = "创建官网报告失败" + ErrorDeleteReportFailed = "删除官网报告失败" + ErrorListReportFailed = "官网报告列表查询失败" + ErrorEditReportFailed = "编辑官网报告失败" + ErrorDisplayReportFailed = "显示官网报告失败" +) + +//官网成员管理 +const ( + ErrorCreateMemberFailed = "创建官网成员失败" + ErrorDeleteMemberFailed = "删除官网成员失败" + ErrorListMemberFailed = "官网成员列表查询失败" + ErrorEditMemberFailed = "编辑官网成员失败" + ErrorDisplayMemberFailed = "显示官网成员失败" + ErrorEditBoardOfDirectorsFailed = "编辑董事会成员失败" + ErrorEditCommitteeAppointmentsFailed = "编辑委员会成员失败" + ErrorDisplayCommitteeAppointmentsFailed = "显示委员会成员失败" + ErrorEditManagementFailed = "编辑管理员失败" + ErrorDisplayManagementFailed = "显示管理员失败" + ErrorDisplayBoardOfDirectorsFailed = "显示董事会成员失败" +) + +//官网邮箱通知 +const ( + ErrorEmailAlertSubmitFailed = "提交邮箱通知失败" + ErrorGetEmailInformationListFailed = "获取邮箱通知列表失败" ) // 订单 @@ -55,31 +99,81 @@ const ( BundleUnBindingAddService = "套餐未绑定增值服务" ) -/*var EnMessages = map[string]string{ - "创建套餐信息失败": "Failed to create bundle information", - "创建套餐信息成功": "Successfully created bundle information", - "更新套餐信息失败": "Failed to update bundle information", - "更新套餐信息成功": "Successfully updated bundle information", - "删除套餐信息失败": "Failed to delete bundle information", - "删除套餐信息成功": "Successfully deleted bundle information", - "获取套餐列表失败": "Failed to get bundle list", - "获取套餐信息失败": "Failed to get bundle information", - "创建订单信息失败": "Failed to create order information", - "创建订单信息成功": "Successfully created order information", - "更新订单信息失败": "Failed to update order information", - "更新订单信息成功": "Successfully updated order information", - "获取订单信息失败": "Failed to get order information", - "获取订单列表失败": "Failed to get order list", - "缺少套餐UUID": "Missing bundle UUID", - "缺少客户签名信息": "Missing customer signature", - "插入签名失败": "Failed to insert signature", - "缺少订单号": "Missing order number", - "缺少订单信息": "Missing order information", - "非当前用户订单信息不可操作": "Cannot operate on order information of other users", - "订单已支付": "Order has been paid", - "您已购买过套餐,无法再次购买": "You have already purchased this bundle and cannot purchase again", - "查询支付信息失败": "Failed to query payment information", - "下载文件失败": "Failed to download file", - "上传文件失败": "Failed to upload file", - "时间格式错误": "Invalid time format", -}*/ +//发布 +const ( + UpdateWorkStatusFailed = "更新作品状态失败" + GetWorkDetailFailed = "获取作品详情失败" +) + +//余量 +const ( + BundleExtendFailed = "套餐扩展失败" + BundleExtendRecordsListFailed = "套餐扩展记录列表查询失败" + GetBundleBalanceListFailed = "套餐余额列表查询失败" + GetUsedRecordListFailed = "套餐使用记录列表查询失败" + GetUserBalanceFailed = "套餐余额查询失败" + ToBeComfirmedWorksFailed = "待确认作品列表查询失败" + ConfirmWorkFailed = "确认消耗余量失败" + AddBundleBalanceFailed = "添加消耗余量失败" + BundleActivateFailed = "套餐激活失败" + BundleExportFailed = "套餐余量导出失败" + SetBalanceLayoutFailed = "设置套餐余额布局失败" + GetBalanceLayoutFailed = "获取套餐余额布局失败" + InsufficientBalance = "余量不足" +) + +//数据指标 +const ( + MetricsBusinessFailed = "业务概览查询失败" + MetricsOperatingFailed = "运营数据查询失败" + MetricsBundlePurchaseExportFailed = "套餐购买数据导出失败" + MetricsArtistAccountExportFailed = "艺人账号数据导出失败" + MetricsVideoSubmitExportFailed = "视频上传数据导出失败" + MetricsBalanceDetailExportFailed = "服务使用明细数据导出失败" + BalanceMetricsExportFailed = "服务使用明细数据导出失败" +) + +//素材库 +const ( + FileListFailed = "素材库列表查询失败" + FileUsageFailed = "素材库使用情况查询失败" + GetFileInfoFailed = "素材库文件信息查询失败" + CreateFileFailed = "素材库文件创建失败" + DeleteFileFailed = "素材库文件删除失败" + SearchFileFailed = "素材库文件搜索失败" + UploadFileFailed = "素材库文件上传失败" + TusCreateFailed = "素材库文件创建失败" + TusUploadFailed = "素材库文件上传失败" + PreviewFileFailed = "素材库文件预览失败" + ActionFailed = "素材库文件操作失败" + DirDownloadFailed = "素材库文件下载失败" + InvalidUploadOffset = "无效的上传偏移量" + ERROR_OPEN_FILE = "打开文件错误" +) + +//官网 +const ( + CreateSecFilingFailed = "创建官方信息失败" + UpdateSecFilingFailed = "更新官方信息失败" + UpdateSecFilingStatusFailed = "更新官方信息状态失败" + ListSecFilingFailed = "官方信息列表查询失败" + DetailSecFilingFailed = "官方信息详情查询失败" + DeleteSecFilingFailed = "删除官方信息失败" + FilingDateIsEmpty = "数据信息为空" + GetSecFilingsFailed = "获取官方信息失败" + GetFormListFailed = "获取官方信息类型失败" + WebListSecFilingFailed = "官网官方信息列表查询失败" + + CreateGovernanceFailed = "创建治理信息失败" + DeleteGovernanceFailed = "删除治理信息失败" + ListGovernanceFailed = "治理信息列表查询失败" + EditGovernanceFailed = "编辑治理信息失败" + DisplayGovernanceFailed = "显示治理信息失败" + + CreatePressReleasesFailed = "创建新闻发布失败" + DeletePressReleasesFailed = "删除新闻发布失败" + ListPressReleasesFailed = "新闻发布列表查询失败" + EditPressReleasesFailed = "编辑新闻发布失败" + DisplayPressReleasesFailed = "显示新闻发布失败" + GetPressReleasesFailed = "获取新闻发布失败" +) diff --git a/pkg/service/bundle/pay.go b/pkg/service/bundle/pay.go index da73930..ba16b4c 100644 --- a/pkg/service/bundle/pay.go +++ b/pkg/service/bundle/pay.go @@ -2,7 +2,6 @@ package bundle import ( "context" - "dubbo.apache.org/dubbo-go/v3/common/logger" "encoding/json" "errors" "fmt" @@ -10,6 +9,7 @@ import ( "fonchain-fiee/api/bundle" "fonchain-fiee/api/order" "fonchain-fiee/api/payment" + "fonchain-fiee/pkg/cache" "fonchain-fiee/pkg/config" "fonchain-fiee/pkg/model/login" "fonchain-fiee/pkg/service" @@ -19,6 +19,9 @@ import ( "math" "net/http" "strconv" + "time" + + "dubbo.apache.org/dubbo-go/v3/common/logger" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" @@ -141,7 +144,13 @@ func CreateAntomPay(c *gin.Context) { // 获取 用户信息 userInfo := login.GetUserInfoFromC(c) - + // 创建审批 防止重复提交 + lockKey := fmt.Sprintf("create_antom_pay_%v", userInfo.ID) + reply := cache.RedisClient.SetNX(lockKey, 0, 5*time.Second) + if !reply.Val() { + service.Error(c, errors.New(common.CreateBundleFailed)) + return + } // outTradeNo就是orderNo,根据这个去查询子表的source,如果是2就时单独的子套餐,如果是1就是主套餐 orderLimit, err := service.BundleProvider.OrderListByOrderNo(context.Background(), &bundle.OrderInfoByOrderNoRequest{ OrderNo: req.OutTradeNo, From caef081ab6d9cf2945f537a27e8d624f4a163ca5 Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 15 Dec 2025 15:49:23 +0800 Subject: [PATCH 4/8] =?UTF-8?q?Updata=EF=BC=9A=E6=9B=B4=E6=96=B0=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/bundleMetrics.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index 8b7f8af..b4dbe61 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -134,7 +134,7 @@ func MetricsBundlePurchaseExport(ctx *gin.Context) { } if err := exportStructToExcel(resp.Data, []string{ - "订单编号", "套餐", "用户编号", "客户姓名", "手机号", "支付时间", "套餐视频数", "增值视频数", "套餐金额", "增值金额", "支付金额", "结算金额", "手续费", "汇率(%)", + "订单编号", "套餐", "用户编号", "客户姓名", "手机号", "支付时间", "增值视频数", "套餐金额", "增值金额", "支付金额", "结算金额", "手续费", "汇率(%)", }, filePath, e.BundlePurchaseExport, req.EndTime, statistic); err != nil { service.Error(ctx, errors.New(common.MetricsBundlePurchaseExportFailed)) return From 7fe45642a7b83b20251198f48febc15e0db326ad Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 15 Dec 2025 15:57:05 +0800 Subject: [PATCH 5/8] =?UTF-8?q?Updata=EF=BC=9A=E4=BF=AE=E6=AD=A3bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/bundleMetrics.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index b4dbe61..55be497 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -565,6 +565,7 @@ func exportStructToExcel[T any](data []T, headers []string, filename string, exp // 写入数据 actualRowIdx := 0 + flag := 0 for _, item := range data { val := reflect.ValueOf(item) if val.Kind() == reflect.Ptr { @@ -584,7 +585,8 @@ func exportStructToExcel[T any](data []T, headers []string, filename string, exp if err1 == nil && err2 == nil { // 如果 endTime <= PayTime,需要插入截止行 - if !endTimeParsed.After(payTimeParsed) { + if !endTimeParsed.After(payTimeParsed) && flag == 0 { + flag = 1 // 格式化截止时间显示 endTimeFormatted := endTimeParsed.Format("2006年01月02日15点") // 在当前行写入"截止xxxx年xx月xx点" From e3b4dd4b85c893d57de70aaf4a8fccf161e4fd9e Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 15 Dec 2025 16:03:16 +0800 Subject: [PATCH 6/8] =?UTF-8?q?Updata=EF=BC=9A=E8=B0=83=E6=95=B4=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/bundleMetrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index 55be497..cd206ae 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -532,7 +532,7 @@ func exportStructToExcel[T any](data []T, headers []string, filename string, exp Pattern: 1, // 实心填充 }, Alignment: &excelize.Alignment{ - Horizontal: "center", + Horizontal: "left", Vertical: "center", }, }) @@ -588,7 +588,7 @@ func exportStructToExcel[T any](data []T, headers []string, filename string, exp if !endTimeParsed.After(payTimeParsed) && flag == 0 { flag = 1 // 格式化截止时间显示 - endTimeFormatted := endTimeParsed.Format("2006年01月02日15点") + endTimeFormatted := endTimeParsed.Format("2006年01月02日15点04分") // 在当前行写入"截止xxxx年xx月xx点" cell, _ := excelize.CoordinatesToCellName(1, actualRowIdx+2) f.SetCellValue(sheet, cell, fmt.Sprintf("截止%s", endTimeFormatted)) From 85daee28e730b7232f4910a91289b2e66fd0210c Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 15 Dec 2025 16:09:00 +0800 Subject: [PATCH 7/8] =?UTF-8?q?Updata=EF=BC=9A=E4=BF=AE=E6=94=B9=E8=A1=A8?= =?UTF-8?q?=E6=A0=BC=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/bundleMetrics.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index cd206ae..0d3e062 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -98,13 +98,13 @@ func MetricsBundlePurchaseExport(ctx *gin.Context) { sumFee = sumFee.Add(decimal.NewFromFloat(float64(i.FeeAmount))) } - f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow), "合计支付金额(美元)") - 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), "合计支付金额(美元)") + f.SetCellValue(sheet, fmt.Sprintf("B%d", endRow+1), "合计结算金额(美元)") + f.SetCellValue(sheet, fmt.Sprintf("C%d", endRow+1), "合计手续费金额(美元)") - f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow+1), "$"+sumPayment.StringFixed(2)) - f.SetCellValue(sheet, fmt.Sprintf("B%d", endRow+1), "$"+sumFinal.StringFixed(2)) - f.SetCellValue(sheet, fmt.Sprintf("C%d", endRow+1), "$"+sumFee.StringFixed(2)) + f.SetCellValue(sheet, fmt.Sprintf("A%d", endRow+2), "$"+sumPayment.StringFixed(2)) + f.SetCellValue(sheet, fmt.Sprintf("B%d", endRow+2), "$"+sumFinal.StringFixed(2)) + f.SetCellValue(sheet, fmt.Sprintf("C%d", endRow+2), "$"+sumFee.StringFixed(2)) // 创建黑色边框样式 borderStyle, err := f.NewStyle(&excelize.Style{ From 8fea74b9e900f715a5c962c7be531a1028fb3811 Mon Sep 17 00:00:00 2001 From: "jiaji.H" Date: Mon, 15 Dec 2025 16:13:03 +0800 Subject: [PATCH 8/8] =?UTF-8?q?Updata=EF=BC=9A=E6=9B=B4=E6=96=B0=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/service/bundle/bundleMetrics.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/service/bundle/bundleMetrics.go b/pkg/service/bundle/bundleMetrics.go index 0d3e062..2b719c0 100644 --- a/pkg/service/bundle/bundleMetrics.go +++ b/pkg/service/bundle/bundleMetrics.go @@ -125,8 +125,8 @@ func MetricsBundlePurchaseExport(ctx *gin.Context) { } // 应用样式到合计区域(包括标题行和数值行) - startCell := fmt.Sprintf("A%d", endRow) - endCell := fmt.Sprintf("C%d", endRow+1) + startCell := fmt.Sprintf("A%d", endRow+1) + endCell := fmt.Sprintf("C%d", endRow+2) if err := f.SetCellStyle(sheet, startCell, endCell, borderStyle); err != nil { fmt.Println("设置边框样式失败:", err) }