package supplier import ( "context" "git.oa00.com/supply-chain/service/client" "git.oa00.com/supply-chain/service/lib/bean" "github.com/shopspring/decimal" ) type Supplier struct { Goods goods Apply supplierApply supplier } type supplier struct { } type ArgsSupplierAdd struct { SupplierName string // 供应商名称 Account string // 账户 Password string // 密码 PayType uint // 结算类型 Liaison string // 联系人 Phone string // 手机号 Annex string // 附件 ApplyUserId uint // 申请人Id } // Add @Title 添加供应商 func (s *supplier) Add(ctx context.Context, args ArgsSupplierAdd) error { xClient, err := client.GetClient(s) if err != nil { return err } reply := 0 return xClient.Call(ctx, "Add", args, &reply) } type SupplierSearch struct { SupplierName string Status uint } type ArgsSupplierLists struct { Search SupplierSearch Page bean.Page } type ReplySupplierLists struct { Lists []SupplierItem Total int64 } type SupplierItem struct { Id uint SupplierName string // 供应商名称 Status uint // 状态 Prepayment decimal.Decimal // 预付款余额 WarnStatus uint // 预警状态 ApplyUserId uint // 创建人Id CreatedAt int64 // 创建时间 } // Lists @Title 供应商列表 func (s *supplier) Lists(ctx context.Context, args ArgsSupplierLists) (reply ReplySupplierLists, err error) { xClient, err := client.GetClient(s) if err != nil { return ReplySupplierLists{}, err } 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) }