- 创建独立的 transfer 子包,将转账相关结构体拆分管理 - 新增 statement 结构体及对账单相关数据模型定义 - 实现对账单列表查询接口,支持按类型、凭证号、收支方向、银行账号等多条件筛选 - 在 transfer 主结构体中通过内嵌方式集成新的 Transfer 包
78 lines
2.3 KiB
Go
78 lines
2.3 KiB
Go
package erp
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
transfer2 "git.kumo.work/shama/service/erp/transfer"
|
|
"git.kumo.work/shama/service/lib/bean"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type transfer struct {
|
|
transfer2.Transfer
|
|
}
|
|
|
|
type ArgsTransferList struct {
|
|
Page bean.Page
|
|
Search TransferSearch
|
|
}
|
|
type TransferSearch struct {
|
|
TransferSerial string // 打款单号
|
|
VoucherNo string // 凭证号
|
|
TransferType string // 打款类型
|
|
BusinessType string // 业务类型
|
|
CreatedStaffId int64 // 创建人
|
|
}
|
|
type ReplyTransferList struct {
|
|
List []TransferItem `json:"list"`
|
|
Total int64 `json:"total"`
|
|
}
|
|
type TransferItem struct {
|
|
Id int64 `json:"id"`
|
|
TransferSerial string `json:"transferSerial"`
|
|
VoucherNo string `json:"voucherNo"`
|
|
TransferType string `json:"transferType"`
|
|
BusinessId int64 `json:"businessId"`
|
|
BusinessType string `json:"businessType"`
|
|
BusinessName string `json:"businessName"`
|
|
BankAccount string `json:"bankAccount"`
|
|
PaymentAccount string `json:"paymentAccount"`
|
|
PaymentAccountName string `json:"paymentAccountName"`
|
|
Amount decimal.Decimal `json:"amount"`
|
|
Purpose string `json:"purpose"`
|
|
Status int64 `json:"status"`
|
|
TransferAt *time.Time `json:"transferAt"`
|
|
Remark string `json:"remark"`
|
|
StaffId int64 `json:"staffId"`
|
|
ErrMsg string `json:"errMsg"`
|
|
CreatedAt *time.Time `json:"createdAt"`
|
|
UpdatedAt *time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
// List @TITLE 列表
|
|
func (t *transfer) List(ctx context.Context, args ArgsTransferList) (reply ReplyTransferList, err error) {
|
|
xClient, err := client.GetClient(t)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "List", args, &reply)
|
|
return
|
|
}
|
|
|
|
type TransferTypeItem struct {
|
|
Key string `json:"key"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Types @TITLE 打款类型
|
|
func (t *transfer) Types(ctx context.Context) (reply []TransferItem, err error) {
|
|
xClient, err := client.GetClient(t)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Types", 0, &reply)
|
|
return
|
|
}
|