From 93524fca2fbbcbb26b7376773d7e698abb53491e Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 8 Jan 2026 11:54:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(erp):=20=E6=B7=BB=E5=8A=A0=E9=93=B6?= =?UTF-8?q?=E8=A1=8C=E8=B4=A6=E6=88=B7=E4=BF=A1=E6=81=AF=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=E5=92=8C=E6=89=B9=E9=87=8F=E4=BF=AE=E6=94=B9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在报销单、付款单和申请单中添加银行账号和账号名称字段 - 为报销单、付款单和申请单实现批量修改银行账户信息功能 - 在ik3cloud常量中添加银行账户操作类型 - 新增字典查询相关结构体和过滤条件类型 - 更新金蝶同步相关服务以支持银行账户信息处理 --- erp/expense.go | 27 +++++++++++++++++++++++++++ erp/payment.go | 23 +++++++++++++++++++++++ erp/request.go | 27 +++++++++++++++++++++++++++ ik3cloud/constant/constant.go | 7 +++++++ ik3cloud/dict.go | 13 +++++++++++++ ik3cloud/payment.go | 1 + 6 files changed, 98 insertions(+) diff --git a/erp/expense.go b/erp/expense.go index 4aaa3c6..bbcabb2 100644 --- a/erp/expense.go +++ b/erp/expense.go @@ -23,6 +23,8 @@ type ExpenseSearch struct { CreatedAtEnd *time.Time // 创建结束时间 ExpenseIds []int64 // 报销单id BanFlag int64 // 禁用标记 1=禁用 2=启用 + BankAccount string // 银行账号 + BankName string // 账号名称 } type ReplyExpenseList struct { List []ExpenseItem `json:"list"` @@ -36,6 +38,8 @@ type ExpenseItem struct { CurrencySymbol string `json:"currencySymbol"` CurrencyRate decimal.Decimal `json:"currencyRate"` Remarks string `json:"remarks"` + BankAccount string `json:"bankAccount"` + BankName string `json:"bankName"` Amount decimal.Decimal `json:"amount"` WorkflowId int64 `json:"workflowId"` WorkflowStatus int64 `json:"workflowStatus"` @@ -71,6 +75,8 @@ type ExpenseAdd struct { CurrencyRate decimal.Decimal // 币种汇率 Remarks string // 备注 ExpenseStaffId int64 // 报销人 + BankAccount string // 银行账号 + BankName string // 账号名称 } // Add @TITLE 添加 @@ -92,6 +98,8 @@ type ReplyExpenseInfo struct { CurrencyRate decimal.Decimal `json:"currencyRate"` Amount decimal.Decimal `json:"amount"` Remarks string `json:"remarks"` + BankAccount string `json:"bankAccount"` + BankName string `json:"bankName"` WorkflowId int64 `json:"workflowId"` WorkflowStatus int64 `json:"workflowStatus"` WorkflowReason string `json:"workflowReason"` @@ -130,6 +138,25 @@ func (r *expense) Edit(ctx context.Context, args ArgsExpenseEdit) (err error) { return xClient.Call(ctx, "Edit", args, &reply) } +type ArgsExpenseChange struct { + ExpenseIds []int64 // 报销单id + ExpenseChangeItem +} +type ExpenseChangeItem struct { + BankAccount string // 银行账号 + BankName string // 账号名称 +} + +// BatchChange @TITLE 批量修改 +func (r *expense) BatchChange(ctx context.Context, args ArgsExpenseChange) (err error) { + xClient, err := client.GetClient(r) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "BatchChange", args, &reply) +} + // Ik3cloud @TITLE 同步 func (r *expense) Ik3cloud(ctx context.Context, expenseId int64) (err error) { xClient, err := client.GetClient(r) diff --git a/erp/payment.go b/erp/payment.go index dd991b5..640b552 100644 --- a/erp/payment.go +++ b/erp/payment.go @@ -21,6 +21,8 @@ type PaymentSearch struct { CreatedAtStart *time.Time CreatedAtEnd *time.Time PurchaseStaffIds []int64 // 采购人员 + BankAccount string // 银行账号 + BankName string // 账号名称 } type ReplyPaymentList struct { Total int64 `json:"total"` @@ -38,6 +40,8 @@ type PaymentItem struct { CurrencyName string `json:"currencyName"` CurrencySymbol string `json:"currencySymbol"` CurrencyRate decimal.Decimal `json:"currencyRate"` + BankAccount string `json:"bankAccount"` + BankName string `json:"bankName"` PurchaseStaffId int64 `json:"purchaseStaffId"` Ik3cloudStatus int64 `json:"ik3CloudStatus"` Ik3cloudErrMsg string `json:"ik3CloudErrMsg"` @@ -66,6 +70,25 @@ func (p *payment) Gen(ctx context.Context, payableId int64) (err error) { return xClient.Call(ctx, "Gen", payableId, &reply) } +type ArgsPaymentChange struct { + PaymentIds []int64 + PaymentChangeItem +} +type PaymentChangeItem struct { + BankAccount string // 银行账号 + BankName string // 账号名称 +} + +// BatchChange @TITLE 批量修改 +func (p *payment) BatchChange(ctx context.Context, args ArgsPaymentChange) (err error) { + xClient, err := client.GetClient(p) + if err != nil { + return + } + reply := 0 + return xClient.Call(ctx, "BatchChange", args, &reply) +} + // Ik3cloud @TITLE 金蝶同步 func (p *payment) Ik3cloud(ctx context.Context, paymentId int64) (err error) { xClient, err := client.GetClient(p) diff --git a/erp/request.go b/erp/request.go index 699c5c4..00746e3 100644 --- a/erp/request.go +++ b/erp/request.go @@ -23,6 +23,8 @@ type RequestSearch struct { CreatedAtEnd *time.Time // 创建结束时间 RequestIds []int64 // 申请单id BanFlag int64 // 禁用标记 1=禁用 2=启用 + BankAccount string // 银行账号 + BankName string // 账号名称 } type ReplyRequestList struct { List []RequestItem `json:"list"` @@ -40,6 +42,8 @@ type RequestItem struct { CurrencySymbol string `json:"currencySymbol"` CurrencyRate decimal.Decimal `json:"currencyRate"` Remarks string `json:"remarks"` + BankAccount string `json:"bankAccount"` + BankName string `json:"bankName"` Amount decimal.Decimal `json:"amount"` BanFlag int64 `json:"banFlag"` WorkflowId int64 `json:"workflowId"` @@ -78,6 +82,8 @@ type RequestAdd struct { CurrencyRate decimal.Decimal // 币种汇率 Remarks string // 备注 Amount decimal.Decimal // 金额 + BankAccount string // 银行账号 + BankName string // 账号名称 } // Add @TITLE 添加 @@ -103,6 +109,8 @@ type ReplyRequestInfo struct { CurrencyRate decimal.Decimal `json:"currencyRate"` Amount decimal.Decimal `json:"amount"` Remarks string `json:"remarks"` + BankAccount string `json:"bankAccount"` + BankName string `json:"bankName"` WorkflowId int64 `json:"workflowId"` WorkflowStatus int64 `json:"workflowStatus"` WorkflowReason string `json:"workflowReason"` @@ -140,6 +148,25 @@ func (r *request) Edit(ctx context.Context, args ArgsRequestEdit) (err error) { 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) diff --git a/ik3cloud/constant/constant.go b/ik3cloud/constant/constant.go index c8c8cd0..c12f281 100644 --- a/ik3cloud/constant/constant.go +++ b/ik3cloud/constant/constant.go @@ -21,6 +21,7 @@ const ( ActionPayment Action = "AP_PAYBILL" // 付款单 ActionInformation Action = "BOS_ASSISTANTDATA_DETAIL" // 辅助资料 ActionReceiptAction Action = "AR_RECEIVEBILL" // 收款单 + ActionBankAccount Action = "CN_BANKACNT" // 银行账户 ) var ActionIdField = map[Action]string{ @@ -99,3 +100,9 @@ type InformationType = string const ( InformationTypeInvoiceSerial InformationType = "FYP" // 采购付款单 ) + +type FilterCompare = string + +const ( + FilterCompareEqual FilterCompare = "67" +) diff --git a/ik3cloud/dict.go b/ik3cloud/dict.go index aea53a9..904520d 100644 --- a/ik3cloud/dict.go +++ b/ik3cloud/dict.go @@ -20,6 +20,19 @@ type DictItem struct { Field8 any `json:"field8"` } +type ArgsDictAll struct { + CompanyType constant.Action // 类型 + FilterItem []FilterItem // 筛选 +} +type FilterItem struct { + FieldName string `json:"FieldName"` + Compare constant.FilterCompare `json:"Compare"` + Value string `json:"Value"` + Left string `json:"Left"` + Right string `json:"Right"` + Logic string `json:"Logic"` +} + // All @TITLE 获取字典 func (d *dict) All(ctx context.Context, companyType constant.Action) (reply []DictItem, err error) { xClient, err := client.GetClient(d) diff --git a/ik3cloud/payment.go b/ik3cloud/payment.go index 90415b8..c021999 100644 --- a/ik3cloud/payment.go +++ b/ik3cloud/payment.go @@ -34,6 +34,7 @@ type PaymentCostItem struct { //SettlementMethod string // 结算方式 PaymentPurpose constant.PaymentPurpose // 付款用途 ExpenseItem string // 费用项目 + BankAccount string // 银行账号 } // Save @TITLE 保存付款单