From 721146dc1faa1d348e9842efabcc1b1b7f96cad5 Mon Sep 17 00:00:00 2001 From: sian Date: Mon, 5 Sep 2022 10:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E4=BD=99=E9=A2=9D?= =?UTF-8?q?=E5=8F=98=E5=8A=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 | 1 + supplier/supplierWalletApply.go | 120 ++++++++++++++++++++++++++++++ supplier/supplierWalletHistory.go | 1 + 3 files changed, 122 insertions(+) create mode 100644 supplier/supplierWalletApply.go create mode 100644 supplier/supplierWalletHistory.go diff --git a/supplier/supplier.go b/supplier/supplier.go index 40f826e..88101ec 100644 --- a/supplier/supplier.go +++ b/supplier/supplier.go @@ -12,6 +12,7 @@ type Supplier struct { Apply supplierApply supplier WarnLiaison warnLiaison + WalletApply supplierWalletApply } type supplier struct { diff --git a/supplier/supplierWalletApply.go b/supplier/supplierWalletApply.go new file mode 100644 index 0000000..71bd441 --- /dev/null +++ b/supplier/supplierWalletApply.go @@ -0,0 +1,120 @@ +package supplier + +import ( + "context" + "git.oa00.com/supply-chain/service/client" + "git.oa00.com/supply-chain/service/lib/bean" + "github.com/shopspring/decimal" +) + +type supplierWalletApply struct { +} + +type ArgsSupplierWalletApplyLists struct { + Search SupplierWalletApplySearch + Page bean.Page +} + +type SupplierWalletApplySearch struct { + SupplierName string // 供应商名称 + Amount decimal.Decimal // 变动金额 + ApplyStartDate string // 申请开始日期 + ApplyEndDate string // 申请结束日期 + AuditStatus uint // 审核状态 + AuditStartDate string // 审核开始日期 + AuditEndDate string // 审核结束日期 +} + +type SupplierWalletApplyItem struct { + Id uint + SupplierName string + Amount decimal.Decimal + ApplyUserId uint + CreatedAt int64 + Reason string + AuditUserId uint + AuditTime int64 +} + +type ReplySupplierWalletApplyLists struct { + Lists []SupplierWalletApplyItem + Total int64 +} + +// Lists @Title 申请列表 +func (s *supplierWalletApply) Lists(ctx context.Context, args ArgsSupplierWalletApplyLists) (reply ReplySupplierWalletApplyLists, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Lists", args, &reply) + return +} + +type ReplySupplierWalletApplyInfo struct { + AuditStatus uint // 审核状态 + SupplierName string // 供应商名称 + Amount decimal.Decimal // 变动金额 + ApplyUserId uint // 申请人 + CreatedAt int64 // 申请时间 + Proof string // 凭证 +} + +// Info @Title 申请详情 +func (s *supplierWalletApply) Info(ctx context.Context, applyId uint) (reply ReplySupplierWalletApplyInfo, err error) { + xClient, err := client.GetClient(s) + if err != nil { + return + } + err = xClient.Call(ctx, "Info", applyId, &reply) + return +} + +type ArgsSupplierWalletApplyAdopt struct { + ApplyId uint + AuditUserId uint +} + +// Adopt @Title 申请详情 +func (s *supplierWalletApply) Adopt(ctx context.Context, args ArgsSupplierWalletApplyAdopt) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Adopt", args, &reply) +} + +type ArgsSupplierWalletApplyReject struct { + ApplyId uint + AuditUserId uint + Reason string +} + +// Reject @Title 申请详情 +func (s *supplierWalletApply) Reject(ctx context.Context, args ArgsSupplierWalletApplyReject) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Reject", args, &reply) +} + +type ArgsSupplierWalletApply struct { + Type uint // 变动类型 + Amount decimal.Decimal // 变动金额 + Proof string // 凭证 + ApplyUserId uint // 申请人 + SupplierId uint // 供应商Id +} + +// Apply @Title 变动申请 +func (s *supplierWalletApply) Apply(ctx context.Context, args ArgsSupplierWalletApply) error { + xClient, err := client.GetClient(s) + if err != nil { + return err + } + reply := 0 + return xClient.Call(ctx, "Apply", args, &reply) +} diff --git a/supplier/supplierWalletHistory.go b/supplier/supplierWalletHistory.go new file mode 100644 index 0000000..50a2908 --- /dev/null +++ b/supplier/supplierWalletHistory.go @@ -0,0 +1 @@ +package supplier