From 1fdbc29a5cdf91b7cf711beb06c22db47dc83a72 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 21 Jan 2026 11:17:56 +0800 Subject: [PATCH] =?UTF-8?q?feat(erp):=20=E6=B7=BB=E5=8A=A0=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E5=8D=95=E5=AE=A1=E6=A0=B8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 BusinessTypePayment 类型用于付款单审核 - 添加 payment 包结构体定义 - 扩展 PaymentSearch 结构体支持 PaymentIds 查询字段 - 在 Payment 结构体中增加 prepaidAmount 和 paidAmount 字段 - 新增 receipt 和 request 查询参数中的发票号字段 - 添加付款单审核提交接口实现 --- erp/constant.go | 2 ++ erp/payment.go | 9 +++++++-- erp/payment/audit.go | 26 ++++++++++++++++++++++++++ erp/payment/payment.go | 5 +++++ erp/receipt.go | 1 + erp/request.go | 1 + 6 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 erp/payment/audit.go create mode 100644 erp/payment/payment.go diff --git a/erp/constant.go b/erp/constant.go index d1dd977..cae43fd 100644 --- a/erp/constant.go +++ b/erp/constant.go @@ -14,6 +14,7 @@ const ( BusinessTypeAccountingAuditV2 BusinessType = "accountingAuditV2" // 做账合同审核 BusinessTypeExpense BusinessType = "expenseAudit" // 报销单 BusinessTypeRequest BusinessType = "requestAudit" // 申请单 + BusinessTypePayment BusinessType = "paymentAudit" // 申请单 ) var BusinessTypeName = map[BusinessType]string{ @@ -28,6 +29,7 @@ var BusinessTypeName = map[BusinessType]string{ BusinessTypeAccountingAuditV2: "做账合同审核", BusinessTypeExpense: "报销单审核", BusinessTypeRequest: "申请单审核", + BusinessTypePayment: "付款单审核", } type AuditStatus = int64 // 审核状态 diff --git a/erp/payment.go b/erp/payment.go index 640b552..2741e29 100644 --- a/erp/payment.go +++ b/erp/payment.go @@ -5,19 +5,22 @@ import ( "time" "git.kumo.work/shama/service/client" + payment2 "git.kumo.work/shama/service/erp/payment" "git.kumo.work/shama/service/lib/bean" "github.com/shopspring/decimal" ) type payment struct { + payment2.Payment } type ArgsPaymentList struct { Page bean.Page Search PaymentSearch } type PaymentSearch struct { - PaymentSerial string // 付款单号 - AccountingSerial string // 做账合同号 + PaymentIds []int64 // 付款单id + PaymentSerial string // 付款单号 + AccountingSerial string // 做账合同号 CreatedAtStart *time.Time CreatedAtEnd *time.Time PurchaseStaffIds []int64 // 采购人员 @@ -35,7 +38,9 @@ type PaymentItem struct { PayableSerial string `json:"payableSerial"` InvoiceSerial string `json:"invoiceSerial"` FactoryName string `json:"factoryName"` + PrepaidAmount decimal.Decimal `json:"prepaidAmount"` Amount decimal.Decimal `json:"amount"` + PaidAmount decimal.Decimal `json:"paidAmount"` Currency string `json:"currency"` CurrencyName string `json:"currencyName"` CurrencySymbol string `json:"currencySymbol"` diff --git a/erp/payment/audit.go b/erp/payment/audit.go new file mode 100644 index 0000000..92b9bc6 --- /dev/null +++ b/erp/payment/audit.go @@ -0,0 +1,26 @@ +package payment + +import ( + "context" + + "git.kumo.work/shama/service/client" +) + +type audit struct { +} +type ArgsAuditSubmit struct { + StaffId int64 // 操作人 + PaymentId int64 // 付款单 + AuditStaffIds []int64 // 审核人 +} + +// Submit @TITLE 提交审核 +func (a *audit) Submit(ctx context.Context, args ArgsAuditSubmit) (err error) { + xClient, err := client.GetClient(a) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Submit", args, &reply) + return +} diff --git a/erp/payment/payment.go b/erp/payment/payment.go new file mode 100644 index 0000000..7d086fc --- /dev/null +++ b/erp/payment/payment.go @@ -0,0 +1,5 @@ +package payment + +type Payment struct { + Audit audit +} diff --git a/erp/receipt.go b/erp/receipt.go index 965aa6c..b25cae6 100644 --- a/erp/receipt.go +++ b/erp/receipt.go @@ -28,6 +28,7 @@ type ReceiptSearch struct { ReceiptDateEnd *time.Time // 创建结束时间 BanFlag int64 // 禁用标记 1=禁用 2=启用 ClaimStatus int64 // 认领状态 1=待认领 2=部分认领 3=已认领 + InvoiceSerialEq string // 发票号 } type ReplyReceiptList struct { List []ReceiptItem `json:"list"` diff --git a/erp/request.go b/erp/request.go index 00746e3..4cf0f23 100644 --- a/erp/request.go +++ b/erp/request.go @@ -19,6 +19,7 @@ type ArgsRequestList struct { } type RequestSearch struct { RequestSerial string // 报销单号 + InvoiceSerial string // 发票号 CreatedAtStart *time.Time // 创建开始时间 CreatedAtEnd *time.Time // 创建结束时间 RequestIds []int64 // 申请单id