feat(erp): 新增对账单列表查询功能
- 创建独立的 transfer 子包,将转账相关结构体拆分管理 - 新增 statement 结构体及对账单相关数据模型定义 - 实现对账单列表查询接口,支持按类型、凭证号、收支方向、银行账号等多条件筛选 - 在 transfer 主结构体中通过内嵌方式集成新的 Transfer 包
This commit is contained in:
@@ -5,11 +5,13 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.kumo.work/shama/service/client"
|
"git.kumo.work/shama/service/client"
|
||||||
|
transfer2 "git.kumo.work/shama/service/erp/transfer"
|
||||||
"git.kumo.work/shama/service/lib/bean"
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
"github.com/shopspring/decimal"
|
"github.com/shopspring/decimal"
|
||||||
)
|
)
|
||||||
|
|
||||||
type transfer struct {
|
type transfer struct {
|
||||||
|
transfer2.Transfer
|
||||||
}
|
}
|
||||||
|
|
||||||
type ArgsTransferList struct {
|
type ArgsTransferList struct {
|
||||||
|
|||||||
71
erp/transfer/statement.go
Normal file
71
erp/transfer/statement.go
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
package transfer
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"git.kumo.work/shama/service/client"
|
||||||
|
"git.kumo.work/shama/service/lib/bean"
|
||||||
|
"github.com/shopspring/decimal"
|
||||||
|
)
|
||||||
|
|
||||||
|
type statement struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
type ArgsStatementList struct {
|
||||||
|
Page bean.Page
|
||||||
|
Search StatementSearch
|
||||||
|
}
|
||||||
|
type StatementSearch struct {
|
||||||
|
Type string // 类型
|
||||||
|
VoucherNo string // 凭证号
|
||||||
|
TransactionDirection int64 // 收支方向 1=收入 2=支出
|
||||||
|
AccountType int64 // 对公对私 1=对公 2=对私
|
||||||
|
Bank string // 银行
|
||||||
|
BankAccount string // 银行账号
|
||||||
|
BankAccountName string // 银行账号名称
|
||||||
|
OppBank string // 对方银行
|
||||||
|
OppBankAccount string // 对方银行账号
|
||||||
|
OppBankAccountName string // 对方银行账号名称
|
||||||
|
}
|
||||||
|
type ReplyStatementList struct {
|
||||||
|
List []StatementItem `json:"list"`
|
||||||
|
Total int64 `json:"total"`
|
||||||
|
}
|
||||||
|
type StatementItem struct {
|
||||||
|
Id int64 `json:"Id"`
|
||||||
|
Type string `json:"Type"`
|
||||||
|
Name string `json:"Name"`
|
||||||
|
TransferSerial string `json:"TransferSerial"`
|
||||||
|
VoucherNo string `json:"VoucherNo"`
|
||||||
|
TransactionDirection int64 `json:"TransactionDirection"`
|
||||||
|
Bank string `json:"Bank"`
|
||||||
|
BankAccount string `json:"BankAccount"`
|
||||||
|
BankAccountName string `json:"BankAccountName"`
|
||||||
|
OppBank string `json:"OppBank"`
|
||||||
|
OppBankAccount string `json:"OppBankAccount"`
|
||||||
|
OppBankAccountName string `json:"OppBankAccountName"`
|
||||||
|
Amount decimal.Decimal `json:"Amount"`
|
||||||
|
Currency string `json:"Currency"`
|
||||||
|
CurrencyName string `json:"CurrencyName"`
|
||||||
|
CurrencySymbol string `json:"CurrencySymbol"`
|
||||||
|
SrcCurrency string `json:"SrcCurrency"`
|
||||||
|
AccountType int64 `json:"AccountType"`
|
||||||
|
Purpose string `json:"Purpose"`
|
||||||
|
TransactionAt time.Time `json:"TransactionAt"`
|
||||||
|
RecAt time.Time `json:"RecAt"`
|
||||||
|
Remark string `json:"Remark"`
|
||||||
|
FeeInfo string `json:"FeeInfo"`
|
||||||
|
CreatedAt *time.Time `json:"CreatedAt"`
|
||||||
|
UpdatedAt *time.Time `json:"UpdatedAt"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// List @TITLE 列表
|
||||||
|
func (s *statement) List(ctx context.Context, args ArgsStatementList) (reply ReplyStatementList, err error) {
|
||||||
|
xClient, err := client.GetClient(s)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
err = xClient.Call(ctx, "List", args, &reply)
|
||||||
|
return
|
||||||
|
}
|
||||||
5
erp/transfer/transfer.go
Normal file
5
erp/transfer/transfer.go
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package transfer
|
||||||
|
|
||||||
|
type Transfer struct {
|
||||||
|
Statement statement
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user