From 94420465d234993137e2f7e22526eab0b6dd8a8f Mon Sep 17 00:00:00 2001 From: ssw Date: Sat, 27 Jun 2026 10:09:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(form):=20B-9=20=E8=87=AA=E5=8A=A8=E7=BB=99?= =?UTF-8?q?=20tables[0].typeId=3D'1'=20(=E4=B8=BB=E8=A1=A8=E6=A0=87?= =?UTF-8?q?=E8=AF=86,=20=E5=90=8E=E7=AB=AF=20FlowFormDataUtil=20=E9=9C=80?= =?UTF-8?q?=E8=A6=81)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dacli form create 之前 tables 推导后缺 typeId 字段, 后端 createMast:831 查 typeId='1' 找不到抛 '集合条件过滤获得目标为空' (MsgCode.COD001). 现在自动给第一个表加 typeId='1', 后续表 typeId='0' (子表). 用户 --tables 显式指定 typeId 不受影响 (if !t.typeId 检查). 镜像 web formDesign/Form.vue:288 `const typeId = i == 0 ? '1' : '0'`. 后端 jnpf/.../FlowFormDataUtil.java:831 `filter(t -> "1".equals(t.getTypeId())).findFirst()` → throw MsgCode.COD001 后端 TableModel.java:13 注释 '1-主表、0-子表'. main 兜底 schema 已带 typeId='1' (line 124), 但用户 --tables 路径可能漏, 这里加防御性补全 (无论 --tables 还是兜底都覆盖). tds 9 bug 复盘 2026-06-27 --- src/commands/form/create.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/commands/form/create.ts b/src/commands/form/create.ts index 382549d..12f63f8 100644 --- a/src/commands/form/create.ts +++ b/src/commands/form/create.ts @@ -130,6 +130,19 @@ export function buildFormCreateCommand(): Command { }, ] + // 2026-06-27 B-9 修复: tables 推导后, 自动给第一个表加 typeId='1' (主表标识) + // 后端 jnpf/.../FlowFormDataUtil.java:831 查 typeId='1' 找主表, 找不到抛 MsgCode.COD001 + // ("集合条件过滤获得目标为空"). 即使用户 --tables 显式传了, 也可能漏 typeId. + // 兜底 schema 已有 typeId='1' (line 124), 这里统一保护用户传入路径. + // 用户 --tables 显式指定 typeId 不受影响 (先检查 !t.typeId). + if (Array.isArray(tables) && tables.length > 0) { + tables.forEach((t: any, idx: number) => { + if (t && typeof t === 'object' && !t.typeId) { + t.typeId = idx === 0 ? '1' : '0' + } + }) + } + const body: Record = { fullName: opts.fullName, enCode: opts.enCode,