- 在ReplyReceiptList中增加Count字段返回收据统计数据 - 新增ReceiptCount结构体包含EntryAmount、ReceivableFxAmount和ClaimAmount字段 - 在ReplyRequestList中增加Count字段返回请求统计数据 - 新增RequestCount结构体包含PrepaidAmount、Amount和PaidAmount字段 - 为收付款列表接口提供金额汇总统计支持
231 lines
8.0 KiB
Go
231 lines
8.0 KiB
Go
package erp
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"git.kumo.work/shama/service/client"
|
|
request2 "git.kumo.work/shama/service/erp/request"
|
|
"git.kumo.work/shama/service/lib/bean"
|
|
"github.com/shopspring/decimal"
|
|
)
|
|
|
|
type request struct {
|
|
request2.Request
|
|
}
|
|
type ArgsRequestList struct {
|
|
Page bean.Page
|
|
Search RequestSearch
|
|
}
|
|
type RequestSearch struct {
|
|
RequestSerial string // 报销单号
|
|
InvoiceSerial string // 发票号
|
|
CreatedAtStart *time.Time // 创建开始时间
|
|
CreatedAtEnd *time.Time // 创建结束时间
|
|
PayAtStart *time.Time // 付款开始时间
|
|
PayAtEnd *time.Time // 付款结束时间
|
|
AuditAtStart *time.Time // 审核开始时间
|
|
AuditAtEnd *time.Time // 审核结束时间
|
|
RequestIds []int64 // 申请单id
|
|
BanFlag int64 // 禁用标记 1=禁用 2=启用
|
|
BankAccount string // 银行账号
|
|
BankName string // 账号名称
|
|
AccountingSerial string // 做账合同号
|
|
WorkflowStatus int64 // 审核状态
|
|
PaidAmountStart *decimal.Decimal // 实付金额开始
|
|
PaidAmountEnd *decimal.Decimal // 实付金额结束
|
|
CreatedStaffIds []int64 // 创建人
|
|
Currency string // 币种
|
|
Ik3cloudStatus int64 // ik3cloud状态
|
|
}
|
|
type ReplyRequestList struct {
|
|
List []RequestItem `json:"list"`
|
|
Total int64 `json:"total"`
|
|
Count RequestCount `json:"count"`
|
|
}
|
|
type RequestItem struct {
|
|
Id int64 `json:"id"`
|
|
FactoryId int64 `json:"factoryId"`
|
|
FactoryName string `json:"factoryName"`
|
|
FactoryBank string `json:"factoryBank"`
|
|
FactoryBankAccount string `json:"factoryBankAccount"`
|
|
AccountingSerial string `json:"accountingSerial"`
|
|
PayableSerial string `json:"payableSerial"`
|
|
InvoiceSerial string `json:"invoiceSerial"`
|
|
PaymentType int64 `json:"paymentType"`
|
|
RequestSerial string `json:"requestSerial"`
|
|
Currency string `json:"currency"`
|
|
CurrencyName string `json:"currencyName"`
|
|
CurrencySymbol string `json:"currencySymbol"`
|
|
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
|
Remarks string `json:"remarks"`
|
|
BankAccount string `json:"bankAccount"`
|
|
BankName string `json:"bankName"`
|
|
PayAt *time.Time `json:"payAt"`
|
|
PrepaidAmount decimal.Decimal `json:"prepaidAmount"`
|
|
Amount decimal.Decimal `json:"amount"`
|
|
PaidAmount decimal.Decimal `json:"paidAmount"`
|
|
BanFlag int64 `json:"banFlag"`
|
|
WorkflowId int64 `json:"workflowId"`
|
|
WorkflowStatus int64 `json:"workflowStatus"`
|
|
WorkflowReason string `json:"workflowReason"`
|
|
CreatedStaffId int64 `json:"createdStaffId"`
|
|
Ik3cloudStatus int64 `json:"ik3CloudStatus"`
|
|
Ik3cloudErrMsg string `json:"ik3CloudErrMsg"`
|
|
Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"`
|
|
CreatedAt *time.Time `json:"createdAt"`
|
|
UpdatedAt *time.Time `json:"updatedAt"`
|
|
}
|
|
type RequestCount struct {
|
|
PrepaidAmount decimal.Decimal `json:"prepaidAmount"`
|
|
Amount decimal.Decimal `json:"amount"`
|
|
PaidAmount decimal.Decimal `json:"paidAmount"`
|
|
}
|
|
|
|
// List @TITLE 列表
|
|
func (r *request) List(ctx context.Context, args ArgsRequestList) (reply ReplyRequestList, err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "List", args, &reply)
|
|
return
|
|
}
|
|
|
|
type ArgsRequestAdd struct {
|
|
StaffId int64
|
|
RequestAdd
|
|
}
|
|
type RequestAdd struct {
|
|
FactoryId int64 // 工厂id
|
|
FactoryName string // 工厂名称
|
|
FactoryBank string // 银行
|
|
FactoryBankAccount string // 银行账号
|
|
Currency string // 币种
|
|
CurrencyName string // 币种名称
|
|
CurrencySymbol string // 币种符号
|
|
CurrencyRate decimal.Decimal // 币种汇率
|
|
Remarks string // 备注
|
|
Amount decimal.Decimal // 金额
|
|
BankAccount string // 银行账号
|
|
BankName string // 账号名称
|
|
}
|
|
|
|
// Add @TITLE 添加
|
|
func (r *request) Add(ctx context.Context, args ArgsRequestAdd) (requestId int64, err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Add", args, &requestId)
|
|
return
|
|
}
|
|
|
|
// Gen @TITLE 生成付款单
|
|
func (r *request) Gen(ctx context.Context, payableId int64) (err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Gen", payableId, &reply)
|
|
}
|
|
|
|
type ReplyRequestInfo struct {
|
|
Id int64 `json:"id"`
|
|
RequestSerial string `json:"requestSerial"`
|
|
FactoryId int64 `json:"factoryId"`
|
|
FactoryName string `json:"factoryName"`
|
|
FactoryBank string `json:"factoryBank"`
|
|
FactoryBankAccount string `json:"factoryBankAccount"`
|
|
AccountingSerial string `json:"accountingSerial"`
|
|
PayableSerial string `json:"payableSerial"`
|
|
InvoiceSerial string `json:"invoiceSerial"`
|
|
PaymentType int64 `json:"paymentType"`
|
|
Currency string `json:"currency"`
|
|
CurrencyName string `json:"currencyName"`
|
|
CurrencySymbol string `json:"currencySymbol"`
|
|
CurrencyRate decimal.Decimal `json:"currencyRate"`
|
|
PrepaidAmount decimal.Decimal `json:"prepaidAmount"`
|
|
Amount decimal.Decimal `json:"amount"`
|
|
PaidAmount decimal.Decimal `json:"paidAmount"`
|
|
Remarks string `json:"remarks"`
|
|
BankAccount string `json:"bankAccount"`
|
|
BankName string `json:"bankName"`
|
|
PayAt *time.Time `json:"payAt"`
|
|
WorkflowId int64 `json:"workflowId"`
|
|
WorkflowStatus int64 `json:"workflowStatus"`
|
|
WorkflowReason string `json:"workflowReason"`
|
|
CreatedStaffId int64 `json:"createdStaffId"`
|
|
BanFlag int64 `json:"banFlag"`
|
|
Ik3cloudStatus int64 `json:"ik3CloudStatus"`
|
|
Ik3cloudErrMsg string `json:"ik3CloudErrMsg"`
|
|
Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"`
|
|
CreatedAt *time.Time `json:"createdAt"`
|
|
UpdatedAt *time.Time `json:"updatedAt"`
|
|
}
|
|
|
|
// Info @TITLE 详情
|
|
func (r *request) Info(ctx context.Context, requestId int64) (reply ReplyRequestInfo, err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
err = xClient.Call(ctx, "Info", requestId, &reply)
|
|
return
|
|
}
|
|
|
|
type ArgsRequestEdit struct {
|
|
RequestId int64
|
|
RequestAdd
|
|
}
|
|
|
|
// Edit @TITLE 编辑
|
|
func (r *request) Edit(ctx context.Context, args ArgsRequestEdit) (err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Edit", args, &reply)
|
|
}
|
|
|
|
type ArgsRequestChange struct {
|
|
RequestIds []int64
|
|
RequestChangeItem
|
|
}
|
|
type RequestChangeItem struct {
|
|
BankAccount string // 银行账号
|
|
BankName string // 账号名称
|
|
}
|
|
|
|
// BatchChange @TITLE 批量修改
|
|
func (r *request) BatchChange(ctx context.Context, args ArgsRequestChange) (err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "BatchChange", args, &reply)
|
|
}
|
|
|
|
// Ik3cloud @TITLE 同步
|
|
func (r *request) Ik3cloud(ctx context.Context, requestId int64) (err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Ik3cloud", requestId, &reply)
|
|
}
|
|
|
|
// Cancel @TITLE 作废
|
|
func (r *request) Cancel(ctx context.Context, requestId int64) (err error) {
|
|
xClient, err := client.GetClient(r)
|
|
if err != nil {
|
|
return
|
|
}
|
|
reply := 0
|
|
return xClient.Call(ctx, "Cancel", requestId, &reply)
|
|
}
|