From 4b24a9353a4ff8d322ebd6d36183e8791b369fc1 Mon Sep 17 00:00:00 2001 From: kanade Date: Wed, 12 Aug 2026 14:56:42 +0800 Subject: [PATCH] =?UTF-8?q?feat(erp):=20=E6=B7=BB=E5=8A=A0=E8=B4=B9?= =?UTF-8?q?=E7=94=A8=E6=8A=A5=E9=94=80=E7=B1=BB=E5=9E=8B=E5=92=8C=E5=B7=AE?= =?UTF-8?q?=E6=97=85=E8=B4=B9=E7=9B=B8=E5=85=B3=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 ExpenseType 类型定义和普通费用、差旅费常量 - 在 ExpenseAdd 结构体中添加报销类型字段 - 添加出差员工、出差时间、地点、事由等差旅费相关字段 - 在 ReplyExpenseInfo 结构体中添加对应的类型和差旅信息字段 - 更新响应结构以支持差旅费明细数据返回 --- erp/constant.go | 7 +++++++ erp/expense.go | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/erp/constant.go b/erp/constant.go index 6a5adf8..581ca00 100644 --- a/erp/constant.go +++ b/erp/constant.go @@ -163,3 +163,10 @@ const ( AccountingGenTypeSaleStaff AccountingGenType = 1 // 按销售生成做账单 AccountingGenTypeShipmentStaff AccountingGenType = 2 // 按订舱生成做账单 ) + +type ExpenseType = int64 + +const ( + ExpenseTypeNormal PaymentType = 1 // 普通费用 + ExpenseTypeTrave PaymentType = 2 // 差旅费 +) diff --git a/erp/expense.go b/erp/expense.go index bf058d3..8bf137a 100644 --- a/erp/expense.go +++ b/erp/expense.go @@ -86,6 +86,7 @@ type ArgsExpenseAdd struct { ExpenseAdd } type ExpenseAdd struct { + Type ExpenseType // 报销类型 1=普通报销费用 2=差旅费 Currency string // 币种 CurrencyName string // 币种名称 CurrencySymbol string // 币种符号 @@ -94,6 +95,12 @@ type ExpenseAdd struct { ExpenseStaffId int64 // 报销人 BankAccount string // 银行账号 BankName string // 账号名称 + TravelStaffIds []int64 // 出差员工 + TraveStartAt *time.Time // 出差开始日期 + TravelEndAt *time.Time // 出差结束日期 + TravelLocation string // 地点 + TravelReason string // 出差事由 + TravelInfo string // 差旅费明细 } // Add @TITLE 添加 @@ -109,6 +116,7 @@ func (r *expense) Add(ctx context.Context, args ArgsExpenseAdd) (expenseId int64 type ReplyExpenseInfo struct { Id int64 `json:"id"` ExpenseSerial string `json:"expenseSerial"` + Type int64 `json:"type"` Currency string `json:"currency"` CurrencyName string `json:"currencyName"` CurrencySymbol string `json:"currencySymbol"` @@ -117,6 +125,12 @@ type ReplyExpenseInfo struct { Remarks string `json:"remarks"` BankAccount string `json:"bankAccount"` BankName string `json:"bankName"` + TravelStaffIds []int64 `json:"travelStaffIds"` + TraveStartAt *time.Time `json:"traveStartAt"` + TravelEndAt *time.Time `json:"travelEndAt"` + TravelLocation string `json:"travelLocation"` + TravelReason string `json:"travelReason"` + TravelInfo string `json:"travelInfo"` WorkflowId int64 `json:"workflowId"` WorkflowStatus int64 `json:"workflowStatus"` WorkflowReason string `json:"workflowReason"`