fix: 调整配置,打开定时任务

This commit is contained in:
fuzhongyun 2025-12-31 17:01:16 +08:00
parent fc2499d627
commit 39776dfcce
6 changed files with 27 additions and 14 deletions

View File

@ -29,6 +29,6 @@ func main() {
//钉钉机器人 //钉钉机器人
app.DingBotServer.Run(ctx, *onBot) app.DingBotServer.Run(ctx, *onBot)
//定时任务 //定时任务
//app.Cron.Run(ctx) app.Cron.Run(ctx)
log.Fatal(app.HttpServer.Listen(fmt.Sprintf(":%d", bc.Server.Port))) log.Fatal(app.HttpServer.Listen(fmt.Sprintf(":%d", bc.Server.Port)))
} }

View File

@ -36,6 +36,7 @@ docker run -itd \
-e "OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}" \ -e "OLLAMA_BASE_URL=${OLLAMA_BASE_URL:-http://host.docker.internal:11434}" \
-e "MODE=${MODE}" \ -e "MODE=${MODE}" \
-p 8090:8090 \ -p 8090:8090 \
-v ./cache:/app/cache \
"${CONTAINER_NAME}" ./server --config "./${CONFIG_FILE}" --bot "${BOT}" "${CONTAINER_NAME}" ./server --config "./${CONFIG_FILE}" --bot "${BOT}"
docker logs -f ${CONTAINER_NAME} docker logs -f ${CONTAINER_NAME}

View File

@ -629,7 +629,11 @@ func (d *DingTalkBotBiz) GetReportLists(ctx context.Context, group *model.AiBotG
} }
// 追加电商充值系统统计 - 返回统一使用 []*bbxt.ReportRes // 追加电商充值系统统计 - 返回统一使用 []*bbxt.ReportRes
rechargeReports, err := d.rechargeDailyReport(ctx, time.Now(), []string{"官方-爱奇艺-星钻季卡", "官方-爱奇艺-星钻半年卡", "官方--腾讯-年卡", "官方--爱奇艺-月卡"}, d.ossClient) rechargeReports, err := d.rechargeDailyReport(ctx, time.Now(), product, d.ossClient)
if err != nil || len(rechargeReports) == 0 {
return
}
reports = append(reports, rechargeReports...) reports = append(reports, rechargeReports...)
return return
@ -637,6 +641,12 @@ func (d *DingTalkBotBiz) GetReportLists(ctx context.Context, group *model.AiBotG
// rechargeDailyReport 获取电商充值系统统计报告 // rechargeDailyReport 获取电商充值系统统计报告
func (d *DingTalkBotBiz) rechargeDailyReport(ctx context.Context, now time.Time, productNames []string, ossClient *utils_oss.Client) (reports []*bbxt.ReportRes, err error) { func (d *DingTalkBotBiz) rechargeDailyReport(ctx context.Context, now time.Time, productNames []string, ossClient *utils_oss.Client) (reports []*bbxt.ReportRes, err error) {
defer func() {
if err := recover(); err != nil {
log.Error(err)
}
}()
workflowId := recharge.WorkflowIDStatisticsOursProduct workflowId := recharge.WorkflowIDStatisticsOursProduct
args := &runtime.WorkflowArgs{ args := &runtime.WorkflowArgs{
Args: map[string]any{ Args: map[string]any{
@ -649,6 +659,8 @@ func (d *DingTalkBotBiz) rechargeDailyReport(ctx context.Context, now time.Time,
return return
} }
log.Infof("imgUrl: %s", res["url"].(string))
reports = []*bbxt.ReportRes{ reports = []*bbxt.ReportRes{
{ {
ReportName: "我们的商品统计(电商充值系统)", ReportName: "我们的商品统计(电商充值系统)",

View File

@ -19,12 +19,12 @@ type StatisticsOursProductResponse struct {
type StatisticsOursProductItem struct { type StatisticsOursProductItem struct {
OursProductId int `json:"ours_product_id"` OursProductId int `json:"ours_product_id"`
ResellerId int `json:"reseller_id"` ResellerId int `json:"reseller_id"`
TotalPrice string `json:"total_price"` TotalPrice any `json:"total_price"`
Count string `json:"count"` Count any `json:"count"`
SuccessCount string `json:"success_count"` SuccessCount any `json:"success_count"`
SuccessPrice string `json:"success_price"` SuccessPrice any `json:"success_price"`
FailCount string `json:"fail_count"` FailCount any `json:"fail_count"`
FailPrice string `json:"fail_price"` FailPrice any `json:"fail_price"`
Profit string `json:"profit"` Profit any `json:"profit"`
OursProductName string `json:"ours_product_name"` OursProductName string `json:"ours_product_name"`
} }

View File

@ -182,13 +182,13 @@ func (w *statisticsOursProduct) convertDataToExcelFormat(data []statistics_ours_
row := []string{ row := []string{
item.OursProductName, item.OursProductName,
// fmt.Sprintf("%d", item.OursProductId), // fmt.Sprintf("%d", item.OursProductId),
item.Count, fmt.Sprintf("%v", item.Count),
// item.TotalPrice, // item.TotalPrice,
// item.SuccessCount, // item.SuccessCount,
item.SuccessPrice, fmt.Sprintf("%v", item.SuccessPrice),
// item.FailCount, // item.FailCount,
// item.FailPrice, // item.FailPrice
item.Profit, fmt.Sprintf("%v", item.Profit),
} }
result = append(result, row) result = append(result, row)

View File

@ -21,7 +21,7 @@ var resellerBlackList = []string{
"悦跑", "悦跑",
"电商-独立", "电商-独立",
"蓝星严选连续包月", "蓝星严选连续包月",
"通钱", "通钱-2025年12月",
} }
type BbxtTools struct { type BbxtTools struct {