feat(factory): 添加银行管理功能

- 实现银行列表查询接口
- 添加银行信息新增功能
- 实现银行信息编辑功能
- 添加银行信息删除功能
- 定义银行数据结构体
- 集成客户端调用逻辑
This commit is contained in:
2026-05-07 17:08:56 +08:00
parent d025186d28
commit ead1b1ea72

80
erp/factory/bank.go Normal file
View File

@@ -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)
}