76 lines
2.2 KiB
Go
76 lines
2.2 KiB
Go
package erp
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
"git.kumo.work/shama/service/lib/bean"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type transfer struct {
|
|
}
|
|
|
|
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
|
|
}
|