diff --git a/supplier/goods.go b/supplier/goods.go index 5bf7b07..d299c9f 100644 --- a/supplier/goods.go +++ b/supplier/goods.go @@ -73,16 +73,17 @@ type ArgsGoodsInfo struct { } type ReplyGoodsInfo struct { - Id uint `json:"id"` - Name string `json:"name"` - SupplierId uint `json:"supplierId"` - CategoryId uint `json:"categoryId"` - BrandId uint `json:"brandId"` - Imgs []string `json:"imgs"` - Content string `json:"content"` - Attributes []GoodsAttributeItem `json:"attributes"` - Skus []SkuItem `json:"skus"` - Status uint `json:"status"` + Id uint `json:"id"` + Name string `json:"name"` + SupplierId uint `json:"supplierId"` + SupplierName string `json:"supplierName"` + CategoryId uint `json:"categoryId"` + BrandId uint `json:"brandId"` + Imgs []string `json:"imgs"` + Content string `json:"content"` + Attributes []GoodsAttributeItem `json:"attributes"` + Skus []SkuItem `json:"skus"` + Status uint `json:"status"` } type GoodsAttributeItem struct { diff --git a/supplier/supplier.go b/supplier/supplier.go index 75e2de4..0a7bd0d 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -58,7 +58,7 @@ type SupplierItem struct { Status uint // 状态 Prepayment decimal.Decimal // 预付款余额 WarnStatus uint // 预警状态 - ApplyUserId uint // 创建人 + ApplyUserId uint // 创建人Id CreatedAt int64 // 创建时间 } @@ -71,3 +71,63 @@ func (s *supplier) Lists(ctx context.Context, args ArgsSupplierLists) (reply Rep err = xClient.Call(ctx, "Lists", args, &reply) return } + +// Enabled @Title 启用供应商 +func (s *supplier) Enabled(ctx context.Context, supplierId uint) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Enabled", supplierId, &reply) +} + +// Disabled @Title 启用供应商 +func (s *supplier) Disabled(ctx context.Context, supplierId uint) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Disabled", supplierId, &reply) +} + +type ReplySupplierInfo struct { + SupplierId uint + SupplierName string // 供应商名称 + Account string // 账户名 + PayType uint // 结算方式 + Liaison string // 联系人 + Phone string // 手机号 + Annex string // 附件 +} + +// Info @Title 供应商详情 +func (s *supplier) Info(ctx context.Context, supplierId uint) (reply ReplySupplierInfo, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return ReplySupplierInfo{}, err + } + err = xClient.Call(ctx, "Info", supplierId, &reply) + return +} + +type ArgsSupplierEdit struct { + SupplierId uint + SupplierName string // 供应商名称 + Password string // 密码 + PayType uint // 结算方式 + Liaison string // 联系然 + Phone string // 手机号 + Annex string // 附件 +} + +// Edit @Title 供应商详情 +func (s *supplier) Edit(ctx context.Context, args ArgsSupplierEdit) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Edit", args, &reply) +} diff --git a/supplier/supplierApply.go b/supplier/supplierApply.go index 34e0242..29fa733 100644 --- a/supplier/supplierApply.go +++ b/supplier/supplierApply.go @@ -47,11 +47,14 @@ func (s *supplierApply) Lists(ctx context.Context, args ArgsSupplierApplyLists) type ReplySupplierApplyInfo struct { AuditStatus uint - SupplierName string - Account string - Liaison string - Phone string - Annex string + SupplierName string // 供应商名称 + Account string // 账户 + Liaison string // 联系人 + Phone string // 手机号 + Annex string // 附件 + Reason string // 驳回原因 + AuditUserId uint // 审核人id + AuditTime int64 // 审核时间 } // Info @Title 审核详情 @@ -94,3 +97,23 @@ func (s *supplierApply) Reject(ctx context.Context, args ArgsSupplierApplyReject reply := 0 return xClient.Call(ctx, "Reject", args, &reply) } + +type ArgsSupplierApplyReAudit struct { + ApplyId uint + SupplierName string // 供应商名称 + Account string // 账户 + Password string // 密码 + Liaison string // 联系人 + Phone string // 手机号 + Annex string // 附件 +} + +// ReAudit @Title 重新审核 +func (s *supplierApply) ReAudit(ctx context.Context, args ArgsSupplierApplyReAudit) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "ReAudit", args, &reply) +}