ziniao-department
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese部门管理
Department Management
CRITICAL — 开始前 MUST 先用 Read 工具读取 ,其中包含认证、错误处理和安全规则
CRITICAL — 所有 Shortcuts 在执行之前,务必先用 Read 工具读取其对应的 references/ 说明文档,禁止直接盲目调用命令。
../ziniao-shared/SKILL.mdCRITICAL — MUST use the Read tool to read before starting, which contains authentication, error handling, and security rules
CRITICAL — Before executing any Shortcuts, be sure to use the Read tool to read their corresponding references/ documentation. Blindly calling commands directly is prohibited.
../ziniao-shared/SKILL.md核心场景
Core Scenarios
查看组织架构
View Organizational Structure
用户想了解公司部门结构时,使用 展示层级关系:
--treebash
ziniao-cli department list --tree输出树形结构:
├── 技术部 (id: 15868464646076)
│ ├── 前端组 (id: 15954943062431)
│ └── 后端组 (id: 15954943062432)
└── 市场部 (id: 15868464646077)When users want to understand the company's department structure, use to display the hierarchical relationship:
--treebash
ziniao-cli department list --treeOutput tree structure:
├── 技术部 (id: 15868464646076)
│ ├── 前端组 (id: 15954943062431)
│ └── 后端组 (id: 15954943062432)
└── 市场部 (id: 15868464646077)创建部门
Create Department
hierarchybash
undefinedhierarchybash
undefined在已有部门下创建子部门(parentId 必须为已存在的部门 ID,不支持传 0)
Create a sub-department under an existing department (parentId must be an existing department ID, passing 0 is not supported)
ziniao-cli department create --name "华东区" --parent-id 15868464646076
> ⚠ `--parent-id` 不能传 0,必须传已存在的父部门 ID。如需查询可用的父部门 ID,先执行 `department list --tree`。ziniao-cli department create --name "华东区" --parent-id 15868464646076
> ⚠ `--parent-id` cannot be set to 0; it must be an existing parent department ID. To query available parent department IDs, execute `department list --tree` first.危险操作
Dangerous Operations
删除部门是 ,会要求确认。删除父部门会级联删除所有子部门,且不可恢复。 删除前建议先检查是否有子部门或员工:
high-risk-writebash
ziniao-cli department list --tree # 检查子部门
ziniao-cli staff list --department-id xxx # 检查是否有员工
ziniao-cli department delete --id xxx # 执行删除(需确认)Deleting a department is a operation and requires confirmation. Deleting a parent department will cascade delete all sub-departments, and this operation is irreversible. It is recommended to check for sub-departments or employees before deletion:
high-risk-writebash
ziniao-cli department list --tree # Check sub-departments
ziniao-cli staff list --department-id xxx # Check for employees
ziniao-cli department delete --id xxx # Execute deletion (confirmation required)Shortcuts
Shortcuts
| 命令 | 说明 | 详细文档 |
|---|---|---|
| 查询部门列表 | |
| 新增部门 | |
| 修改部门 | 只发修改字段: |
| 删除部门(子部门及员工归属将被清除) | |
| 调整排序 | |
| Command | Description | Detailed Documentation |
|---|---|---|
| Query department list | |
| Add new department | |
| Modify department | Only send modified fields: |
| Delete department (sub-departments and employee affiliations will be cleared) | |
| Adjust sorting | |
通用 api 覆盖
Universal API Coverage
所有部门接口也可通过通用 api 命令调用:
bash
ziniao-cli api /superbrowser/rest/v1/erp/department/list
ziniao-cli api /superbrowser/rest/v1/erp/department/add --data '{"name":"xxx","parentId":"<父部门ID>","hierarchy":"0"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/update --data '{"id":"xxx","name":"新名"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/delete --data '{"id":"xxx"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/order --data '{"parentId":"xxx","order":["id1","id2"]}'All department interfaces can also be called via the universal api command:
bash
ziniao-cli api /superbrowser/rest/v1/erp/department/list
ziniao-cli api /superbrowser/rest/v1/erp/department/add --data '{"name":"xxx","parentId":"<父部门ID>","hierarchy":"0"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/update --data '{"id":"xxx","name":"新名"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/delete --data '{"id":"xxx"}'
ziniao-cli api /superbrowser/rest/v1/erp/department/order --data '{"parentId":"xxx","order":["id1","id2"]}'