Compare commits

..

6 Commits

Author SHA1 Message Date
fuzhongyun ec5623bc07 fix: add log 2025-11-28 09:17:11 +08:00
fuzhongyun 08932ad38f fix: 修复权限配置地址 2025-11-28 09:08:34 +08:00
fuzhongyun bf0870865e fix: 修改配置 2025-11-27 17:41:09 +08:00
fuzhongyun 3510be1db7 fix: 1.时间不传时,默认30d内 2.解析后的时间格式异常,时间置为空 3.售后金额为空时,默认订单金额 2025-11-27 16:29:58 +08:00
fuzhongyun aba8a18900 fix: 还原循环挂起 2025-11-27 15:35:57 +08:00
fuzhongyun c8d3050c70 fix: 移除循环挂起 2025-11-27 15:24:35 +08:00
7 changed files with 75 additions and 30 deletions

View File

@ -55,14 +55,15 @@ tools:
enabled: true
api_key: "dingsbbntrkeiyazcfdg"
api_secret: "ObqxwyR20r9rVNhju0sCPQyQA98_FZSc32W4vgxnGFH_b02HZr1BPCJsOAF816nu"
zltxOrderAfterSaleDetail:
zltxOrderAfterSaleSupplier:
enabled: true
base_url: "https://revcl.1688sup.com/api/admin/afterSales/direct/%s"
api_key : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyQ2VudGVyIiwiZXhwIjoxNzU2MTgyNTM1LCJuYmYiOjE3NTYxODA3MzUsImp0aSI6IjEiLCJQaG9uZSI6IjE4MDAwMDAwMDAwIiwiVXNlck5hbWUiOiJsc3hkIiwiUmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJBY2NvdW50VHlwZSI6MSwiR3JvdXBDb2RlcyI6IlZDTF9DQVNISUVSLFZDTF9PUEVSQVRFLFZDTF9BRE1JTixWQ0xfQUFBLFZDTF9WQ0xfT1BFUkFULFZDTF9JTlZPSUNFLENSTV9BRE1JTixMSUFOTElBTl9BRE1JTixNQVJLRVRNQUcyX0FETUlOLFBIT05FQklMTF9BRE1JTixRSUFOWkhVX1NVUFBFUl9BRE0sTUFSS0VUSU5HU0FBU19TVVBFUkFETUlOLENBUkRfQ09ERSxDQVJEX1BST0NVUkVNRU5ULE1BUktFVElOR1NZU1RFTV9TVVBFUixTVEFUSVNUSUNBTFNZU1RFTV9BRE1JTixaTFRYX0FETUlOLFpMVFhfT1BFUkFURSIsIkRpbmdVc2VySWQiOiIxNjIwMjYxMjMwMjg5MzM4MzQifQ.N1xv1PYbcO8_jR5adaczc16YzGsr4z101gwEZdulkRaREBJNYTOnFrvRxTFx3RJTooXsqTqroE1MR84v_1WPX6BS6kKonA-kC1Jgot6yrt5rFWhGNGb2Cpr9rKIFCCQYmiGd3AUgDazEeaQ0_sodv3E-EXg9VfE1SX8nMcck9Yjnc8NCy7RTWaBIaSeOdZcEl-JfCD0S6GSx3oErp_hk-U9FKGwf60wAuDGTY1R0BP4BYpcEqS-C2LSnsSGyURi54Cuk5xH8r1WuF0Dm5bwAj5d7Hvs77-N_sUF-C5ONqyZJRAEhYLgcmN9RX_WQZfizdQJxizlTczdpzYfy-v-1eQ"
zltxOrderAfterSalePreCheck:
base_url: "https://revcl.1688sup.com/api/admin/afterSales/directs"
zltxOrderAfterSaleReseller:
enabled: true
base_url: "https://gateway.dev.cdlsxd.cn/zltx_api/admin/afterSales/reseller_pre"
api_key : "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyQ2VudGVyIiwiZXhwIjoxNzU2MTgyNTM1LCJuYmYiOjE3NTYxODA3MzUsImp0aSI6IjEiLCJQaG9uZSI6IjE4MDAwMDAwMDAwIiwiVXNlck5hbWUiOiJsc3hkIiwiUmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJBY2NvdW50VHlwZSI6MSwiR3JvdXBDb2RlcyI6IlZDTF9DQVNISUVSLFZDTF9PUEVSQVRFLFZDTF9BRE1JTixWQ0xfQUFBLFZDTF9WQ0xfT1BFUkFULFZDTF9JTlZPSUNFLENSTV9BRE1JTixMSUFOTElBTl9BRE1JTixNQVJLRVRNQUcyX0FETUlOLFBIT05FQklMTF9BRE1JTixRSUFOWkhVX1NVUFBFUl9BRE0sTUFSS0VUSU5HU0FBU19TVVBFUkFETUlOLENBUkRfQ09ERSxDQVJEX1BST0NVUkVNRU5ULE1BUktFVElOR1NZU1RFTV9TVVBFUixTVEFUSVNUSUNBTFNZU1RFTV9BRE1JTixaTFRYX0FETUlOLFpMVFhfT1BFUkFURSIsIkRpbmdVc2VySWQiOiIxNjIwMjYxMjMwMjg5MzM4MzQifQ.N1xv1PYbcO8_jR5adaczc16YzGsr4z101gwEZdulkRaREBJNYTOnFrvRxTFx3RJTooXsqTqroE1MR84v_1WPX6BS6kKonA-kC1Jgot6yrt5rFWhGNGb2Cpr9rKIFCCQYmiGd3AUgDazEeaQ0_sodv3E-EXg9VfE1SX8nMcck9Yjnc8NCy7RTWaBIaSeOdZcEl-JfCD0S6GSx3oErp_hk-U9FKGwf60wAuDGTY1R0BP4BYpcEqS-C2LSnsSGyURi54Cuk5xH8r1WuF0Dm5bwAj5d7Hvs77-N_sUF-C5ONqyZJRAEhYLgcmN9RX_WQZfizdQJxizlTczdpzYfy-v-1eQ"
base_url: "https://revcl.1688sup.com/api/admin/afterSales/reseller_pre_ai"
zltxOrderAfterSaleResellerBatch:
enabled: true
base_url: "https://revcl.1688sup.com/api/admin/afterSales/reseller_pre_ai"
default_prompt:
@ -74,3 +75,7 @@ default_prompt:
若图片为文档类(如合同、发票、收据),请结构化输出关键字段(如客户名称、金额、开票日期等)。
'
user_prompt: '识别图片内容'
# 权限配置
permissionConfig:
permission_url: "https://api.user.1688sup.com/v1/menu/myCodes?systemId="

View File

@ -36,16 +36,16 @@ db:
tools:
zltxOrderDetail:
enabled: true
base_url: "https://revcl.1688sup.com/api/admin/direct/ai/%s"
add_url: "https://revcl.1688sup.com/api/admin/direct/log/%s/%s"
base_url: "https://gateway.dev.cdlsxd.cn/zltx_api/admin/direct/ai/%s"
add_url: "https://gateway.dev.cdlsxd.cn/zltx_api/admin/direct/log/%s/%s"
api_key: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyQ2VudGVyIiwiZXhwIjoxNzU4MDkxOTU4LCJuYmYiOjE3NTgwOTAxNTgsImp0aSI6IjEiLCJQaG9uZSI6IjE4MDAwMDAwMDAwIiwiVXNlck5hbWUiOiJsc3hkIiwiUmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJBY2NvdW50VHlwZSI6MSwiR3JvdXBDb2RlcyI6IlZDTF9DQVNISUVSLFZDTF9PUEVSQVRFLFZDTF9BRE1JTixWQ0xfQUFBLFZDTF9WQ0xfT1BFUkFULFZDTF9JTlZPSUNFLENSTV9BRE1JTixMSUFOTElBTl9BRE1JTixNQVJLRVRNQUcyX0FETUlOLFBIT05FQklMTF9BRE1JTixRSUFOWkhVX1NVUFBFUl9BRE0sTUFSS0VUSU5HU0FBU19TVVBFUkFETUlOLENBUkRfQ09ERSxDQVJEX1BST0NVUkVNRU5ULE1BUktFVElOR1NZU1RFTV9TVVBFUixTVEFUSVNUSUNBTFNZU1RFTV9BRE1JTixaTFRYX0FETUlOLFpMVFhfT1BFUkFURSIsIkRpbmdVc2VySWQiOiIxNjIwMjYxMjMwMjg5MzM4MzQifQ.Bjsx9f8yfcrV9EWxb0n6POwnXVOq9XPRD78JFZnnf1_VAVMN78W4W570SZL27PWuDnkD7E4oUg6RzeZwZgl7BZrNpNr-a-QpNC5qCptqrqXeNfVStmX7pxWA8GqnzI8ybkZgbhQ58Gje7DzdJtBq_8zte_LDaYhTYXdIc5EAG0AbCzAk22nPTl47nkMeHtmisXQVLEsdibl1hW3ViFJlXwfXvUrOENItmL1_mRYkggUB0MaTu2nHJOYM6PaOVGLHx-74eepnmK2rm6konFEb6ed-Ukc6gVR-nM9yWZaYLYNGNKJLwZoCX3tRuerq74n4kzQgWmUEJeaVI1yIGSw1zw"
zltxProduct:
enabled: true
base_url: "https://revcl.1688sup.com/api/admin/oursProduct"
add_url: "https://revcl.1688sup.com/api/admin/platformProduct/getProductsByOfficialProductId"
base_url: "https://gateway.dev.cdlsxd.cn/zltx_api/admin/oursProduct"
add_url: "https://gateway.dev.cdlsxd.cn/zltx_api/admin/platformProduct/getProductsByOfficialProductId"
api_key: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyQ2VudGVyIiwiZXhwIjoxNzU2MTgyNTM1LCJuYmYiOjE3NTYxODA3MzUsImp0aSI6IjEiLCJQaG9uZSI6IjE4MDAwMDAwMDAwIiwiVXNlck5hbWUiOiJsc3hkIiwiUmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJBY2NvdW50VHlwZSI6MSwiR3JvdXBDb2RlcyI6IlZDTF9DQVNISUVSLFZDTF9PUEVSQVRFLFZDTF9BRE1JTixWQ0xfQUFBLFZDTF9WQ0xfT1BFUkFULFZDTF9JTlZPSUNFLENSTV9BRE1JTixMSUFOTElBTl9BRE1JTixNQVJLRVRNQUcyX0FETUlOLFBIT05FQklMTF9BRE1JTixRSUFOWkhVX1NVUFBFUl9BRE0sTUFSS0VUSU5HU0FBU19TVVBFUkFETUlOLENBUkRfQ09ERSxDQVJEX1BST0NVUkVNRU5ULE1BUktFVElOR1NZU1RFTV9TVVBFUixTVEFUSVNUSUNBTFNZU1RFTV9BRE1JTixaTFRYX0FETUlOLFpMVFhfT1BFUkFURSIsIkRpbmdVc2VySWQiOiIxNjIwMjYxMjMwMjg5MzM4MzQifQ.N1xv1PYbcO8_jR5adaczc16YzGsr4z101gwEZdulkRaREBJNYTOnFrvRxTFx3RJTooXsqTqroE1MR84v_1WPX6BS6kKonA-kC1Jgot6yrt5rFWhGNGb2Cpr9rKIFCCQYmiGd3AUgDazEeaQ0_sodv3E-EXg9VfE1SX8nMcck9Yjnc8NCy7RTWaBIaSeOdZcEl-JfCD0S6GSx3oErp_hk-U9FKGwf60wAuDGTY1R0BP4BYpcEqS-C2LSnsSGyURi54Cuk5xH8r1WuF0Dm5bwAj5d7Hvs77-N_sUF-C5ONqyZJRAEhYLgcmN9RX_WQZfizdQJxizlTczdpzYfy-v-1eQ"
zltxOrderStatistics:
base_url: "https://revcl.1688sup.com/api/admin/direct/ai/search/"
base_url: "https://gateway.dev.cdlsxd.cn/zltx_api/admin/direct/ai/search/"
enabled: true
api_key: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJ1c2VyQ2VudGVyIiwiZXhwIjoxNzU2MTgyNTM1LCJuYmYiOjE3NTYxODA3MzUsImp0aSI6IjEiLCJQaG9uZSI6IjE4MDAwMDAwMDAwIiwiVXNlck5hbWUiOiJsc3hkIiwiUmVhbE5hbWUiOiLotoXnuqfnrqHnkIblkZgiLCJBY2NvdW50VHlwZSI6MSwiR3JvdXBDb2RlcyI6IlZDTF9DQVNISUVSLFZDTF9PUEVSQVRFLFZDTF9BRE1JTixWQ0xfQUFBLFZDTF9WQ0xfT1BFUkFULFZDTF9JTlZPSUNFLENSTV9BRE1JTixMSUFOTElBTl9BRE1JTixNQVJLRVRNQUcyX0FETUlOLFBIT05FQklMTF9BRE1JTixRSUFOWkhVX1NVUFBFUl9BRE0sTUFSS0VUSU5HU0FBU19TVVBFUkFETUlOLENBUkRfQ09ERSxDQVJEX1BST0NVUkVNRU5ULE1BUktFVElOR1NZU1RFTV9TVVBFUixTVEFUSVNUSUNBTFNZU1RFTV9BRE1JTixaTFRYX0FETUlOLFpMVFhfT1BFUkFURSIsIkRpbmdVc2VySWQiOiIxNjIwMjYxMjMwMjg5MzM4MzQifQ.N1xv1PYbcO8_jR5adaczc16YzGsr4z101gwEZdulkRaREBJNYTOnFrvRxTFx3RJTooXsqTqroE1MR84v_1WPX6BS6kKonA-kC1Jgot6yrt5rFWhGNGb2Cpr9rKIFCCQYmiGd3AUgDazEeaQ0_sodv3E-EXg9VfE1SX8nMcck9Yjnc8NCy7RTWaBIaSeOdZcEl-JfCD0S6GSx3oErp_hk-U9FKGwf60wAuDGTY1R0BP4BYpcEqS-C2LSnsSGyURi54Cuk5xH8r1WuF0Dm5bwAj5d7Hvs77-N_sUF-C5ONqyZJRAEhYLgcmN9RX_WQZfizdQJxizlTczdpzYfy-v-1eQ"
knowledge:

View File

@ -70,6 +70,7 @@ func (t *TaskBiz) GetUserPermission(req *entitys.TaskRequest, auth string) (code
// 发送请求
res, err := request.Send()
if err != nil {
err = errors.SysErr("请求用户权限失败")
return
}

View File

@ -112,6 +112,14 @@ func (t *OrderAfterSaleResellerTool) Execute(ctx context.Context, requireData *e
if len(req.OrderNumber) == 0 && len(req.Account) == 0 {
return fmt.Errorf("订单号 和 充值账号 不能同时为空")
}
// 时间格式不匹配,直接置为空
if req.SerialCreateTime != "" {
_, err := time.ParseInLocation(time.DateTime, req.SerialCreateTime, time.Local)
if err != nil {
entitys.ResLog(requireData.Ch, t.Name(), "时间格式不匹配,已置为空")
req.SerialCreateTime = ""
}
}
entitys.ResLog(requireData.Ch, t.Name(), "正在拉取售后订单信息")
@ -119,19 +127,21 @@ func (t *OrderAfterSaleResellerTool) Execute(ctx context.Context, requireData *e
}
func (t *OrderAfterSaleResellerTool) checkOrderAfterSaleReseller(toolReq OrderAfterSaleResellerRequest, requireData *entitys.RequireData) error {
// 流水创建时间上下浮动10min
serialCreateTime := time.Now()
var err error
var serialStartTime, serialEndTime int64
if toolReq.SerialCreateTime != "" {
serialCreateTime, err = time.ParseInLocation(time.DateTime, toolReq.SerialCreateTime, time.Local)
// 流水创建时间上下浮动10min
serialCreateTime, err := time.ParseInLocation(time.DateTime, toolReq.SerialCreateTime, time.Local)
if err != nil {
return err
}
serialStartTime = serialCreateTime.Unix() - 10*60
serialEndTime = serialCreateTime.Unix() + 10*60
} else {
// 未指定流水创建时间默认30天内
serialEndTime = time.Now().Unix()
serialStartTime = serialEndTime - 60*60*24*30 // 30天内
}
serialStartTime := serialCreateTime.Unix() - 10*60
serialEndTime := serialCreateTime.Unix() + 10*60
// 账号数量超过10直接截断
if len(toolReq.Account) > 10 {
entitys.ResLog(requireData.Ch, t.Name(), "账号数量超过10已被截断")
@ -144,6 +154,7 @@ func (t *OrderAfterSaleResellerTool) checkOrderAfterSaleReseller(toolReq OrderAf
// 最终输出
var orderList []*OrderAfterSaleResellerData
var err error
// 多订单号
if len(toolReq.OrderNumber) > 0 {
@ -245,6 +256,11 @@ func (t *OrderAfterSaleResellerTool) getAfterSaleResellerList(headers map[string
if responsibleType == 0 {
responsibleType = 4 // 默认无
}
// 售后金额
afterSalesPrice := util.StringToFloat64(originInput.AfterSalesPrice)
if afterSalesPrice == 0 {
afterSalesPrice = item.OrderPrice
}
orderList = append(orderList, &OrderAfterSaleResellerData{
OrderType: item.OrderType,
@ -261,7 +277,7 @@ func (t *OrderAfterSaleResellerTool) getAfterSaleResellerList(headers map[string
Platforms: item.Platforms,
AfterType: afterType,
Remark: originInput.AfterSalesReason,
AfterAmount: util.StringToFloat64(originInput.AfterSalesPrice),
AfterAmount: afterSalesPrice,
ResponsibleType: responsibleType,
ResponsiblePerson: originInput.ResponsiblePerson,
})

View File

@ -160,6 +160,11 @@ func (t *OrderAfterSaleResellerBatchTool) checkOrderAfterSaleResellerBatch(toolR
if responsibleType == 0 {
responsibleType = 4 // 默认无
}
// 售后金额
afterSalesPrice := util.StringToFloat64(toolReq.AfterSalesPrice)
if afterSalesPrice == 0 {
afterSalesPrice = item.OrderPrice
}
toolResp.Data = append(toolResp.Data, &OrderAfterSaleResellerBatchData{
OrderType: item.OrderType,
@ -176,7 +181,7 @@ func (t *OrderAfterSaleResellerBatchTool) checkOrderAfterSaleResellerBatch(toolR
Platforms: item.Platforms,
AfterType: afterType,
Remark: toolReq.AfterSalesReason,
AfterAmount: util.StringToFloat64(toolReq.AfterSalesPrice),
AfterAmount: afterSalesPrice,
ResponsibleType: responsibleType,
ResponsiblePerson: toolReq.ResponsiblePerson,
})

View File

@ -106,6 +106,14 @@ func (t *OrderAfterSaleSupplierTool) Execute(ctx context.Context, requireData *e
if len(req.SerialNumber) == 0 && len(req.Account) == 0 {
return fmt.Errorf("充值流水号 和 充值账号 不能同时为空")
}
// 时间格式不匹配,直接置为空
if req.SerialCreateTime != "" {
_, err := time.ParseInLocation(time.DateTime, req.SerialCreateTime, time.Local)
if err != nil {
entitys.ResLog(requireData.Ch, t.Name(), "时间格式不匹配,已置为空")
req.SerialCreateTime = ""
}
}
entitys.ResLog(requireData.Ch, t.Name(), "正在拉取售后订单信息")
@ -113,17 +121,20 @@ func (t *OrderAfterSaleSupplierTool) Execute(ctx context.Context, requireData *e
}
func (t *OrderAfterSaleSupplierTool) checkOrderAfterSaleSupplier(toolReq OrderAfterSaleSupplierRequest, requireData *entitys.RequireData) error {
// 流水创建时间上下浮动10min
serialCreateTime := time.Now()
var err error
var serialStartTime, serialEndTime int64
if toolReq.SerialCreateTime != "" {
serialCreateTime, err = time.ParseInLocation(time.DateTime, toolReq.SerialCreateTime, time.Local)
// 流水创建时间上下浮动10min
serialCreateTime, err := time.ParseInLocation(time.DateTime, toolReq.SerialCreateTime, time.Local)
if err != nil {
return err
}
serialStartTime = serialCreateTime.Unix() - 10*60
serialEndTime = serialCreateTime.Unix() + 10*60
} else {
// 未指定流水创建时间默认30天内
serialEndTime = time.Now().Unix()
serialStartTime = serialEndTime - 60*60*24*30 // 30天内
}
serialStartTime := serialCreateTime.Unix() - 10*60
serialEndTime := serialCreateTime.Unix() + 10*60
// 账号数量超过10直接截断
if len(toolReq.Account) > 10 {
@ -137,6 +148,7 @@ func (t *OrderAfterSaleSupplierTool) checkOrderAfterSaleSupplier(toolReq OrderAf
// 最终输出
var orderList []*OrderAfterSaleSupplierData
var err error
// 多流水号
if len(toolReq.SerialNumber) > 0 {
@ -232,6 +244,11 @@ func (t *OrderAfterSaleSupplierTool) getAfterSaleSupplierList(headers map[string
if afterType == 0 {
afterType = 1 // 默认退款
}
// 售后金额
afterSalesPrice := util.StringToFloat64(originInput.AfterSalesPrice)
if afterSalesPrice == 0 {
afterSalesPrice = item.PlatformPrice
}
orderList = append(orderList, &OrderAfterSaleSupplierData{
SerialNumber: item.SerialNumber,
@ -245,7 +262,7 @@ func (t *OrderAfterSaleSupplierTool) getAfterSaleSupplierList(headers map[string
PlatformID: item.PlatformID,
SignCompanyName: item.SignCompanyName,
Reason: originInput.AfterSalesReason,
SalePrice: util.StringToFloat64(originInput.AfterSalesPrice),
SalePrice: afterSalesPrice,
SaleType: afterType,
})
}

View File

@ -77,6 +77,7 @@ func (w *BotTool) BugOptimizationSubmit(ctx context.Context, requireData *entity
// 记录 task_id 到 session_id 的映射
w.SetTaskMapping(body.TaskId, requireData.Session)
entitys.ResLog(requireData.Ch, requireData.Match.Index, "问题记录中")
entitys.ResLoading(requireData.Ch, requireData.Match.Index, "问题记录中...")
// 等待异步回调完成再结束
for {
@ -84,8 +85,8 @@ func (w *BotTool) BugOptimizationSubmit(ctx context.Context, requireData *entity
if !ok || sessionID != requireData.Session {
break
}
entitys.ResLoading(requireData.Ch, requireData.Match.Index, "问题记录中...")
time.Sleep(time.Second)
time.Sleep(time.Second * 2)
}
return