From f546fad4dc70dd2bcaffda9988d5bded4c8e1232 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Mon, 19 Jan 2026 10:10:36 +0800 Subject: [PATCH 01/11] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=B4=9F?= =?UTF-8?q?=E5=88=A9=E6=B6=A6=E5=88=86=E6=9E=90=E5=92=8C=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index ebebf76..6166634 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -5,9 +5,9 @@ server: ollama: base_url: "http://172.17.0.1:11434" - model: "qwen3-coder:480b-cloud" - generate_model: "qwen3-coder:480b-cloud" - mapping_model: "deepseek-v3.2:cloud" + model: "qwen3:8b" + generate_model: "qwen3:8b" + mapping_model: "qwen3:8b" vl_model: "qwen2.5vl:3b" timeout: "120s" level: "info" From de6783c66e2155a8b3b10d3181af01a897f52fe9 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Mon, 19 Jan 2026 10:10:43 +0800 Subject: [PATCH 02/11] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=B4=9F?= =?UTF-8?q?=E5=88=A9=E6=B6=A6=E5=88=86=E6=9E=90=E5=92=8C=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tmpl/excel_temp/kshj_total_ana.xlsx | Bin 10320 -> 10270 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/tmpl/excel_temp/kshj_total_ana.xlsx b/tmpl/excel_temp/kshj_total_ana.xlsx index c4824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TDd1-?`HEZv6eUh2y^t-*^B5(njsEB$@CpGu8=?E&Mtjg* z^T?fy9Pl}pTbBQ(nLNd4fm+))R(~S&c#JoiRkZIY5@x21S35Hh_aRsG!vr z4780AVIQ#_BceVc86zfr#BPk3T7=il4;n<}7rwFf0EhhGwrzeh%d2l^V-T|rV%|q= zTZFo~o0)qRrU?>rJns0hHV(5M0}&mjP7zJsAL8jRrLHm3h!!n+DUF4r^(WxOM$e z5*E`IXVi`HK0Gmcq%&0YdqDH*&Mj&4*-_UNU#{ z3q)f~TNWlhfj&S3BQ&8?WCo)<0RYnv4-Vmm+gRa@;P~JQmez>@2HhwH>DMOc*cs&HA%8Z zZF`Vkl|`b;;*Wctz}Kdg6s=|!Ks7_pk7=ps-1pp!)ny)d9ZQYo>2A!^X#Uo%&Ufi) zlh#{q=2YIe$>S8d&Qrk+=|yAO>9Rs@T2IrDH0}57@ii^i_|>$yP(#NpdyremnAQ5+ zvSYo_c6O2*I#*xQZ27;qnbGey(vmfK{?je;m#g2i@DDo_0h^O7BtQZLAd_w+G7l&q z003WdWo&aVE^=jTbCb~~DwEkHTLhCG5v!9pCC33!k|s6+cOjEuAsmxbCJ-Dx*z^iz z0RR9o0ssIM000000000103ZMW0E-Tjp$-<4mL@6zG?T$5IsrSA{3bR5Vv{o`KmsBV clXWLu2|g23v^@g=0Ogb0Cp`u;Bme*a0D}}2e*gdg From bb1cfed16043d5cdf856c3dae68b55f33be8b504 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Mon, 19 Jan 2026 10:16:37 +0800 Subject: [PATCH 03/11] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=B4=9F?= =?UTF-8?q?=E5=88=A9=E6=B6=A6=E5=88=86=E6=9E=90=E5=92=8C=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/pkg/utils_ollama/client.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/pkg/utils_ollama/client.go b/internal/pkg/utils_ollama/client.go index febd8cd..16928f6 100644 --- a/internal/pkg/utils_ollama/client.go +++ b/internal/pkg/utils_ollama/client.go @@ -8,6 +8,7 @@ import ( "net/url" "os" "sync" + "time" "github.com/ollama/ollama/api" ) @@ -43,11 +44,12 @@ func (c *Client) ToolSelect(ctx context.Context, messages []api.Message, tools [ // 构建聊天请求 req := &api.ChatRequest{ - Model: c.config.Model, - Messages: messages, - Stream: new(bool), // 设置为false,不使用流式响应 - Think: &api.ThinkValue{Value: false}, - Tools: tools, + Model: c.config.Model, + Messages: messages, + Stream: new(bool), // 设置为false,不使用流式响应 + Think: &api.ThinkValue{Value: false}, + Tools: tools, + KeepAlive: &api.Duration{Duration: 24 * time.Hour}, } err = c.client.Chat(ctx, req, func(resp api.ChatResponse) error { res = resp From 6a58919e8e26c28d977c64ac69ed1e0b6244e5e7 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Mon, 19 Jan 2026 16:45:21 +0800 Subject: [PATCH 04/11] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E8=B4=9F?= =?UTF-8?q?=E5=88=A9=E6=B6=A6=E5=88=86=E6=9E=90=E5=92=8C=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/biz/do/handle.go | 4 +- internal/biz/group_config.go | 5 +- internal/entitys/bot.go | 8 +- internal/entitys/recognize.go | 6 + internal/tools/zltx/zltx_order_detail.go | 173 +++++++++++++++++++++-- 5 files changed, 177 insertions(+), 19 deletions(-) diff --git a/internal/biz/do/handle.go b/internal/biz/do/handle.go index 6001203..81c70b7 100644 --- a/internal/biz/do/handle.go +++ b/internal/biz/do/handle.go @@ -301,8 +301,8 @@ func (r *Handle) HandleBot(ctx context.Context, rec *entitys.Recognize, task *en } var detailPage string entitys.ResLog(rec.Ch, task.Index, "需求记录完成") - switch task.OutPutFormat { - case entitys.OutPutFormatMarkdown: + switch rec.OutPutScene { + case entitys.OutPutSceneDingTalk: // 构建跳转链接 detailPage = "[去查看](" + r.conf.Dingtalk.TableDemand.Url + ")" default: diff --git a/internal/biz/group_config.go b/internal/biz/group_config.go index f6a96eb..0c6dbbc 100644 --- a/internal/biz/group_config.go +++ b/internal/biz/group_config.go @@ -253,16 +253,17 @@ func (g *GroupConfigBiz) handleMatch(ctx context.Context, rec *entitys.Recognize break } } + rec.OutPutScene = entitys.OutPutSceneDingTalk if pointTask == nil || pointTask.Index == "other" { return g.otherTask(ctx, rec) } + switch constants.TaskType(pointTask.Type) { case constants.TaskTypeFunc: return g.handleTask(ctx, rec, pointTask) case constants.TaskTypeBot: return g.handle.HandleBot(ctx, rec, &entitys.Task{ - Index: pointTask.Index, - OutPutFormat: entitys.OutPutFormatMarkdown, + Index: pointTask.Index, }) case constants.TaskTypeReport: return g.handleReport(ctx, rec, pointTask, groupConfig) diff --git a/internal/entitys/bot.go b/internal/entitys/bot.go index 0496898..03b1a09 100644 --- a/internal/entitys/bot.go +++ b/internal/entitys/bot.go @@ -23,11 +23,5 @@ type DingTalkBot struct { } type Task struct { - Index string `json:"bot_index"` - OutPutFormat OutPutFormat `json:"out_put_format"` + Index string `json:"bot_index"` } - -type OutPutFormat string - -const OutPutFormatMarkdown OutPutFormat = "markdown" -const OutPutFormatHtml OutPutFormat = "html" diff --git a/internal/entitys/recognize.go b/internal/entitys/recognize.go index accee4a..57a92e0 100644 --- a/internal/entitys/recognize.go +++ b/internal/entitys/recognize.go @@ -14,8 +14,14 @@ type Recognize struct { Ch chan Response Match *Match Ext []byte + OutPutScene OutPutScene } +type OutPutScene string + +const OutPutSceneDingTalk OutPutScene = "markdown" +const OutPutFormatHtml OutPutScene = "html" + type TaskExt struct { Auth string `json:"auth"` Session string `json:"session"` diff --git a/internal/tools/zltx/zltx_order_detail.go b/internal/tools/zltx/zltx_order_detail.go index 19b4452..7546149 100644 --- a/internal/tools/zltx/zltx_order_detail.go +++ b/internal/tools/zltx/zltx_order_detail.go @@ -11,6 +11,8 @@ import ( "context" "encoding/json" "fmt" + "strings" + "time" "gitea.cdlsxd.cn/self-tools/l_request" "github.com/ollama/ollama/api" @@ -77,14 +79,74 @@ type ZltxOrderDetailRequest struct { OrderNumber interface{} `json:"order_number"` } +//type ZltxOrderDetailResponse struct { +// Code int `json:"code"` +// Error string `json:"error"` +// Data ZltxOrderDetailData `json:"data"` +// Mes string `json:"mes"` +//} + // ZltxOrderDetailResponse 直连天下订单详情响应 type ZltxOrderDetailResponse struct { - Code int `json:"code"` - Error string `json:"error"` - Data ZltxOrderDetailData `json:"data"` - Mes string `json:"mes"` + Code int `json:"code"` + Data Data `json:"data"` + Error string `json:"error"` } +type Data struct { + Direct *Direct `json:"direct"` + Order *Order `json:"order"` +} + +type Direct struct { + SerialNumber string `json:"serialNumber"` + OrderOrderNumber string `json:"orderOrderNumber"` + TerminalAccount string `json:"terminalAccount"` + OursProductId int `json:"oursProductId"` + OursProductName string `json:"oursProductName"` + Status int `json:"status"` + TradePrice float64 `json:"tradePrice"` + PlatformProductId int `json:"platformProductId"` + PlatformProductName string `json:"platformProductName"` + PlatformId int `json:"platformId"` + PlatformName string `json:"platformName"` + PlatformPrice float64 `json:"platformPrice"` + CreateTime int `json:"createTime"` + ExecuteTime int `json:"executeTime"` + Type int `json:"type"` + Reason string `json:"reason"` + ResellerId int `json:"resellerId"` + ResellerName string `json:"resellerName"` + Aftermarket int `json:"aftermarket"` + PurchasePrice float64 `json:"purchasePrice"` + NeedAi bool `json:"needAi"` + AiReason string `json:"aiReason"` +} + +type Order struct { + Id string `json:"id"` + ResellerId int `json:"resellerId"` + ResellerName string `json:"resellerName"` + Status int `json:"status"` + PayStatus int `json:"payStatus"` + CreateTime int `json:"createTime"` + PayTime int `json:"payTime"` + Type int `json:"type"` + Account string `json:"account"` + Quantity int `json:"quantity"` + Amount float64 `json:"amount"` + PayAmount float64 `json:"payAmount"` + ResellerOrderNumber string `json:"resellerOrderNumber"` + Price int `json:"price"` + NotifyTime int `json:"notifyTime"` + FinishTime int `json:"finishTime"` + Aftermarket int `json:"aftermarket"` + Remark string `json:"remark"` + OursProductId int `json:"oursProductId"` + OursProductName string `json:"oursProductName"` + OursProductPrice int `json:"oursProductPrice"` + TradePrice float64 `json:"tradePrice"` +} type ZltxOrderLogResponse struct { Code int `json:"code"` Error string `json:"error"` @@ -171,12 +233,15 @@ func (w *ZltxOrderDetailTool) getZltxOrderDetail(ctx context.Context, rec *entit if err = json.Unmarshal(res.Content, &resData); err != nil { return } - entitys.ResJson(rec.Ch, w.Name(), res.Text) - - if resData.Data.Direct != nil { + if rec.OutPutScene == entitys.OutPutSceneDingTalk { + entitys.ResJson(rec.Ch, w.Name(), resData.ToForm()) + } else { + entitys.ResJson(rec.Ch, w.Name(), res.Text) entitys.ResLoading(rec.Ch, w.Name(), "正在分析订单日志") + } + if resData.Data.Direct != nil { req = l_request.Request{ - Url: fmt.Sprintf(w.config.Tools.ZltxOrderDetail.AddURL, resData.Data.Direct["orderOrderNumber"].(string), resData.Data.Direct["serialNumber"].(string)), + Url: fmt.Sprintf(w.config.Tools.ZltxOrderDetail.AddURL, resData.Data.Direct.OrderOrderNumber, resData.Data.Direct.SerialNumber), Headers: map[string]string{ "Authorization": fmt.Sprintf("Bearer %s", token), }, @@ -230,3 +295,95 @@ func (w *ZltxOrderDetailTool) getZltxOrderDetail(ctx context.Context, rec *entit } return } + +func (z *ZltxOrderDetailResponse) ToForm() string { + var res strings.Builder + res.WriteString("**普通订单** \n") + res.WriteString("\n## 订单号:" + z.Data.Order.Id) + res.WriteString("\n## 分销商订单号:" + z.Data.Order.ResellerOrderNumber) + res.WriteString("\n## 分销商:" + z.Data.Order.ResellerName) + res.WriteString("\n## 订单商品:" + z.Data.Order.OursProductName) + res.WriteString("\n## 充值账号:" + z.Data.Order.Account) + res.WriteString("\n## 折扣价/原价:" + fmt.Sprintf("%.2f", z.Data.Order.TradePrice)) + res.WriteString("\n## 数量:" + fmt.Sprintf("%d", z.Data.Order.Quantity)) + res.WriteString("\n## 订单总额:" + fmt.Sprintf("%.2f", z.Data.Order.Amount)) + res.WriteString("\n## 订单状态:" + orderStatusMap(z.Data.Order.Status)) + res.WriteString("\n## 支付状态:" + orderPayStatusMap(z.Data.Order.Status)) + res.WriteString("\n## 创建时间:" + unixToDateFormat(z.Data.Order.CreateTime)) + res.WriteString("\n## 完成时间:" + unixToDateFormat(z.Data.Order.FinishTime)) + res.WriteString("\n---\n") + + res.WriteString("\n**充值流水** \n") + res.WriteString("\n## 订单号:" + z.Data.Direct.OrderOrderNumber) + res.WriteString("\n## 流水号:" + z.Data.Direct.SerialNumber) + res.WriteString("\n## 商品:" + z.Data.Direct.OursProductName) + res.WriteString("\n## 使用接口:" + z.Data.Direct.PlatformName) + res.WriteString("\n## 接口商品名称:" + z.Data.Direct.PlatformProductName) + res.WriteString("\n## 上游价:" + fmt.Sprintf("%.2f", z.Data.Direct.PlatformPrice)) + res.WriteString("\n## 下游价:" + fmt.Sprintf("%.2f", z.Data.Direct.TradePrice)) + res.WriteString("\n## 上游采购价:" + fmt.Sprintf("%.2f", z.Data.Direct.PurchasePrice)) + res.WriteString("\n## 充值账号:" + z.Data.Direct.TerminalAccount) + res.WriteString("\n## 创建时间:" + unixToDateFormat(z.Data.Direct.CreateTime)) + res.WriteString("\n## 处理时间:" + unixToDateFormat(z.Data.Direct.ExecuteTime)) + res.WriteString("\n## 状态:" + directStatusMap(z.Data.Direct.Status)) + res.WriteString("\n") + res.WriteString("\n") + res.WriteString("\n") + return res.String() +} + +func orderStatusMap(status int) string { + var OrderStatus = map[int]string{ + 0: "下单中", + 1: "订单完成", + 2: "部分成功", + 3: "充值处理中", + 4: "已暂停", + -1: "关闭订单", + -2: "全部失败", + } + if _, ok := OrderStatus[status]; !ok { + return "未知" + } + return OrderStatus[status] +} + +func unixToDateFormat(unix int) string { + return time.Unix(int64(unix), 0).Format("2006-01-02 15:04:05") +} +func orderPayStatusMap(status int) string { + var OrderPayStatus = map[int]string{ + 0: "未支付", + 1: "支付中", + 2: "支付成功", + 3: "退款中", + 4: "全部退款", + 5: "部分退款", + -1: "支付失败", + -2: "退款失败", + } + if _, ok := OrderPayStatus[status]; !ok { + return "未知" + } + return OrderPayStatus[status] +} + +func directStatusMap(status int) string { + var DirectStatus = map[int]string{ + 0: "待充值", + 1: "充值成功", + 2: "充值中", + -1: "充值失败", + -2: "失败重试", + -98: "下单异常", + -99: "查询异常", + -6: "手动失败", + -5: "手动重试", + -4: "叠加卡单", + -3: "卡单", + } + if _, ok := DirectStatus[status]; !ok { + return "未知" + } + return DirectStatus[status] +} From 5c2d7176c7b18bd2acceab5b2c27eb428476193a Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Tue, 20 Jan 2026 10:32:42 +0800 Subject: [PATCH 05/11] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E4=BA=8F?= =?UTF-8?q?=E6=8D=9F=E5=95=86=E5=93=81=E7=BB=9F=E8=AE=A1=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/domain/workflow/recharge/statistics_ours_product.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/domain/workflow/recharge/statistics_ours_product.go b/internal/domain/workflow/recharge/statistics_ours_product.go index 278d32b..3ef2e5a 100644 --- a/internal/domain/workflow/recharge/statistics_ours_product.go +++ b/internal/domain/workflow/recharge/statistics_ours_product.go @@ -125,7 +125,7 @@ func (w *statisticsOursProduct) formatContext(ctx context.Context, input *Statis Time: time.Now(), StartTime: startTime, EndTime: endTime, - Title: fmt.Sprintf("截止 %s 亏损100以上我们的商品统计", endTimeStr), + Title: fmt.Sprintf("截止 %s 电商系统亏损100以上我们的商品统计", endTimeStr), }, nil } From c478e9f43deb6c1686abe6abccaba958cf8158bf Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Wed, 21 Jan 2026 15:10:24 +0800 Subject: [PATCH 06/11] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E5=AE=98?= =?UTF-8?q?=E6=96=B9=E4=BA=A7=E5=93=81=E7=BB=9F=E8=AE=A1=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/tools/bbxt/bbxt.go | 8 ++++---- internal/tools/bbxt/bbxt_test.go | 14 +++++++++++--- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/internal/tools/bbxt/bbxt.go b/internal/tools/bbxt/bbxt.go index 345f982..3281325 100644 --- a/internal/tools/bbxt/bbxt.go +++ b/internal/tools/bbxt/bbxt.go @@ -428,7 +428,7 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str if err != nil { return } - var total = make([][]string, len(ids)) + var total = make([][]string, 0) for _, v := range data.OfficialProductSum { var ( yeterDatyDiff string @@ -444,16 +444,16 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str } else { lastWeekDiff = fmt.Sprintf("%s↓%d", GreenStyle, v.HistoryTwoDiff) } - total[productMap[v.OfficialProductName]] = []string{ + total = append(total, []string{ fmt.Sprintf("%s", v.OfficialProductName), fmt.Sprintf("%d", v.CurrentNum), fmt.Sprintf("%d", v.HistoryOneNum), yeterDatyDiff, fmt.Sprintf("%d", v.HistoryTwoNum), lastWeekDiff, - } - + }) } + timeCh := now.Format("1月2日15点") title := "截至" + timeCh + "销售同比分析" //总量生成excel diff --git a/internal/tools/bbxt/bbxt_test.go b/internal/tools/bbxt/bbxt_test.go index c586eda..3d0f623 100644 --- a/internal/tools/bbxt/bbxt_test.go +++ b/internal/tools/bbxt/bbxt_test.go @@ -79,14 +79,22 @@ func Test_GetStatisOfficialProductSumDecline(t *testing.T) { } func Test_GetStatisOfficialProductSum(t *testing.T) { - + run() configs := configConfig o, err := NewBbxtTools(nil, lsxd.NewLogin(configs, utils.NewRdb(configConfig))) if err != nil { panic(err) } - s := "官方--美团外卖红包5元,官方--美团外卖红包10元,官方--饿了么超级会员月卡,官方--网易云黑胶vip月卡,官方--喜马拉雅巅峰会员月卡,官方--芒果-PC季卡,官方--芒果-PC月卡,官方--芒果-PC周卡,官方--腾讯-周卡,官方--优酷周卡,官方--QQ音乐-绿钻月卡,官方--爱奇艺-周卡,官方--腾讯-月卡,官方--腾讯-季卡,官方--腾讯-年卡,官方--优酷月卡,官方--优酷季卡,官方--优酷年卡,官方--爱奇艺-月卡,官方--爱奇艺-季卡,官方--爱奇艺-年卡" - report, err := o.GetStatisOfficialProductSum(time.Now(), strings.Split(s, ",")) + s := "官方--腾讯-周卡,官方--腾讯-月卡,官方--腾讯-季卡,官方--腾讯-年卡,官方--优酷周卡,官方--优酷月卡,官方--优酷季卡,官方--优酷年卡,官方--爱奇艺-周卡,官方--爱奇艺-月卡,官方--爱奇艺-季卡,官方--爱奇艺-年卡,官方--芒果-PC周卡,官方--芒果-PC月卡,官方--芒果-PC季卡,官方--美团外卖红包5元,官方--美团外卖红包10元,官方--QQ音乐-绿钻月卡,官方--饿了么超级会员月卡,官方--网易云黑胶vip月卡,官方--喜马拉雅巅峰会员月卡" + now := time.Now() + noon := time.Date( + now.Year(), + now.Month(), + now.Day(), + 12, 0, 0, 0, + now.Location(), + ) + report, err := o.GetStatisOfficialProductSum(noon, strings.Split(s, ",")) t.Log(report, err) From a155cb1e0199ea3ef4a6910e32f66bf5370445f9 Mon Sep 17 00:00:00 2001 From: renzhiyuan <465386466@qq.com> Date: Mon, 26 Jan 2026 17:07:04 +0800 Subject: [PATCH 07/11] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=80=E9=87=8F?= =?UTF-8?q?=E5=90=8C=E6=AF=94=E5=88=86=E6=9E=90=E6=95=B0=E6=8D=AE=E5=A4=84?= =?UTF-8?q?=E7=90=86=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/tools/bbxt/bbxt.go | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/internal/tools/bbxt/bbxt.go b/internal/tools/bbxt/bbxt.go index 3281325..7a03cce 100644 --- a/internal/tools/bbxt/bbxt.go +++ b/internal/tools/bbxt/bbxt.go @@ -403,10 +403,6 @@ func (b *BbxtTools) GetProfitRankingSum(now time.Time) (report *ReportRes, err e // GetStatisOfficialProductSum 销量同比分析 func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []string) (report *ReportRes, err error) { - var productMap = make(map[string]int) - for k, v := range productName { - productMap[v] = k - } ct := []string{ time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location()).Format("2006-01-02 15:04:05"), adjustedTime(now), @@ -428,7 +424,11 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str if err != nil { return } - var total = make([][]string, 0) + + // 创建临时map存储产品数据 + productDataMap := make(map[string][]string) + var productNamesInResult []string + for _, v := range data.OfficialProductSum { var ( yeterDatyDiff string @@ -444,14 +444,28 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str } else { lastWeekDiff = fmt.Sprintf("%s↓%d", GreenStyle, v.HistoryTwoDiff) } - total = append(total, []string{ + + rowData := []string{ fmt.Sprintf("%s", v.OfficialProductName), fmt.Sprintf("%d", v.CurrentNum), fmt.Sprintf("%d", v.HistoryOneNum), yeterDatyDiff, fmt.Sprintf("%d", v.HistoryTwoNum), lastWeekDiff, - }) + } + + // 存储到map中,key为产品名 + productDataMap[v.OfficialProductName] = rowData + productNamesInResult = append(productNamesInResult, v.OfficialProductName) + } + + // 按照productName的顺序构建total + var total [][]string + + for _, name := range productName { + if rowData, exists := productDataMap[name]; exists { + total = append(total, rowData) + } } timeCh := now.Format("1月2日15点") From 88ed4ff714939501e64132e6fba96dcab37aeaf6 Mon Sep 17 00:00:00 2001 From: fuzhongyun <15339891972@163.com> Date: Tue, 27 Jan 2026 17:13:19 +0800 Subject: [PATCH 08/11] =?UTF-8?q?fix:=20=E7=BA=BF=E4=B8=8A=E4=BD=BF?= =?UTF-8?q?=E7=94=A8ollama=E4=BA=91=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/config/config.yaml b/config/config.yaml index 6166634..dff34ce 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -5,9 +5,12 @@ server: ollama: base_url: "http://172.17.0.1:11434" - model: "qwen3:8b" - generate_model: "qwen3:8b" - mapping_model: "qwen3:8b" + # model: "qwen3:8b" + # generate_model: "qwen3:8b" + # mapping_model: "qwen3:8b" + model: "qwen3-coder:480b-cloud" + generate_model: "qwen3-coder:480b-cloud" + mapping_model: "deepseek-v3.2:cloud" vl_model: "qwen2.5vl:3b" timeout: "120s" level: "info" From ce74a27b539589b1be16f459425abf5cc86a29ac Mon Sep 17 00:00:00 2001 From: fuzhongyun <15339891972@163.com> Date: Wed, 28 Jan 2026 18:37:26 +0800 Subject: [PATCH 09/11] =?UTF-8?q?fix=EF=BC=9A=E5=88=87=E6=8D=A2=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20excel2pic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index dff34ce..cf02c96 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -149,7 +149,7 @@ eino_tools: # == 通用工具 == # 表格转图片 excel2pic: - base_url: "http://excel2pic:8000/api/v1/convert" + base_url: "http://192.168.6.109:8000/api/v1/convert" dingtalk: api_key: "dingsbbntrkeiyazcfdg" From b1c5bfa6f54b864c755936afaa006df831e0373c Mon Sep 17 00:00:00 2001 From: fuzhongyun <15339891972@163.com> Date: Wed, 28 Jan 2026 18:44:04 +0800 Subject: [PATCH 10/11] =?UTF-8?q?fix=EF=BC=9A=E5=88=87=E6=8D=A2=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=20excel2pic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index cf02c96..3a7f64b 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -149,7 +149,7 @@ eino_tools: # == 通用工具 == # 表格转图片 excel2pic: - base_url: "http://192.168.6.109:8000/api/v1/convert" + base_url: "http://192.168.6.115:8010/api/v1/convert" dingtalk: api_key: "dingsbbntrkeiyazcfdg" From f33096a50673d51182354e848175100d87c8e997 Mon Sep 17 00:00:00 2001 From: fuzhongyun <15339891972@163.com> Date: Wed, 28 Jan 2026 19:05:42 +0800 Subject: [PATCH 11/11] =?UTF-8?q?fix:=20=E8=BF=98=E5=8E=9F=20excel2pic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config/config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 3a7f64b..dff34ce 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -149,7 +149,7 @@ eino_tools: # == 通用工具 == # 表格转图片 excel2pic: - base_url: "http://192.168.6.115:8010/api/v1/convert" + base_url: "http://excel2pic:8000/api/v1/convert" dingtalk: api_key: "dingsbbntrkeiyazcfdg"