42 lines
834 B
Go
42 lines
834 B
Go
|
package erp
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"git.kumo.work/shama/service/client"
|
||
|
)
|
||
|
|
||
|
type workflow struct {
|
||
|
}
|
||
|
type ArgsWorkflowAdopt struct {
|
||
|
StaffId int64 // 审核人
|
||
|
WorkflowId int64 // 工作流
|
||
|
}
|
||
|
|
||
|
// Adopt @TITLE 审核通过
|
||
|
func (w *workflow) Adopt(ctx context.Context, args ArgsWorkflowAdopt) (err error) {
|
||
|
xClient, err := client.GetClient(w)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
reply := 0
|
||
|
err = xClient.Call(ctx, "Adopt", args, &reply)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
type ArgsWorkflowReject struct {
|
||
|
StaffId int64 // 审核人
|
||
|
WorkflowId int64 // 工作流
|
||
|
Reason string // 审核结果
|
||
|
}
|
||
|
|
||
|
// Reject @TITLE 审核驳回
|
||
|
func (w *workflow) Reject(ctx context.Context, args ArgsWorkflowReject) (err error) {
|
||
|
xClient, err := client.GetClient(w)
|
||
|
if err != nil {
|
||
|
return
|
||
|
}
|
||
|
reply := 0
|
||
|
err = xClient.Call(ctx, "Reject", args, &reply)
|
||
|
return
|
||
|
}
|