refactor(accounting): 重构审核功能的数据结构

- 将审核人员数组替换为审核项目结构体
- 新增 AuditItem 结构体定义审批人ID和审批角色ID
- 更新 ArgsAuditSubmit 结构体字段命名和类型
- 添加 bean 包用于存放业务实体结构体
- 移除原有的审核人员ID数组字段
- 统一审核相关数据类型的定义方式
This commit is contained in:
2026-06-08 17:32:32 +08:00
parent 68184b3e5e
commit 46513b95ae
11 changed files with 55 additions and 32 deletions

View File

@@ -2,15 +2,17 @@ package accounting
import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
AccountingId int64 // 做账合同id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
AccountingId int64 // 做账合同id
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核

6
erp/bean/workflow.go Normal file
View File

@@ -0,0 +1,6 @@
package bean
type AuditItem struct {
AuditStaffId int64 // 审批人id
AuditRoleId int64 // 审批角色id
}

View File

@@ -4,14 +4,15 @@ import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
ExpenseId int64 // 报销单id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
ExpenseId int64 // 报销单id
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核

View File

@@ -4,14 +4,15 @@ import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
PaymentId int64 // 付款单
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
PaymentId int64 // 付款单
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核

View File

@@ -2,15 +2,17 @@ package purchase
import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
PurchaseId int64 // 采购合同id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
PurchaseId int64 // 采购合同id
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核

View File

@@ -4,14 +4,15 @@ import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
RequestId int64 // 申请单id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
RequestId int64 // 申请单id
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核

View File

@@ -2,15 +2,17 @@ package sale
import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
SaleId int64 // 销售合同id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
SaleId int64 // 销售合同id
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核
@@ -46,10 +48,10 @@ func (a *audit) Append(ctx context.Context, args ArgsAuditSubmit) (workflowId in
}
type ArgsAuditChange struct {
StaffId int64 // 操作人
SaleId int64 // 销售合同id
AuditStaffIds []int64 // 审核
Products []ChangeProductItem // 产品信息
StaffId int64 // 操作人
SaleId int64 // 销售合同id
AuditItems []bean.AuditItem // 审核
Products []ChangeProductItem // 产品信息
}
type ChangeProductItem struct {
Id int64 // 产品id
@@ -67,9 +69,9 @@ func (a *audit) Change(ctx context.Context, args ArgsAuditChange) (workflowId in
}
type ArgsAuditBenefit struct {
StaffId int64 // 操作人
SaleId int64 // 销售合同id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
SaleId int64 // 销售合同id
AuditItems []bean.AuditItem // 审核
ArgsBenefitEdit
}

View File

@@ -2,15 +2,17 @@ package modify
import (
"context"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/erp/bean"
)
type audit struct {
}
type ArgsAuditSubmit struct {
StaffId int64 // 操作人
ModifyId int64 // 订舱修改单id
AuditStaffIds []int64 // 审核
StaffId int64 // 操作人
ModifyId int64 // 订舱修改单id
AuditItems []bean.AuditItem // 审核
}
// Submit @TITLE 提交审核

View File

@@ -2,10 +2,11 @@ package erp
import (
"context"
"time"
"git.kumo.work/shama/service/client"
workflow2 "git.kumo.work/shama/service/erp/workflow"
"git.kumo.work/shama/service/lib/bean"
"time"
)
type workflow struct {
@@ -22,6 +23,7 @@ type WorkflowSearch struct {
BusinessTypes []string
Status AuditStatus
AuditStaffIds []int64 // 审核人
RoleIds []int64
}
type ReplyWorkflowList struct {
List []WorkflowItem
@@ -69,10 +71,10 @@ type WorkflowNodeItem struct {
Id int64 `json:"id"` // 审批流节点id
Status AuditStatus `json:"status"` // 审批流节点状态
ReviewStaffId int64 `json:"reviewStaffId"` // 审批流节点审核人
ReviewRoleId int64 `json:"reviewRoleId"` // 审批流节点角色id
ReviewAt *time.Time `json:"reviewAt"` // 审批流节点审核时间
ReviewComments string `json:"reviewComments"` // 审批流节点审核意见
Index int64 `json:"index"` // 审批流节点顺序
}
type ArgsWorkflowInfo struct {
WorkflowId int64 // 审批流id

View File

@@ -2,9 +2,10 @@ package workflow
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/lib/bean"
"time"
)
type node struct {
@@ -48,6 +49,7 @@ type NodeItem struct {
Id int64 `json:"id"`
WorkflowId int64 `json:"workflowId"`
ReviewStaffId int64 `json:"reviewStaffId"`
ReviewRoleId int64 `json:"reviewRoleId"`
BusinessId int64 `json:"businessId"`
BusinessName string `json:"businessName"`
BusinessType string `json:"businessType"`

View File

@@ -2,9 +2,10 @@ package oa
import (
"context"
"time"
"git.kumo.work/shama/service/client"
"git.kumo.work/shama/service/lib/bean"
"time"
)
type role struct {
@@ -97,6 +98,7 @@ func (r *role) SetStaff(ctx context.Context, args ArgsRoleSetStaff) (err error)
type ArgsRoleStaffs struct {
Name string // 角色名称
Id int64 // 角色id
}
// Staffs @TITLE 角色员工