Skip to content

Add CLI Command for Fetching OA Approval Detail and Related Enhancements #230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions cmd/workwxctl/commands/cmd_approval_detail_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package commands

import (
"fmt"

"github.com/urfave/cli/v2"
)

func cmdApprovalDetailGet(c *cli.Context) error {

Check failure on line 9 in cmd/workwxctl/commands/cmd_approval_detail_get.go

View workflow job for this annotation

GitHub Actions / build (stable)

undefined: cli (typecheck)

Check failure on line 9 in cmd/workwxctl/commands/cmd_approval_detail_get.go

View workflow job for this annotation

GitHub Actions / build (oldstable)

undefined: cli (typecheck)
cfg := mustGetConfig(c)
spNo := c.Args().Get(0)

app := cfg.MakeWorkwxApp()
info, err := app.GetOAApprovalDetail(spNo)

if err != nil {
fmt.Printf("error = %+v\n", err)
} else {
fmt.Printf("approval detail = %+v\n", info)
}

return err
}
5 changes: 5 additions & 0 deletions cmd/workwxctl/commands/decl.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ func InitApp() *cli.App {
},
},
},
{
Name: "approval-detail-get",
Usage: "获取审批详情",
Action: cmdApprovalDetailGet,
},
},
}
}
26 changes: 26 additions & 0 deletions docs/oa.md
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ Name|JSON|Type|Doc
`Notifier`|`notifyer`|`[]OAApprovalDetailNotifier`| 抄送信息,可能有多个抄送节点
`ApplyData`|`apply_data`|`OAContents`| 审批申请数据
`Comments`|`comments`|`[]OAApprovalDetailComment`| 审批申请备注信息,可能有多个备注节点
`ProcessList`|`process_list`|`OAApprovalDetailProcessList`| 流程信息列表(2024年新增)

### `OAApprovalDetailApplicant` 审批申请详情申请人信息

Expand Down Expand Up @@ -591,3 +592,28 @@ Name|JSON|Type|Doc
`LeftDuration`|`leftduration`|`uint32`| 剩余时长,单位为秒
`VacationName`|`vacationname`|`string`| 假期名称
`RealAssignDuration`|`real_assignduration`|`uint32`| 假期的实际发放时长,通常在设置了按照实际工作时间发放假期后进行计算

### `OAApprovalDetailProcessList` 流程信息列表

Name|JSON|Type|Doc
:---|:---|:---|:--
`NodeList`|`node_list`|`[]OAApprovalDetailProcessNode`| 节点列表

### `OAApprovalDetailProcessNode` 流程节点

Name|JSON|Type|Doc
:---|:---|:---|:--
`NodeType`|`node_type`|`int`| 节点类型
`SpStatus`|`sp_status`|`int`| 节点审批状态
`ApvRel`|`apv_rel`|`int`| 审批关系
`SubNodeList`|`sub_node_list`|`[]OAApprovalDetailProcessSubNode`| 子节点成员列表

### `OAApprovalDetailProcessSubNode` 流程节点成员

Name|JSON|Type|Doc
:---|:---|:---|:--
`UserID`|`userid`|`string`| 审批人userid
`Speech`|`speech`|`string`| 审批意见
`SpYj`|`sp_yj`|`int`| 审批意见类型
`SpTime`|`sptime`|`int`| 审批时间戳
`MediaIDs`|`media_ids`|`[]string`| 图片media_id
34 changes: 34 additions & 0 deletions oa.md.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading