You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
service/supplier/supplier.go

94 lines
2.1 KiB

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 {
2 years ago
Goods goods
Apply supplierApply
2 years ago
supplier
2 years ago
}
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 添加供应商
2 years ago
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 {
2 years ago
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)
}