From ead1b1ea72cc3e433b3d5281db48592453a0fd1f Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 7 May 2026 17:08:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(factory):=20=E6=B7=BB=E5=8A=A0=E9=93=B6?= =?UTF-8?q?=E8=A1=8C=E7=AE=A1=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实现银行列表查询接口 - 添加银行信息新增功能 - 实现银行信息编辑功能 - 添加银行信息删除功能 - 定义银行数据结构体 - 集成客户端调用逻辑 --- erp/factory/bank.go | 80 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 erp/factory/bank.go diff --git a/erp/factory/bank.go b/erp/factory/bank.go new file mode 100644 index 0000000..4e0f818 --- /dev/null +++ b/erp/factory/bank.go @@ -0,0 +1,80 @@ +package factory + +import ( + "context" + "time" + + "git.kumo.work/shama/service/client" +) + +type bank struct { +} + +type BankItem struct { + Id int64 `json:"id"` + Bank string `json:"bank"` + BankAccount string `json:"bankAccount"` + BankAddress string `json:"bankAddress"` + BankCode string `json:"bankCode"` + MainFlag int64 `json:"mainFlag"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` +} + +// All @TITLE 获取银行 +func (c *bank) All(ctx context.Context, factoryId int64) (reply []BankItem, err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + err = xClient.Call(ctx, "All", factoryId, &reply) + return +} + +type ArgsBankAdd struct { + FactoryId int64 // 工厂ID + BankAdd +} + +type BankAdd struct { + Bank string // 开户银行 + BankAccount string // 银行账户 + BankAddress string // 银行地址 + BankCode string // 银行联行号 + MainFlag int64 // 主联系人标记(1=是,2=不是) +} + +// Add @TITLE 添加银行 +func (c *bank) Add(ctx context.Context, args ArgsBankAdd) (err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Add", args, &reply) +} + +type ArgsBankEdit struct { + BankId int64 // 银行ID + BankAdd +} + +// Edit @TITLE 编辑银行 +func (c *bank) Edit(ctx context.Context, args ArgsBankEdit) (err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Edit", args, &reply) +} + +// Delete @TITLE 删除银行 +func (c *bank) Delete(ctx context.Context, bankIds []int64) (err error) { + xClient, err := client.GetClient(c) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Delete", bankIds, &reply) +}