diff --git a/internal/tools/zltx_order_after_reseller.go b/internal/tools/zltx_order_after_reseller.go index b4da6cf..26891be 100644 --- a/internal/tools/zltx_order_after_reseller.go +++ b/internal/tools/zltx_order_after_reseller.go @@ -5,6 +5,7 @@ import ( "ai_scheduler/internal/entitys" "context" "encoding/json" + "fmt" ) type ZltxOrderAfterSaleResellerTool struct { @@ -50,13 +51,15 @@ func (t *ZltxOrderAfterSaleResellerTool) Definition() entitys.ToolDefinition { } type ZltxOrderAfterSaleResellerRequest struct { - OrderNumber string `json:"orderNumber"` // 订单号 - SerialNumber string `json:"serialNumber"` // 流水号 - Account string `json:"account"` // 充值账号 - OrderTimeStart string `json:"orderTimeStart"` // 订单执行开始时间 - OrderTimeEnd string `json:"orderTimeEnd"` // 订单执行结束时间 - AfterSalesReason string `json:"afterSalesReason"` // 售后原因 - AfterSalesPrice string `json:"afterSalesPrice"` // 售后金额 + OrderNumber []string `json:"orderNumber"` // 订单号 + Account []string `json:"account"` // 充值账号 + OrderTimeStart string `json:"orderTimeStart"` // 订单执行开始时间 + OrderTimeEnd string `json:"orderTimeEnd"` // 订单执行结束时间 + AfterType int `json:"afterType"` // 处理方式 1.退款 2.扣款 + AfterSalesPrice string `json:"afterSalesPrice"` // 售后金额 + AfterSalesReason string `json:"afterSalesReason"` // 售后原因 + ResponsibleType int `json:"responsibleType"` // 费用承担者 1.供应商 2.商务 3.公司 4.无 + ResponsiblePerson string `json:"responsiblePerson"` // 费用承担供应商 } type ZltxOrderAfterSaleResellerResponse struct { @@ -91,10 +94,10 @@ func (t *ZltxOrderAfterSaleResellerTool) Execute(ctx context.Context, requireDat if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil { return err } - // if req.OrderNumber == "" { - // return fmt.Errorf("orderType and orderNumber are required") - // } - return t.checkZltxOrderAfterSaleReseller(req.OrderNumber, requireData) + if len(req.OrderNumber) == 0 && len(req.Account) == 0 { + return fmt.Errorf("orderNumber or account are required") + } + return t.checkZltxOrderAfterSaleReseller(req.OrderNumber[0], requireData) } func (t *ZltxOrderAfterSaleResellerTool) checkZltxOrderAfterSaleReseller(orderNumber string, requireData *entitys.RequireData) error { diff --git a/internal/tools/zltx_order_after_supplier.go b/internal/tools/zltx_order_after_supplier.go index af7aba1..2fca4cf 100644 --- a/internal/tools/zltx_order_after_supplier.go +++ b/internal/tools/zltx_order_after_supplier.go @@ -5,6 +5,7 @@ import ( "ai_scheduler/internal/entitys" "context" "encoding/json" + "fmt" ) type ZltxOrderAfterSaleSupplierTool struct { @@ -88,9 +89,9 @@ func (t *ZltxOrderAfterSaleSupplierTool) Execute(ctx context.Context, requireDat if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil { return err } - // if req.OrderNumber == "" { - // return fmt.Errorf("orderType and orderNumber are required") - // } + if req.OrderNumber == "" { + return fmt.Errorf("orderType and orderNumber are required") + } return t.checkZltxOrderAfterSaleSupplier(req.OrderNumber, requireData) }