From 6717454a79f739ee1b104eb26c51a0625455dcfd Mon Sep 17 00:00:00 2001 From: kanade Date: Tue, 6 Jan 2026 15:34:12 +0800 Subject: [PATCH] =?UTF-8?q?feat(erp):=20=E6=B7=BB=E5=8A=A0=E4=BB=98?= =?UTF-8?q?=E6=AC=BE=E6=A8=A1=E5=9D=97=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 实现付款单列表查询功能,支持分页和多条件搜索 - 添加付款单生成功能,根据应付单ID创建付款单 - 集成金蝶同步功能,支持付款单数据同步到金蝶系统 - 定义完整的付款单数据结构,包含金额、币种、采购人员等字段 - 实现付款单搜索功能,支持按付款单号、合同号、时间范围等条件查询 - 添加IK3Cloud状态管理,处理金蝶同步状态和错误信息 --- erp/payment.go | 77 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 erp/payment.go diff --git a/erp/payment.go b/erp/payment.go new file mode 100644 index 0000000..dd991b5 --- /dev/null +++ b/erp/payment.go @@ -0,0 +1,77 @@ +package erp + +import ( + "context" + "time" + + "git.kumo.work/shama/service/client" + "git.kumo.work/shama/service/lib/bean" + "github.com/shopspring/decimal" +) + +type payment struct { +} +type ArgsPaymentList struct { + Page bean.Page + Search PaymentSearch +} +type PaymentSearch struct { + PaymentSerial string // 付款单号 + AccountingSerial string // 做账合同号 + CreatedAtStart *time.Time + CreatedAtEnd *time.Time + PurchaseStaffIds []int64 // 采购人员 +} +type ReplyPaymentList struct { + Total int64 `json:"total"` + List []PaymentItem `json:"list"` +} +type PaymentItem struct { + Id int64 `json:"id"` + PaymentSerial string `json:"paymentSerial"` + AccountingSerial string `json:"accountingSerial"` + PayableSerial string `json:"payableSerial"` + InvoiceSerial string `json:"invoiceSerial"` + FactoryName string `json:"factoryName"` + Amount decimal.Decimal `json:"amount"` + Currency string `json:"currency"` + CurrencyName string `json:"currencyName"` + CurrencySymbol string `json:"currencySymbol"` + CurrencyRate decimal.Decimal `json:"currencyRate"` + PurchaseStaffId int64 `json:"purchaseStaffId"` + Ik3cloudStatus int64 `json:"ik3CloudStatus"` + Ik3cloudErrMsg string `json:"ik3CloudErrMsg"` + Ik3cloudUpdatedAt *time.Time `json:"ik3CloudUpdatedAt"` + CreatedAt *time.Time `json:"createdAt"` + UpdatedAt *time.Time `json:"updatedAt"` +} + +// List @TITLE 列表 +func (p *payment) List(ctx context.Context, args ArgsPaymentList) (reply ReplyPaymentList, err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + err = xClient.Call(ctx, "List", args, &reply) + return +} + +// Gen @TITLE 生成付款单 +func (p *payment) Gen(ctx context.Context, payableId int64) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Gen", payableId, &reply) +} + +// Ik3cloud @TITLE 金蝶同步 +func (p *payment) Ik3cloud(ctx context.Context, paymentId int64) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "Ik3cloud", paymentId, &reply) +}