From 9e11d54f1f5268763ff3b817d05b9c74d27e713f Mon Sep 17 00:00:00 2001 From: sian Date: Thu, 1 Sep 2022 10:50:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- supplier/supplier.go | 38 ++++++++++++++++++++++++++++++++ supplier/supplierApply.go | 46 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 supplier/supplierApply.go 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 +}