@peninsula-med/beisen-ehr-plugin 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +79 -141
- package/dist/index.cjs.js +3704 -66
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +5 -11
- package/dist/index.esm.js +3703 -64
- package/dist/index.esm.js.map +1 -1
- package/openclaw.plugin.json +38 -43
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,201 +1,139 @@
|
|
|
1
|
-
# 北森 EHR OpenClaw
|
|
1
|
+
# 北森 EHR OpenClaw 插件 🐉
|
|
2
2
|
|
|
3
|
-
北森 EHR
|
|
3
|
+
北森 EHR 系统集成插件,支持加班申请、考勤查询、假期余额等功能。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
> **版本:** 1.0.1
|
|
5
|
+
## 快速开始
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
## 快速安装
|
|
11
|
-
|
|
12
|
-
### 1️⃣ 安装插件
|
|
7
|
+
### 方式一:使用配置向导(推荐)
|
|
13
8
|
|
|
14
9
|
```bash
|
|
10
|
+
# 1. 安装插件
|
|
15
11
|
openclaw plugins install @peninsula-med/beisen-ehr-plugin
|
|
16
|
-
```
|
|
17
12
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
使用独立的配置工具,无需查找路径:
|
|
21
|
-
|
|
22
|
-
```bash
|
|
13
|
+
# 2. 运行配置向导(交互式输入凭证)
|
|
23
14
|
npx @peninsula-med/beisen-ehr-configure
|
|
15
|
+
|
|
16
|
+
# 3. 重启 Gateway
|
|
17
|
+
openclaw gateway restart
|
|
24
18
|
```
|
|
25
19
|
|
|
26
|
-
|
|
20
|
+
### 方式二:一键安装 + 配置(适合脚本化)
|
|
27
21
|
|
|
28
22
|
```bash
|
|
29
|
-
|
|
23
|
+
openclaw plugins install @peninsula-med/beisen-ehr-plugin && \
|
|
24
|
+
npx @peninsula-med/beisen-ehr-configure && \
|
|
25
|
+
openclaw gateway restart
|
|
30
26
|
```
|
|
31
27
|
|
|
32
|
-
|
|
28
|
+
### 方式三:手动配置
|
|
33
29
|
|
|
34
|
-
|
|
30
|
+
```bash
|
|
31
|
+
# 1. 安装插件
|
|
32
|
+
openclaw plugins install @peninsula-med/beisen-ehr-plugin
|
|
35
33
|
|
|
36
|
-
|
|
34
|
+
# 2. 编辑配置文件(~/.openclaw/config.json)
|
|
35
|
+
```
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
在配置文件中添加:
|
|
38
|
+
|
|
39
|
+
```json5
|
|
39
40
|
{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
plugins: {
|
|
42
|
+
entries: {
|
|
43
|
+
"beisen-ehr-plugin": {
|
|
44
|
+
enabled: true,
|
|
45
|
+
config: {
|
|
46
|
+
apiUrl: "https://openapi.italent.cn", // 可选,默认就是这个
|
|
47
|
+
appKey: "your-app-key",
|
|
48
|
+
appSecret: "your-app-secret",
|
|
49
|
+
staffId: "your-staff-id",
|
|
50
|
+
tenantId: "your-tenant-id",
|
|
51
|
+
email: "your-email@company.com"
|
|
52
|
+
}
|
|
50
53
|
}
|
|
51
54
|
}
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
```
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
然后重启:
|
|
57
60
|
|
|
58
61
|
```bash
|
|
59
|
-
openclaw restart
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### 4️⃣ 测试
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
帮我提交一个加班申请
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## 功能
|
|
71
|
-
|
|
72
|
-
### Tools (工具)
|
|
73
|
-
|
|
74
|
-
| 工具 | 说明 |
|
|
75
|
-
|------|------|
|
|
76
|
-
| `submit_overtime` | 提交加班申请 |
|
|
77
|
-
| `query_attendance` | 查询考勤记录 |
|
|
78
|
-
| `get_approval_status` | 查询审批状态 |
|
|
79
|
-
| `get_leave_balance` | 查询假期余额 |
|
|
80
|
-
|
|
81
|
-
### Resources (资源)
|
|
82
|
-
|
|
83
|
-
- `ehr://employee/{id}/profile` - 员工信息
|
|
84
|
-
- `ehr://attendance/{id}/records` - 考勤记录
|
|
85
|
-
- `ehr://overtime/{id}/list` - 加班记录
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## 使用示例
|
|
90
|
-
|
|
91
|
-
### 提交加班申请
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
帮我提交一个加班申请,这周日全天
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 查询假期余额
|
|
98
|
-
|
|
99
|
-
```
|
|
100
|
-
我还有多少调休假?
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### 查询考勤
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
查一下本周的考勤记录
|
|
62
|
+
openclaw gateway restart
|
|
107
63
|
```
|
|
108
64
|
|
|
109
|
-
---
|
|
110
|
-
|
|
111
65
|
## 配置说明
|
|
112
66
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
|
116
|
-
|
|
117
|
-
| `
|
|
118
|
-
| `
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
121
|
-
| `email` | 企业邮箱 | 公司邮箱 |
|
|
67
|
+
| 字段 | 说明 | 必填 |
|
|
68
|
+
|------|------|------|
|
|
69
|
+
| `apiUrl` | 北森 API 地址 | 否(默认 `https://openapi.italent.cn`) |
|
|
70
|
+
| `appKey` | App Key(从北森管理员获取) | 是 |
|
|
71
|
+
| `appSecret` | App Secret(从北森管理员获取) | 是 |
|
|
72
|
+
| `staffId` | 员工 ID | 是 |
|
|
73
|
+
| `tenantId` | 企业租户 ID | 是 |
|
|
74
|
+
| `email` | 企业邮箱 | 是 |
|
|
122
75
|
|
|
123
|
-
|
|
76
|
+
## 可用工具
|
|
124
77
|
|
|
125
|
-
|
|
126
|
-
|------|------|-------|
|
|
127
|
-
| `apiUrl` | 北森 API 地址 | `https://openapi.italent.cn` |
|
|
78
|
+
插件提供以下工具供 AI 调用:
|
|
128
79
|
|
|
129
|
-
|
|
80
|
+
1. **beisen_submit_overtime** - 提交加班申请
|
|
81
|
+
2. **beisen_get_leave_balance** - 查询假期余额
|
|
82
|
+
3. **beisen_query_attendance** - 查询考勤记录
|
|
83
|
+
4. **beisen_get_approval_status** - 查询审批状态
|
|
130
84
|
|
|
131
85
|
## 配置向导
|
|
132
86
|
|
|
133
|
-
|
|
87
|
+
独立的配置工具,支持交互式输入凭证:
|
|
134
88
|
|
|
135
89
|
```bash
|
|
136
90
|
npx @peninsula-med/beisen-ehr-configure
|
|
137
91
|
```
|
|
138
92
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
5. ✅ 显示配置摘要
|
|
145
|
-
6. ✅ 提供下一步指引
|
|
93
|
+
功能:
|
|
94
|
+
- 🎯 交互式引导配置
|
|
95
|
+
- 🔐 安全保存凭证到 OpenClaw 配置文件
|
|
96
|
+
- ✅ 自动验证配置
|
|
97
|
+
- 💾 自动备份旧配置
|
|
146
98
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
## 故障排查
|
|
99
|
+
## 开发
|
|
150
100
|
|
|
151
|
-
###
|
|
101
|
+
### 本地开发
|
|
152
102
|
|
|
153
103
|
```bash
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
### 配置错误
|
|
104
|
+
# 安装依赖
|
|
105
|
+
pnpm install
|
|
159
106
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
npx @peninsula-med/beisen-ehr-configure
|
|
163
|
-
```
|
|
107
|
+
# 开发模式(监听变化自动构建)
|
|
108
|
+
pnpm dev
|
|
164
109
|
|
|
165
|
-
|
|
110
|
+
# 生产构建
|
|
111
|
+
pnpm build
|
|
166
112
|
|
|
167
|
-
|
|
168
|
-
|
|
113
|
+
# 发布到 npm
|
|
114
|
+
pnpm publish:release
|
|
169
115
|
```
|
|
170
116
|
|
|
171
|
-
###
|
|
117
|
+
### 本地测试
|
|
118
|
+
|
|
119
|
+
使用 `--link` 安装本地插件:
|
|
172
120
|
|
|
173
121
|
```bash
|
|
174
|
-
openclaw plugins
|
|
122
|
+
openclaw plugins install -l /path/to/beisen-ehr-plugin
|
|
175
123
|
```
|
|
176
124
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
## 更新日志
|
|
125
|
+
## 注意事项
|
|
180
126
|
|
|
181
|
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
### v1.0.0 (2026-03-11)
|
|
186
|
-
- ✅ 初始版本
|
|
187
|
-
- ✅ 提交加班申请
|
|
188
|
-
- ✅ 查询考勤记录
|
|
189
|
-
- ✅ 查询审批状态
|
|
190
|
-
- ✅ 查询假期余额
|
|
191
|
-
|
|
192
|
-
---
|
|
127
|
+
- 凭证信息需要联系北森管理员获取
|
|
128
|
+
- Token 会自动管理,有效期 2 小时,自动刷新
|
|
129
|
+
- 所有 API 请求都会记录到 Gateway 日志中
|
|
193
130
|
|
|
194
|
-
##
|
|
131
|
+
## 技术支持
|
|
195
132
|
|
|
196
|
-
|
|
133
|
+
遇到问题?联系龙二 🐉
|
|
197
134
|
|
|
198
135
|
---
|
|
199
136
|
|
|
200
|
-
|
|
201
|
-
|
|
137
|
+
**版本**: 1.1.0
|
|
138
|
+
**作者**: 龙二 🐉
|
|
139
|
+
**License**: MIT
|