修复企微的问题
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m15s

This commit is contained in:
2026-07-27 17:04:32 +08:00
parent cbf909b878
commit 072ec1db7e
15 changed files with 511 additions and 229 deletions

View File

@@ -6591,6 +6591,12 @@ components:
description: 总数
type: integer
type: object
DtoInspectWeComTemplateParams:
properties:
template_id:
description: 企微后台已创建模板 ID
type: string
type: object
DtoInvalidateFailedItem:
properties:
line:
@@ -11082,6 +11088,42 @@ components:
description: 本次同步的可见成员数量
type: integer
type: object
DtoWeComTemplateControlResponse:
properties:
id:
description: 企微模板控件 ID
type: string
option_keys:
description: 选择控件可用选项 key
items:
type: string
nullable: true
type: array
required:
description: 是否必填
type: boolean
title:
description: 企微模板控件标题
type: string
type:
description: 企微模板控件类型
type: string
type: object
DtoWeComTemplateDetailResponse:
properties:
controls:
description: 可用于业务字段映射的模板控件
items:
$ref: '#/components/schemas/DtoWeComTemplateControlResponse'
nullable: true
type: array
name:
description: 企微模板名称
type: string
template_id:
description: 企微模板 ID
type: string
type: object
DtoWechatAppIDResponse:
properties:
app_id:
@@ -28633,6 +28675,78 @@ paths:
summary: 同步企业微信应用可见成员
tags:
- 企业微信审批
/api/admin/wecom/applications/{id}/templates/inspect:
post:
parameters:
- description: ID
in: path
name: id
required: true
schema:
description: ID
minimum: 0
type: integer
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/DtoInspectWeComTemplateParams'
responses:
"200":
content:
application/json:
schema:
properties:
code:
description: 响应码
example: 0
type: integer
data:
$ref: '#/components/schemas/DtoWeComTemplateDetailResponse'
msg:
description: 响应消息
example: success
type: string
timestamp:
description: 时间戳
format: date-time
type: string
required:
- code
- msg
- data
- timestamp
type: object
description: 成功
"400":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 请求参数错误
"401":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 未认证或认证已过期
"403":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 无权访问
"500":
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: 服务器内部错误
security:
- BearerAuth: []
summary: 读取企业微信审批模板控件
tags:
- 企业微信审批
/api/admin/wecom/applications/{id}/test:
post:
parameters:

View File

@@ -10,6 +10,7 @@
- `PUT /api/admin/wecom/applications/:id/default-creator`:从应用当前可见成员中选择代理等非企微账号使用的默认审批发起人。
- `POST /api/admin/wecom/applications/:id/members/sync`:拉取应用可见范围内的成员并原子刷新本地选择快照。
- `GET /api/admin/wecom/applications/:id/members`:按姓名或 userid 搜索并分页选择最近同步的可见成员。
- `POST /api/admin/wecom/applications/:id/templates/inspect`:输入企微后台已知模板 ID实时读取模板名称、控件 ID、类型、必填标识和选项 key供保存映射前选择控件。
- `PUT /api/admin/accounts/:id/wecom-binding`:把系统账号绑定到管理员明确选择的 `(corp_id, userid)`,同时保存姓名快照。
- `PUT /api/admin/wecom/scenes/:business_type`:配置已知 `template_id` 和业务字段控件映射,保存前实时读取模板详情校验。
- `GET /api/admin/wecom/scenes`:分页查询退款、员工线下代充值两个稳定业务场景的当前模板映射。
@@ -29,6 +30,7 @@
## 通讯录与账号绑定
- 同步只读取 `userid`、姓名和部门 ID不读取手机号或邮箱也不做手机号、姓名自动匹配。
- 同步先读取应用可见部门,再从可见部门树的根节点递归拉取成员并按 userid 去重,不要求应用必须有权读取企业根部门。
- `tb_wecom_member` 仅保存应用可见成员的选择快照;同步时把不再可见的成员标记为不可见,不建立本地部门或组织模型。
- 成员 userid 入库前统一转为小写,身份键按 `(corp_id, userid)` 管理;同一企微成员不能同时绑定多个未删除系统账号。
- 账号列表和详情返回 `wecom_corp_id``wecom_userid``wecom_name``wecom_bound`
@@ -47,6 +49,7 @@
## 审批场景与模板映射
- 企微没有按应用枚举全部审批模板的接口;管理员需先从企微后台取得模板 ID再调用模板检查接口读取可映射控件。
- 稳定业务类型固定为 `refund_approval``offline_recharge_approval`,业务代码不直接写死企微模板 ID。
- 模板必须先在企业微信后台创建;本系统不创建模板,也不保存审批节点或审批人规则。
- 保存映射时调用模板详情,逐项校验控件 ID、控件类型和选择项 key并要求模板所有必填控件都有映射模板结构已变化时拒绝覆盖当前有效配置。