From aad11de594d2a87c21e8be2d0cabe26d3ae79921 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 21 Jan 2026 13:36:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(erp):=20=E6=B7=BB=E5=8A=A0=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E7=B1=BB=E5=9E=8B=E5=B8=B8=E9=87=8F=E5=92=8C=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E4=BB=98=E6=AC=BE=E5=8D=95=E7=9B=B8=E5=85=B3=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 PaymentType 类型和 Purchase、Cost 枚举值 - 在 RequestSearch 结构体中添加 AccountingSerial 字段 - 在 RequestItem 结构体中添加 AccountingSerial、PayableSerial、PaymentType 等字段 - 在请求结构体中移除已弃用的 DueDate 和 ExpectedPayDate 字段 - 添加 PrepaidAmount 和 PaidAmount 金额相关字段 --- erp/constant.go | 7 +++++++ erp/request.go | 39 +++++++++++++++++++++++++++++++-------- erp/request/cost.go | 38 +++++++++++++++++--------------------- 3 files changed, 55 insertions(+), 29 deletions(-) diff --git a/erp/constant.go b/erp/constant.go index cae43fd..de14c66 100644 --- a/erp/constant.go +++ b/erp/constant.go @@ -104,3 +104,10 @@ const ( Ik3cloudStatusSuccess Ik3cloudStatus = 3 // 推送成功 Ik3cloudStatusFail Ik3cloudStatus = 4 // 推送失败 ) + +type PaymentType = int64 + +const ( + PaymentTypePurchase PaymentType = 1 // 采购付款单 + PaymentTypeCost PaymentType = 2 // 费用付款单 +) diff --git a/erp/request.go b/erp/request.go index 4cf0f23..f8ff3ca 100644 --- a/erp/request.go +++ b/erp/request.go @@ -18,14 +18,15 @@ type ArgsRequestList struct { Search RequestSearch } type RequestSearch struct { - RequestSerial string // 报销单号 - InvoiceSerial string // 发票号 - CreatedAtStart *time.Time // 创建开始时间 - CreatedAtEnd *time.Time // 创建结束时间 - RequestIds []int64 // 申请单id - BanFlag int64 // 禁用标记 1=禁用 2=启用 - BankAccount string // 银行账号 - BankName string // 账号名称 + RequestSerial string // 报销单号 + InvoiceSerial string // 发票号 + CreatedAtStart *time.Time // 创建开始时间 + CreatedAtEnd *time.Time // 创建结束时间 + RequestIds []int64 // 申请单id + BanFlag int64 // 禁用标记 1=禁用 2=启用 + BankAccount string // 银行账号 + BankName string // 账号名称 + AccountingSerial string // 做账合同号 } type ReplyRequestList struct { List []RequestItem `json:"list"` @@ -37,6 +38,10 @@ type RequestItem struct { 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"` @@ -45,7 +50,9 @@ type RequestItem struct { Remarks string `json:"remarks"` BankAccount string `json:"bankAccount"` BankName string `json:"bankName"` + 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"` @@ -97,6 +104,16 @@ func (r *request) Add(ctx context.Context, args ArgsRequestAdd) (requestId int64 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"` @@ -104,11 +121,17 @@ type ReplyRequestInfo struct { 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"` diff --git a/erp/request/cost.go b/erp/request/cost.go index 8caf41d..7556c32 100644 --- a/erp/request/cost.go +++ b/erp/request/cost.go @@ -23,18 +23,16 @@ type ReplyCostList struct { Total int64 `json:"total"` } type CostItem struct { - Id int64 `json:"id"` - RequestId int64 `json:"requestId"` - TypeNumber string `json:"typeNumber"` - TypeName string `json:"typeName"` - Amount decimal.Decimal `json:"amount"` - DepartmentId int64 `json:"departmentId"` - InvoiceSerial string `json:"invoiceSerial"` - Remarks string `json:"remarks"` - DueDate *time.Time `json:"dueDate"` - ExpectedPayDate *time.Time `json:"expectedPayDate"` - CreatedAt *time.Time `json:"createdAt"` - UpdatedAt *time.Time `json:"updatedAt"` + Id int64 `json:"id"` + RequestId int64 `json:"requestId"` + TypeNumber string `json:"typeNumber"` + TypeName string `json:"typeName"` + Amount decimal.Decimal `json:"amount"` + DepartmentId int64 `json:"departmentId"` + InvoiceSerial string `json:"invoiceSerial"` + Remarks string `json:"remarks"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` } // List @TITLE 列表 @@ -48,15 +46,13 @@ func (c *cost) List(ctx context.Context, args ArgsCostList) (reply ReplyCostList } type ArgsCostAdd struct { - RequestId int64 // 报销单ID - TypeNumber string // 费用类型 - TypeName string // 费用类型名称 - Amount decimal.Decimal // 金额 - DepartmentId int64 // 部门 - Remarks string // 备注 - InvoiceSerial string // 发票号 - DueDate *time.Time // 到期日期 - ExpectedPayDate *time.Time // 期望付款日期 + RequestId int64 // 报销单ID + TypeNumber string // 费用类型 + TypeName string // 费用类型名称 + Amount decimal.Decimal // 金额 + DepartmentId int64 // 部门 + Remarks string // 备注 + InvoiceSerial string // 发票号 } // Add @TITLE 添加