fix: 暂存
This commit is contained in:
parent
3eaba6004a
commit
bf0fa441d9
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"ai_scheduler/internal/entitys"
|
"ai_scheduler/internal/entitys"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ZltxOrderAfterSaleResellerTool struct {
|
type ZltxOrderAfterSaleResellerTool struct {
|
||||||
|
|
@ -50,13 +51,15 @@ func (t *ZltxOrderAfterSaleResellerTool) Definition() entitys.ToolDefinition {
|
||||||
}
|
}
|
||||||
|
|
||||||
type ZltxOrderAfterSaleResellerRequest struct {
|
type ZltxOrderAfterSaleResellerRequest struct {
|
||||||
OrderNumber string `json:"orderNumber"` // 订单号
|
OrderNumber []string `json:"orderNumber"` // 订单号
|
||||||
SerialNumber string `json:"serialNumber"` // 流水号
|
Account []string `json:"account"` // 充值账号
|
||||||
Account string `json:"account"` // 充值账号
|
OrderTimeStart string `json:"orderTimeStart"` // 订单执行开始时间
|
||||||
OrderTimeStart string `json:"orderTimeStart"` // 订单执行开始时间
|
OrderTimeEnd string `json:"orderTimeEnd"` // 订单执行结束时间
|
||||||
OrderTimeEnd string `json:"orderTimeEnd"` // 订单执行结束时间
|
AfterType int `json:"afterType"` // 处理方式 1.退款 2.扣款
|
||||||
AfterSalesReason string `json:"afterSalesReason"` // 售后原因
|
AfterSalesPrice string `json:"afterSalesPrice"` // 售后金额
|
||||||
AfterSalesPrice string `json:"afterSalesPrice"` // 售后金额
|
AfterSalesReason string `json:"afterSalesReason"` // 售后原因
|
||||||
|
ResponsibleType int `json:"responsibleType"` // 费用承担者 1.供应商 2.商务 3.公司 4.无
|
||||||
|
ResponsiblePerson string `json:"responsiblePerson"` // 费用承担供应商
|
||||||
}
|
}
|
||||||
|
|
||||||
type ZltxOrderAfterSaleResellerResponse struct {
|
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 {
|
if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// if req.OrderNumber == "" {
|
if len(req.OrderNumber) == 0 && len(req.Account) == 0 {
|
||||||
// return fmt.Errorf("orderType and orderNumber are required")
|
return fmt.Errorf("orderNumber or account are required")
|
||||||
// }
|
}
|
||||||
return t.checkZltxOrderAfterSaleReseller(req.OrderNumber, requireData)
|
return t.checkZltxOrderAfterSaleReseller(req.OrderNumber[0], requireData)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *ZltxOrderAfterSaleResellerTool) checkZltxOrderAfterSaleReseller(orderNumber string, requireData *entitys.RequireData) error {
|
func (t *ZltxOrderAfterSaleResellerTool) checkZltxOrderAfterSaleReseller(orderNumber string, requireData *entitys.RequireData) error {
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import (
|
||||||
"ai_scheduler/internal/entitys"
|
"ai_scheduler/internal/entitys"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ZltxOrderAfterSaleSupplierTool struct {
|
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 {
|
if err := json.Unmarshal([]byte(requireData.Match.Parameters), &req); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// if req.OrderNumber == "" {
|
if req.OrderNumber == "" {
|
||||||
// return fmt.Errorf("orderType and orderNumber are required")
|
return fmt.Errorf("orderType and orderNumber are required")
|
||||||
// }
|
}
|
||||||
return t.checkZltxOrderAfterSaleSupplier(req.OrderNumber, requireData)
|
return t.checkZltxOrderAfterSaleSupplier(req.OrderNumber, requireData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue