From c7ddb2b86e248966ef24e85cc409824dc087945a Mon Sep 17 00:00:00 2001 From: kanade Date: Thu, 5 Sep 2024 17:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp/constant.go | 1 + erp/purchase/annotations.go | 4 ++-- erp/purchase/clause.go | 2 +- erp/sale.go | 8 +++++--- erp/workflow.go | 30 ++++++++++++++++++++++++++++++ oa/staff.go | 11 ++++++----- 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/erp/constant.go b/erp/constant.go index 48754c1..24369b0 100644 --- a/erp/constant.go +++ b/erp/constant.go @@ -17,6 +17,7 @@ const ( AuditStatusIng AuditStatus = 2 // 审核中 AuditStatusAdopt AuditStatus = 3 // 审核通过 AuditStatusReject AuditStatus = 4 // 审核驳回 + AuditStatusCancel AuditStatus = 5 // 审核撤回 ) type IsOpen = int64 // 开启状态 diff --git a/erp/purchase/annotations.go b/erp/purchase/annotations.go index bcc49bd..2c8af70 100644 --- a/erp/purchase/annotations.go +++ b/erp/purchase/annotations.go @@ -28,8 +28,8 @@ func (a *annotations) All(ctx context.Context, purchaseId int64) (reply []Annota } type ArgsAnnotationsAdd struct { - PurchaseId int64 // 采购合同ID - AnnotationsAdd + PurchaseId int64 // 采购合同ID + AnnotationsAdds []AnnotationsAdd } type AnnotationsAdd struct { diff --git a/erp/purchase/clause.go b/erp/purchase/clause.go index 455c856..57cf714 100644 --- a/erp/purchase/clause.go +++ b/erp/purchase/clause.go @@ -30,7 +30,7 @@ func (c *clause) All(ctx context.Context, purchaseId int64) (reply []ClauseItem, type ArgsClauseAdd struct { PurchaseId int64 // 采购合同ID - ClauseAdd + ClauseAdds []ClauseAdd } type ClauseAdd struct { diff --git a/erp/sale.go b/erp/sale.go index cea6cbd..de09c43 100644 --- a/erp/sale.go +++ b/erp/sale.go @@ -41,7 +41,7 @@ type SaleItem struct { CustomConsigneeName string `json:"customConsigneeName"` CustomConsigneeAddress string `json:"customConsigneeAddress"` EstShipDate time.Time `json:"estShipDate"` - EstShipDateEnd time.Time `json:"estShipDateEnd"` + EstShipDateEnd *time.Time `json:"estShipDateEnd"` EstRecDate *time.Time `json:"estRecDate"` RecBank string `json:"recBank"` RecBankEng string `json:"recBankEng"` @@ -79,6 +79,7 @@ type SaleItem struct { Remarks string `json:"remarks"` WorkflowId int64 `json:"workflowId"` WorkflowStatus int64 `json:"workflowStatus"` + HasPurchase int64 `json:"hasPurchase"` CreatedStaffId int64 `json:"createdStaffId"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` @@ -111,7 +112,7 @@ type SaleAdd struct { CustomConsigneeName string // 客户收货人 CustomConsigneeAddress string // 客户收货人地址 EstShipDate time.Time // 预计出运日期 - EstShipDateEnd time.Time // 预计出运日期结束 + EstShipDateEnd *time.Time // 预计出运日期结束 EstRecDate *time.Time // 预计收汇日期 RecBank string // 收汇银行 RecBankEng string // 收汇银行英文 @@ -173,7 +174,7 @@ type ReplySaleInfo struct { CustomConsigneeName string `json:"customConsigneeName"` CustomConsigneeAddress string `json:"customConsigneeAddress"` EstShipDate time.Time `json:"estShipDate"` - EstShipDateEnd time.Time `json:"estShipDateEnd"` + EstShipDateEnd *time.Time `json:"estShipDateEnd"` EstRecDate *time.Time `json:"estRecDate"` RecBank string `json:"recBank"` RecBankEng string `json:"recBankEng"` @@ -214,6 +215,7 @@ type ReplySaleInfo struct { WorkflowId int64 `json:"workflowId"` WorkflowStatus int64 `json:"workflowStatus"` WorkflowReason string `json:"workflowReason"` + HasPurchase int64 `json:"hasPurchase"` CreatedStaffId int64 `json:"createdStaffId"` CreatedAt *time.Time `json:"createdAt"` UpdatedAt *time.Time `json:"updatedAt"` diff --git a/erp/workflow.go b/erp/workflow.go index 1d3f5fd..b5b4edc 100644 --- a/erp/workflow.go +++ b/erp/workflow.go @@ -118,3 +118,33 @@ func (w *workflow) Reject(ctx context.Context, args ArgsWorkflowReject) (err err err = xClient.Call(ctx, "Reject", args, &reply) return } + +type ReplyReviewNode struct { + ReviewStaffId int64 `json:"reviewStaffId"` +} + +// ReviewNode @TITLE 获取审批节点 +func (w *workflow) ReviewNode(ctx context.Context, workflowId int64) (reply ReplyReviewNode, err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + err = xClient.Call(ctx, "ReviewNode", workflowId, &reply) + return +} + +type ArgsWorkflowCancel struct { + StaffId int64 // 审核人 + WorkflowId int64 // 工作流 +} + +// Cancel @TITLE 审核撤回 +func (w *workflow) Cancel(ctx context.Context, args ArgsWorkflowCancel) (err error) { + xClient, err := client.GetClient(w) + if err != nil { + return + } + reply := 0 + err = xClient.Call(ctx, "Cancel", args, &reply) + return +} diff --git a/oa/staff.go b/oa/staff.go index 3a57986..245dcd8 100644 --- a/oa/staff.go +++ b/oa/staff.go @@ -75,11 +75,12 @@ type ArgsStaffList struct { Search StaffSearch } type StaffSearch struct { - Status int64 // 状态 1=启用 2=停用 - Keyword string // 关键字 - Phone string // 手机号 - DepartmentIds []int64 // 部门筛选 - RoleIds []int64 // 角色筛选 + Status int64 // 状态 1=启用 2=停用 + Keyword string // 关键字 + Phone string // 手机号 + DepartmentIds []int64 // 部门筛选 + DepartmentStaffIds []int64 // 部门员工id + RoleIds []int64 // 角色筛选 } type ReplyStaffList struct { List []StaffItem `json:"list"` // 员工列表