Compare commits
No commits in common. "master" and "feature/rzy/bug_optimization_submit_and_order_search" have entirely different histories.
master
...
feature/rz
|
|
@ -5,9 +5,6 @@ server:
|
|||
|
||||
ollama:
|
||||
base_url: "http://172.17.0.1:11434"
|
||||
# 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"
|
||||
|
|
@ -39,7 +36,7 @@ sys:
|
|||
channel_pool_len: 100
|
||||
channel_pool_size: 32
|
||||
llm_pool_len: 5
|
||||
heartbeat_interval: 300
|
||||
heartbeat_interval: 30
|
||||
key: report-api
|
||||
pollSize: 5 #连接池大小,不配置,或配置为0表示不启用连接池
|
||||
minIdleConns: 2 #最小空闲连接数
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import (
|
|||
)
|
||||
|
||||
const DefaultInterval = 100 * time.Millisecond
|
||||
const HeardBeatX = 1000
|
||||
const HeardBeatX = 100
|
||||
|
||||
type SendCardClient struct {
|
||||
Auth *Auth
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import (
|
|||
"net/url"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/ollama/ollama/api"
|
||||
)
|
||||
|
|
@ -44,12 +43,11 @@ 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,
|
||||
KeepAlive: &api.Duration{Duration: 24 * time.Hour},
|
||||
Model: c.config.Model,
|
||||
Messages: messages,
|
||||
Stream: new(bool), // 设置为false,不使用流式响应
|
||||
Think: &api.ThinkValue{Value: false},
|
||||
Tools: tools,
|
||||
}
|
||||
err = c.client.Chat(ctx, req, func(resp api.ChatResponse) error {
|
||||
res = resp
|
||||
|
|
|
|||
|
|
@ -403,6 +403,10 @@ 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),
|
||||
|
|
@ -424,11 +428,7 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str
|
|||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
// 创建临时map存储产品数据
|
||||
productDataMap := make(map[string][]string)
|
||||
var productNamesInResult []string
|
||||
|
||||
var total = make([][]string, len(ids))
|
||||
for _, v := range data.OfficialProductSum {
|
||||
var (
|
||||
yeterDatyDiff string
|
||||
|
|
@ -444,8 +444,7 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str
|
|||
} else {
|
||||
lastWeekDiff = fmt.Sprintf("%s↓%d", GreenStyle, v.HistoryTwoDiff)
|
||||
}
|
||||
|
||||
rowData := []string{
|
||||
total[productMap[v.OfficialProductName]] = []string{
|
||||
fmt.Sprintf("%s", v.OfficialProductName),
|
||||
fmt.Sprintf("%d", v.CurrentNum),
|
||||
fmt.Sprintf("%d", v.HistoryOneNum),
|
||||
|
|
@ -454,20 +453,7 @@ func (b *BbxtTools) GetStatisOfficialProductSum(now time.Time, productName []str
|
|||
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点")
|
||||
title := "截至" + timeCh + "销售同比分析"
|
||||
//总量生成excel
|
||||
|
|
|
|||
|
|
@ -79,22 +79,14 @@ 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 := "官方--腾讯-周卡,官方--腾讯-月卡,官方--腾讯-季卡,官方--腾讯-年卡,官方--优酷周卡,官方--优酷月卡,官方--优酷季卡,官方--优酷年卡,官方--爱奇艺-周卡,官方--爱奇艺-月卡,官方--爱奇艺-季卡,官方--爱奇艺-年卡,官方--芒果-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, ","))
|
||||
s := "官方--美团外卖红包5元,官方--美团外卖红包10元,官方--饿了么超级会员月卡,官方--网易云黑胶vip月卡,官方--喜马拉雅巅峰会员月卡,官方--芒果-PC季卡,官方--芒果-PC月卡,官方--芒果-PC周卡,官方--腾讯-周卡,官方--优酷周卡,官方--QQ音乐-绿钻月卡,官方--爱奇艺-周卡,官方--腾讯-月卡,官方--腾讯-季卡,官方--腾讯-年卡,官方--优酷月卡,官方--优酷季卡,官方--优酷年卡,官方--爱奇艺-月卡,官方--爱奇艺-季卡,官方--爱奇艺-年卡"
|
||||
report, err := o.GetStatisOfficialProductSum(time.Now(), strings.Split(s, ","))
|
||||
|
||||
t.Log(report, err)
|
||||
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue