From f95ae16d68dac84e9ac8d149bdb94d312f0f7dd4 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 29 Apr 2026 11:49:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(accounting):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=81=9A=E8=B4=A6=E5=90=88=E5=90=8C=E7=94=9F=E6=88=90=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=8F=82=E6=95=B0=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ArgsAccountingGen 结构体定义 - 将 shipmentId 参数改为 args 参数传递 - 添加 AccountingGenType 类型定义 - 定义销售和订舱两种做账单生成类型常量 --- erp/accounting.go | 9 +++++++-- erp/constant.go | 7 +++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/erp/accounting.go b/erp/accounting.go index 18f8e71..0157cfd 100644 --- a/erp/accounting.go +++ b/erp/accounting.go @@ -101,14 +101,19 @@ func (a *accounting) Add(ctx context.Context, args ArgsAccountingAdd) (accountId return } +type ArgsAccountingGen struct { + ShipmentId int64 // 订舱单id + AccountingGenType AccountingGenType // 生成类型 +} + // Gen @TITLE 生成做账合同 -func (a *accounting) Gen(ctx context.Context, shipmentId int64) (err error) { +func (a *accounting) Gen(ctx context.Context, args ArgsAccountingGen) (err error) { xClient, err := client.GetClient(a) if err != nil { return } reply := 0 - return xClient.Call(ctx, "Gen", shipmentId, &reply) + return xClient.Call(ctx, "Gen", args, &reply) } type ReplyAccountingInfo struct { diff --git a/erp/constant.go b/erp/constant.go index 4a52af6..dd9323e 100644 --- a/erp/constant.go +++ b/erp/constant.go @@ -149,3 +149,10 @@ const ( OrderSortAsc OrderSort = "asc" OrderSortDesc OrderSort = "desc" ) + +type AccountingGenType = int64 + +const ( + AccountingGenTypeSaleStaff AccountingGenType = 1 // 按销售生成做账单 + AccountingGenTypeShipmentStaff AccountingGenType = 2 // 按订舱生成做账单 +)