diff --git a/supplier/supplier.go b/supplier/supplier.go index 91e661a..75e2de4 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -3,10 +3,13 @@ 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 } @@ -33,3 +36,38 @@ func (s *supplier) Add(ctx context.Context, args ArgsSupplierAdd) error { 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 // 创建人 + 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 +} diff --git a/supplier/supplierApply.go b/supplier/supplierApply.go new file mode 100644 index 0000000..128bf66 --- /dev/null +++ b/supplier/supplierApply.go @@ -0,0 +1,46 @@ +package supplier + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" +) + +type supplierApply struct { +} + +type ArgsSupplierApplyLists struct { + Search SupplierApplySearch + Page bean.Page +} + +type SupplierApplySearch struct { + SupplierName string + AuditStatus uint + ApplyUserId uint +} + +type ReplySupplierApplyLists struct { + Lists []SupplierApplyItem + Total int64 +} + +type SupplierApplyItem struct { + ApplyId uint + SupplierName string // 供应商名称 + ApplyUserId uint // 申请人 + AuditStatus uint // 审核状态 + AuditUserId uint // 审核人 + AuditTime int64 // 审核时间 + CreatedAt int64 // 申请时间 +} + +// Lists @Title 审核列表 +func (s *supplierApply) Lists(ctx context.Context, args ArgsSupplierApplyLists) (reply ReplySupplierApplyLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return ReplySupplierApplyLists{}, err + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +}