8c3f3944be
feat(meta): POST /api/meta/entity 支持 reference 列(find-or-create SYS_REFERENCE 指向目标实体)
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-20 09:35:14 +08:00
61e51abeb6
feat(meta): GET /api/meta/entity/{table}/attributes 列清单+displayColumn+引用列反解
...
抽出可复用 @Component EntityAttributesService(records Result/Column,读真实表
SYS_ENTITYATTRIBUTE⋈SYS_ENTITY,引用目标经 DataDicService.getReferenceEntityTableName
反解),MetaController.attributes() 委托它(供 Section 2 同源消费)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-20 09:33:25 +08:00
4319178b66
feat(meta): GET /api/meta/entities 实体目录端点(引用列选择器数据源)
...
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-20 09:31:34 +08:00
6c6038350a
feat(ai-recipe): typed list columns to match converter house-style
...
AI 生成页的列直接显原始值(布尔列显「true/false」),与转换器 house-style 的
「是/否」「日期格式化」不一致——live 验收时 boolean 列肉眼可见 true。本次按
blueprint field type 纯导出列渲染类型(不依赖 colMeta 枚举/引用元数据):
- boolean → type:mapping, map:{true/1:"是", false/0:"否"}
- date → type:date, format:YYYY-MM-DD
- datetime → type:datetime, format:YYYY-MM-DD HH:mm:ss
- string/integer/number 保持纯文本(默认渲染即正确)
同时在 PageComponentRegistry 注册 mapping/date/datetime 三个标准 amis 列渲染器
(display 类,转换页本就用,否则 typed-page-schema 门会拒含 type 的列 → 409)。
maintenance 与 tree 列均应用。
验证:platform-metadata 397 + platform-ai 61 测试绿;8093 live 重生成
EIP4AI_HSDEMO,served schema ENABLED 列=mapping,浏览器实证「启用」列显
「是」(原 true),0 console error;已清测试数据。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-19 19:29:02 +08:00
5f320503ee
feat(ai-recipe): bind tree-crud-v1 writes to backend service flows
...
tree-crud 与 maintenance 同病:AI 已生成 _ADD/_UPDATE/_DELETE 流但树页的增改删
仍绑自创 /api/entity/{表}/save|delete(「页不绑」)。本次把写入对齐保真层服务流:
- 新增顶级 / 加子 表单 → post:/api/flow/<TABLE>_ADD
- 节点编辑 表单 → post:/api/flow/<TABLE>_UPDATE
- 节点删除 → /api/flow/<TABLE>_DELETE,data={ids:"${<PK>}"}(基线 ids 口径)
数据读保留 /api/entity/<TABLE>/tree(层级构建器,无 flow 树端点,非写旁路);
per-node 操作列对树是恰当 house-style(节点操作天生 per-node),不套用 flat
CRUD 的「无操作列」规则。证据:2727 转换页 0 用 crud+childrenColumnName,
基线树走 input-tree/tree 组件,故树 recipe 的对齐核心=写口径而非组件重构。
验证:platform-metadata 397 + platform-ai 61 测试绿;8093 live 经 AI pipeline
生成 tree 页 + 浏览器实证渲染(工具栏/节点加子-编辑-删除/entity-tree 取数)
+ served schema 确认写绑定全走 _ADD/_UPDATE/_DELETE,0 console error。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-19 19:13:48 +08:00
1ff0d334d0
feat(ai-recipe): align maintenance-crud-v1 to converter house-style
...
AI 生成的单表维护页与转换器基线产出存在「陌生感」:缺查询区、走自创
/api/entity REST 而非保真层服务流、动作放 per-row 操作列。本次对齐:
- crud.api → /api/flow/<TABLE>_SEARCH(amis 自动追 page/perPage,无 adaptor)
+ selectable/checkOnItemClick/primaryField
- 补 filter 查询区(string 列 → input-text 文本搜索)
- 新增/编辑/删除挂 headerToolbar 操作 selectedItems(带 id + disabledOn 守卫,
删掉 per-row 操作列);增改 inline 表单绑 _ADD/_UPDATE + reload,编辑用
dialog data:{"&":"${selectedItems[0]}"} 预填 + hidden 主键;删除
data={ids:"${selectedItems|pick:<PK>|join:','}"}(照搬基线,键为 ids)
- 连带:AiFeatureDraftGenerator.expectedPageApi + AiAgentService 的
render-plan 门禁改 recipe-aware(原硬编码 /api/entity + /list? 会让整条
pipeline 409)
证据:2727 转换页聚合 0 用 per-row operation 列 / 1976 headerToolbar /
1211 filter / 1277 _SEARCH。DefaultFlowHelper 流名吻合,AI pipeline 仅生成
list 页无独立表单页 → recipe 保持 inline 自包含。
验证:platform-metadata 397 + platform-ai 61 测试绿;8093 live 经 AI pipeline
重生成页 + 浏览器实证查询区/工具栏/选中守卫/flow 取数/编辑预填全绿,0 console error。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-19 19:07:39 +08:00
d3b88467e0
feat(page-schema): converge net-new standard writes to single PageSchemaWriter (M3a)
...
sys_page_schema standard layer had two runtime writers: the converter import CLI and AiLocalReleaseExecutor's raw JDBC INSERT (the critic-flagged net-new bypass). Introduce PageSchemaWriter as the single runtime write function (typed-recipe validation warn-not-block + etag + UPSERT), and route both a new admin-gated PUT /api/page/schema/{id}/standard endpoint (net-new producer for the design-center 'new feature' path) and AiLocalReleaseExecutor.applyPageSchema through it. No remaining raw INSERT into sys_page_schema in the AI runtime write path.
Scope: page_schema runtime write only. The deployment-package SQL-text generator (AiAgentService.pageSchemaSql, offline human-apply artifact) and SchemaImportCli (batch converter import) are separate legitimate paths. AiLocalReleaseExecutor sys_serviceflow/sys_menu raw writes remain (follow-on). Completion = code-complete, integration-pending (end-to-end render proof env-gated).
Tests: PageSchemaWriterTest (4) + PageSchemaControllerTest putStandard success/403/split (27 total) + AiLocalReleaseExecutorTest/AiAgentApiPipelineTest unchanged-green. TDD.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-19 17:21:06 +08:00
bac69d85a7
fix(page-schema): scope typed-recipe gate to AI drafts, not designer overlay saves
...
putOverlay hard-rejected (400) any overlay using components/actions outside the ~35-component AI recipe whitelist. Existing converted pages use 13 unregistered component types (search-box/dialog/mapping/tabs/each/tree-select/input-date-range/…) plus 6 onEvent action types that are structurally actionType-without-type (ACTION_WITHOUT_COMPONENT), so editing+saving virtually any existing list page in the designer returned 400.
Split path: putOverlay (designer write path) now validates-and-warns instead of blocking; the strict typed gate stays on POST /api/page/schema/validate and the AI draft pipeline. Clears the only existing-page regression blocking the ai-agent merge to main. TDD: PageSchemaControllerTest#20 rewritten RED->GREEN; 37 schema tests green.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-19 15:49:26 +08:00
bd4c642766
merge ai agent module
2026-06-19 14:01:09 +08:00
ccd74710fa
fix schedule job notify editor
ci / build-test-parity (push) Has been cancelled
2026-06-18 17:15:10 +08:00
d218c2ba6f
fix framework treegrid search and formeditgrid editors
2026-06-18 16:35:51 +08:00
b6e6964913
fix framework p2 custom views
2026-06-18 15:35:17 +08:00
22211b2557
feat(附件): 双态组件 + 新建/编辑保存落库打通
...
- 转换器 buildAttachmentField: 附件字段收敛为单个 input-file 双态组件
(staticOn ${__readonly} 查看只读可下载/编辑可增删; joinValues:false,extractValue:false
提交附件对象数组), 删除 each+service 容器, 查看/编辑同位置同布局
- FlowController 读路径 resolveAttachmentFields: 把保真层大写 DOCUMENT
({SYS_DOC_ID,FILENAME,FILESIZE}) 归一为 amis 小写契约 {id,name,value,url,sizeKb},
修掉"查看附件空白图标"
- FlowController 写路径 normalizeAttachmentFieldsForWrite(按 url=/api/file/ 签名识别):
修改流 → [{SYS_DOC_ID}] 交保真层 updateAttachments 对账(留/软删/不重复插);
新建流 → 捕获 docId+剥离 DOCUMENT, 保存后用返回主键 relinkInsertedAttachments
UPDATE sys_doc.businesskey 改挂(直接改挂、非复制 → 无 UNKNOWN 孤儿)
- FileController.upload: businesskey 右补白 36 位对齐保真层 getDoc(CHAR(36) 主键),
否则 loadDoc 读不到新附件; 响应补 value
- 测试: converter 154 + metadata 368 全绿
(新增 4c 读契约归一 / 4d 修改归一 / 4e 新建改挂 / FileController 补白)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-18 13:09:36 +08:00
5636b37220
feat: complete framework P2 deltas
2026-06-18 11:18:40 +08:00
eafd872271
feat: restore work calendar view
2026-06-18 10:26:07 +08:00
1ef3de1cc2
fix: restore entity type filtering for treegrid views
ci / build-test-parity (push) Has been cancelled
2026-06-18 10:09:41 +08:00
c9e4d35ca1
feat: wire schedule notifications and data import downloads
ci / build-test-parity (push) Has been cancelled
2026-06-18 09:59:55 +08:00
3523007f16
feat: add framework script editor actions
ci / build-test-parity (push) Has been cancelled
2026-06-18 09:39:07 +08:00
278b0da422
fix(platform): resolve picker load defaults
ci / build-test-parity (push) Has been cancelled
2026-06-18 01:51:59 +08:00
723443ea1e
fix(platform): implement short message send
2026-06-18 01:19:15 +08:00
f690f30552
fix(platform): repair message detail views
ci / build-test-parity (push) Has been cancelled
2026-06-18 00:49:03 +08:00
bf7bb2515b
fix(platform): complete picker parity and message detail
ci / build-test-parity (push) Has been cancelled
2026-06-18 00:30:01 +08:00
57f011e801
feat(metadata): restore legacy user transfer picker flow
ci / build-test-parity (push) Has been cancelled
2026-06-17 22:36:33 +08:00
78d27847dd
fix(metadata): make user picker searchable and show selections
ci / build-test-parity (push) Has been cancelled
2026-06-17 22:04:26 +08:00
88ff6f6bfb
feat(metadata): wire legacy process selector
ci / build-test-parity (push) Has been cancelled
2026-06-17 21:45:12 +08:00
1581a99d75
feat(metadata): wire legacy user select picker
ci / build-test-parity (push) Has been cancelled
2026-06-17 21:31:11 +08:00
57c3412aff
fix(flow): restore workflow task converted pages
2026-06-17 20:44:52 +08:00
fb8a37ddc5
fix(flow): 搜索时间段过滤——amis date-range 串转 DateTime[] 接通引擎区间查询
...
ci / build-test-parity (push) Has been cancelled
操作日志等"时间段查不动"(设了起止仍返回全部)根因:amis input-date(time)-range
把时间段提交为 "起,止" 逗号串,但引擎 GeneralPO 的搜索 where 构建只对 DateTime[]
值生成区间条件 (col>=起 AND col<=止)——收到 String 识别不了,整条时间段过滤被忽略。
且保真层的 coerceByFlowId 只在写流(NAMED_WRITE)调用,读流(SEARCH)根本不 coerce。
修:
- FlowInputCoercer.coerceValue DATE/TIME 支持区间:含逗号 → 拆两段各 parse → DateTime[]
(空段→null,引擎该侧不加约束);解析失败保留原值(fail-safe)。
- coerceDate 增 10-11 位 unix 秒识别(amis input-date(time)-range 默认 format=X 提交秒),
原仅认 13 位毫秒;ISO/yyyy-MM-dd[ HH:mm:ss] 等格式不变。
- 新增 coerceSearchDatesByFlowId / coerceSearchDatesByTable:只转 DATE/TIME 列
(其它过滤参一概不动 → 对已工作的文本/枚举/picker 搜索零回归)。
- FlowController 在 NAMED_READ / SYNTHESIZED(读流)路径调用上述方法。
注:单值日期 → DateTime(引擎 = 精确匹配,忠实老引擎);区间才是常见用法。
live 实证 SYS_DATA_LOG_SEARCH:无过滤 748179,远古区间 45643,2026-06 区间 535,
2026-06-15~18 格式化 53——不同区间返回不同结果(秒/毫秒/格式化字符串均识别)。
FlowInputCoercerTest 43 绿(+6 日期/区间用例)。已重建 platform-app + 重启 8093。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-17 17:57:46 +08:00
17c449cbf5
feat(converter): 机制①定制视图 delta 注入 + filterscript 级联过滤
...
机制①(engineclass Java delta 移植):老系统「定制视图」=数据驱动 XML 由
默认模板引擎渲染,但配 engineclass 的视图有 Java 子类在默认引擎之上加/改
按钮。转换器已复刻默认页但抓不到 Java delta——新增 EngineclassDelta 注册表
(engineclass FQN → 工具栏按钮 builder),convertGraded 增 engineclass 入参,
默认页转好后追加注入(默认页不变,仅 append);BatchConvertCli 透传
view_template.engineclass。
本轮注册 4 个 framework 定制视图:
- UserManageView:设置主岗位 + 查看用户菜单
- SystemLogMainView:按类型删除 + 全部删除
- SysUserLoginHistoryMainView:按查询条件删除记录
- SysUserLoginInfoMainView:查看登录记录(下钻登录历史)
配套后端:
- LogController(/api/admin/log/delete-all|delete-by-type|delete-by-logintime)
接 SystemLogManager;deleteByType 用 LogType 枚举白名单防注入。
- MenuController 新增 /api/admin/user/{userId}/menu(查看指定用户可见菜单树,
移植 UserRoleView,与 /api/admin/menu 共用 menuTreeFor 构建逻辑)。
filterscript 级联(P1):view_page 字段 filterscript 的「按其它字段值过滤本
字段」语义无法统一脚本引擎,故按性能优先做模式匹配——动态/常量等值绑定追加
到 select source(&COL=${TRIG}),含 SQL/服务调用/控制流/WhereClause 的复杂
脚本整条跳过(不误改);动态触发设 initFetchOn,添加态不发空参全量请求。
测试全绿(platform-converter + platform-metadata 共 490,0 失败 0 错误)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-17 16:32:50 +08:00
d427be2802
feat(picker): 列筛选下推,支持表单级联(组织→部门→岗位)
...
PickerController.list() 在 q 模糊查之后追加 applyColumnFilters:把请求里
按真实表列名传入的等值过滤参(白名单=该表真实列,排除 q/page/perPage/op
/value/_id/asUser/roles/asDepart/asOrg 等控制参)下推为等值条件,空值跳过,
escapeLikeValue 防注入。
配合转换器 filterscript 级联:上级选择框变化后 amis 以 &COL=${TRIG} 重拉
本选择框 source,由此端点据列值过滤,实现组织→部门→岗位的联动下拉。
PickerControllerTest 扩充覆盖列筛选/白名单/空值/转义。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-17 16:32:33 +08:00
abc32af6e9
fix(flow): _SEARCH 解析改 real-first,忠实旧引擎不再无脑合成
...
旧引擎 FlowServiceImpl.getFlowDefinition 只按 id 从 sys_serviceflow 读
存储流,无运行时合成(默认流在建实体时 addDefaultFlowService 已落库)。
原 EIP4 对所有 _SEARCH 一律合成默认流,盖住了 605 个真实定制流——致约
107 个列表打不开(合成默认流 order by CREATETIME,但表无 createtime 列)
+ 约 157 个排序错(真实流 start 脚本里的自定义排序/join/过滤被无视,
如登录历史 order by LOGINTIME DESC)。
改为 real-first:有真实 serviceflow 就优先真实流(NAMED_READ/WRITE,
跑其存储定义的正确语义),仅未迁默认流的实体才合成兜底。这样所有操作
(_ADD/_UPDATE/_LOAD/_SUBMIT 本就 real-first)统一为「读存储流」,与旧
系统一致。real-first 不会比旧系统更错——跑的就是旧系统跑的同一存储流;
真报错旧系统亦然(数据权限校验 / 缺表)。
A/B 验证(650 个 _SEARCH 引用):基线 OK=564 ERR=86 → real-first
OK=594 ERR=56,新修 33(含 SYS_USERLOGIN_HISTORY_SEARCH),3 个「回归」
经核为忠实暴露(2 个真实流的员工档案数据权限校验、1 个真实流引用缺表
PM_PROJECTNODEDATA),非 EIP4 执行 bug。
FlowNameResolverTest +1(searchSuffixWithRealFlow_prefersNamedRead)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-17 16:32:23 +08:00
718c5a5b9b
feat: add AI tree CRUD recipe
2026-06-17 13:03:38 +08:00
2b0b673ce9
feat: expose AI page recipes
2026-06-17 12:38:26 +08:00
fcc5719bc6
feat: enforce AI page recipe gate
2026-06-17 12:33:09 +08:00
e55072598e
feat: add AI page blueprint compiler
2026-06-17 12:14:57 +08:00
c1ff0db96b
feat: enforce typed page schema in AI drafts
2026-06-17 09:15:10 +08:00
5eb95a4ef4
feat: add typed page schema registry
2026-06-17 08:39:51 +08:00
3b4d3dbd24
feat: add AI agent auto-development pipeline
2026-06-17 07:32:54 +08:00
5e0845e2c2
feat(converter+metadata): 树+表 type=4 选择框 → picker 弹窗(分类树过滤+功能表格)
...
SelectDialog/MultiSelectDialog 的 dialogid 指向 type=4 treeGrid 模板时(如功能 8b89fd29:treetemplate分类树+gridtemplate功能表 rcolumnname=ENTITYTYPE),转换器 applyTreeGridPicker 产 picker:source=/api/template/treegrid?treeRef=&gridTable=&rcol=&node=${rcol},pickerSchema={mode:table, filter:[tree-select 分类 source=/api/template/{treeRef}/tree searchable], columns(取自gridtemplate display)}。降级规则:通用+自定义 type=4 都走此(不看 engineclass,自定义降级为通用 treeGrid 渲染,非扁平表)。后端 TemplateTreeController.treeGrid 每行补 _label(grid实体显示列)供 picker labelField 显名。spike 实证 amis picker pickerSchema=crud+tree-select filter 机制成立。live:菜单维护 功能 picker 开弹窗=分类树过滤+功能表格(7列单选),选行回填 id+显名,console 0错。caveat:8b89fd29 右表 VIEW_TEMPLATE 无物理 ENTITYTYPE 列→该 dialog 分类过滤不缩窄(数据特性非机制缺陷),其它 type=4 正常。converter121+metadata323测试绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 21:48:08 +08:00
7c15bc55f8
fix(metadata): 表单空字符串按列类型→null(防 FK/PK/数字列空串保存失败)
...
amis 表单未选 select/picker/tree-select + 隐藏框默认值未赋值提交 ''(老前端省略未选键=null,引擎从不遇空串)。引擎对 FK 列空串写 SQL '' → FK约束违反(MENUROOT/VIEW_TEMPLATEID 报「功能引用的对象被删除」);PK 空串致保存脚本 isSave=(PK==null) 误判走 update 不落库。FlowInputCoercer.applyCoerce 对 String 空串先按列类型 emptyToNull:列名 _ID 结尾(PK/FK)、referenceid 是36位实体UUID(FK引用如MENUROOT)、非文本列(数字/日期/布尔/枚举/CHAR-id等)→null;自由文本 NVARCHAR/CODE 保留空串(对齐老语义,护 NOT NULL 合法空文本)。与 flattenPickerObjects 协同(picker 对象拍裸id后空 _id 亦→null)。真实保存实证:SYS_MENU_ADD/OA_NEWSCOLLECTIONTYPE_ADD 空字段从失败→status:0落库,FK列落 null;独立复验 menuroot/view_templateid IS NULL。323测试绿。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 18:12:26 +08:00
a19bcdbf67
feat(metadata): 实体加载按 pageId 把引用字段解析为 {_id,_label} 对象 + 保存拍回裸 id
...
EntityController.load 加可选 ?pageId=:读 view_page(pageId) 字段,把 uitype=SelectDialog/MultiSelectDialog(带 dialogid)字段值解析成 {_id,_label} 对象(multi→对象数组),label 由各字段 dialogid 经 PickerController.resolveValuesToOptions 同源解析(口径=老 DialogDisplayUtil);type=3 树 dialog(转 tree-select 吃裸id)按 isTreeDialog 跳过不转对象防 undefined;_id 去尾补白。pageId 空→行为不变(回归)。PickerController.resolveValuesToOptions 提包级可见供复用(端点行为不变)。FlowInputCoercer.flattenPickerObjects:写流入参里 {_id,...} 形态值拍回裸 _id(去尾补白)——amis picker「载入后不动直接保存」会把整个对象进 payload,后端统一扁平守住提交值=id(零前端改动)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 17:58:42 +08:00
9d05894e9d
feat(metadata): picker 值→显名解析(对齐老系统 DialogDisplayUtil)+ 实体加载 CHAR trim
...
PickerController 加 GET /api/picker/{dialogId}/resolve?value=(支持逗号多值,返 [{_id,_label}],查不到回退{_id:v,_label:v}),并让 /list 认 op=loadOptions 短路为按值解析(amis picker 原生回环口径),复用 /list 的 dialog 配置(实体表/keyColumn/displayColumn)WHERE keyColumn IN,_label 与 /list 同源。等价老系统 DialogDisplayUtil.parseDisplay(dialogid,value)→getDisplay()。EntityController.toRow 对 String 列 stripTrailing 去 CHAR(n) 尾补白——修主从/编辑表单经 /api/entity 回填引用字段时 CHAR 补白值(如 MENUROOT='MESSAGE ')与已 trim 的 picker 选项 _id 永不匹配致只显裸 id(根级菜单显 MESSAGE)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 16:40:02 +08:00
598f4f9662
feat(converter): 通用模板 P0 收口——日历 type5 / 树 type3 接端点 / 组合 type6 真加载
...
type5 日历:isCalendarTemplate 分流根元素<crud>但语义日历的模板→convertCalendar(amis calendar,largeMode,items→schedules,scheduleAction drawer),不再被当普通表格丢班次/调度语义。type3 声明式树:currentTemplateId 把 source 指向 /api/template/{templateId}/tree(TemplateTreeController 构 {label,value}),修 source 用 /api/flow 返 {items:[{TYPENAME}]} 显「undefined」根因;树型选择框同源复用 /api/template/{dialogId}/tree。type6 组合:convertGroup 每 tab 发 service schemaApi get:/api/page/schema/{tempId}?format=amis + amis mountOnEnter 懒加载,真接子模板远程加载,不再 tpl 占位。分级清单.csv 同步重生。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 14:08:49 +08:00
cd133aa11d
fix(metadata): 引用列 id→显名一致化(业务+审批表单)
...
UserColumnResolver 新增 resolveFormRecord(主+子表 _DISPLAY__,子表名按子行主键侦测)与 joinUserDisplayNames(多选人员列如接收人显名);单记录表单加载经 FlowController.resolveFormRecord 解析引用列,修「查看页全显 id」。PickerController/FormDefaultsController 对 CHAR 主键去尾空格补白,使 select 默认值与 picker option value 精确匹配显名而非裸 id。PickerController 弹窗按 <display> 忠实复刻老系统多列。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-16 14:08:12 +08:00
13d6b4cdf8
feat(editgrid): 主子表编辑页可用——默认值/编号+子表选品picker+数值校验+行内脚本引擎+日期coerce+保存端到端
...
以「办公用品采购申请编辑页」为镜补齐主子表(EditGrid)功能模板转换缺口,子表 editgrid 从「不可用」到可加行/选品/算金额/保存落库。
D 数值校验: UiTypeMapper NumberField 读 vmin/vmax → amis min/max(applyNumberBound)。
B 默认值/编号: FormDefaultsController(/api/form/{table}/defaults)服务端解析 initvalue 宏
(复用 GetDefaultValueFunction) + {AUTOGENERATECODE}→CodeRuleService.getCode + _DISPLAY__回填;
LegacyXmlWiring 注册 codeRuleService bean(零改 com.dsasp);转换器添加 dialog 接 defaults + 补 {CURRENTDEPART}。
A 子表行内交互: EditGridScriptRunner(faithful 跑原 Groovy,类型保真,绑定 event/group/group.parent/loadPOJO)
+ EditGridScriptController(/api/script/execute-editgrid-row);转换器 buildEditGridColumns 挂 quickEdit.onEvent.change
(outputVar/row=${__rendererData}/componentId+index)+子表内只读 SelectDialog→picker 列+addable;input-table/form 加 id。
picker 400 修复: PickerController.resolveByViewTemplate 支持 <tree><treetemplate><gridtemplate> 树+网格选择窗
(取 gridtemplate 网格实体作数据源),修「子表选用品 400 非法实体」。
日期写流缺口(引擎级通用): FlowInputCoercer 补 DATE/TIME → joda DateTime(毫秒/ISO/yyyy-MM-dd[ HH:mm:ss]),
修一切含日期列表单写流 ClassCastException(String→DateTime)崩。
compute-on-save: EditGridDerivedFieldComputer(两遍:行内派生→父聚合)+FlowController ?__egtpl= 入口,
落库前补算 editgrid 派生字段(对 display-only 非列键 no-op,对有派生列模板通用生效)。
验证: 主子表 _ADD 端到端实证落库(master+2子行,FK PURCHASE_ID 自动回填,APPLYDATE coerce 落库);
picker/默认值浏览器实证;converter 108 + metadata 相关 67 测试绿。
注: 本提交亦携带工作区既有未提交改动(FlowController normalize 深度上限保护等)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-15 11:05:55 +08:00
81cb17bb9a
fix(script): 执行前给 item 注入枚举显示值——修枚举显示串比较类脚本(文件归档)
...
老 EIP-3 行选中事件传给脚本的 item(grid 行)里枚举列携带的是显示串(如 ISPLACE=「未归档」),
而 loadPOJO().toMap()(poMap)给裸码。改写后脚本据此分工:数值比较走 poMap.get("STATUS"),
显示串比较走 item['ISPLACE'] == "未归档"。EIP4 的 _SEARCH 合成流只把裸码平展进 amis 行 →
item['ISPLACE']=0(非「未归档」) → 比较永假 → 文件归档等永不点亮(全库 285 处
item['COL']=="显示串" 同病;全库 0 处 item[COL]==数字,数值比较一律走 poMap)。
修(通用):
- EnumDisplayResolver:元数据驱动(SYS_ENTITYATTRIBUTE referenceid IN ENUMERATE/STATUS +
enumeratetype → SYS_ENUMERATE codevalue→codedes),就地把 item 枚举列裸码换成显示串。
表名优先入参,否则从 item 的 <TABLE>_ID 主键反推;非数字码/无对应值不覆写(幂等安全);
三层 Caffeine 缓存。
- ScriptExecuteController.executeTemplateRewritten:runWithFacade 前 enrichItem(null,item)。
加 @Autowired 3 参构造 + 兼容 2 参构造(自建 resolver)。
- PoInfoCacheInvalidator:属性变更同步 enumDisplayResolver.evictAll()(与 userColumnResolver
同钩子)。
测试:EnumDisplayResolverTest +5、ScriptExecuteControllerTest +1(枚举注入使按钮点亮)、
PoInfoCacheInvalidatorTest 3 参构造适配。运行时实证:POST /api/script/execute-template
传 ISPLACE:0 → item 富化为「未归档」→ enabled 文件归档;ISPLACE:3 → 「已归档」→ 文件归档
不点亮(控制对照)。浏览器选中未归档新闻行→文件归档点亮可点。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 19:10:57 +08:00
5d12613034
perf(WS-D I1): /api/file/list 去函数包列 + sys_doc 函数式部分索引(全表扫→Index Scan)
...
I1 性能(必修):
- 根因: GET /api/file/list 原查询 WHERE UPPER(tablename)=? AND TRIM(businesskey)=?
AND isactive=1 —— 列被函数包裹(非 sargable),sys_doc 33.8 万行仅 PK 索引
→ 每次附件页渲染 Parallel Seq Scan 全表(amis service 容器每渲必打本端点;
EXPLAIN cost ~18572)。
- 修(FileController.list 查询):
· tablename 列本就全大写(DB 实测 tablename<>upper(tablename) 计数 0),app 侧已
tableName.trim().toUpperCase() → 去 UPPER 改 tablename = ?(sargable)。
· businesskey 不能简单 = trimmed: DB 实测 13000 行存「32 位 UUID + 4 空格 padding
至 36」CHAR 补白遗留(业务 PK 为 character(36)),naive businesskey=trimmed 会
漏列这 13000 行附件 → 保留 trim 语义改 rtrim(businesskey) = ?,配函数式索引使其
sargable。全程 ? 绑定(防注入,无拼接)。
- 索引 DDL: docs/sql/SYS_DOC_INDEX.sql
CREATE INDEX IF NOT EXISTS ix_sys_doc_biz
ON eip3.sys_doc (tablename, rtrim(businesskey)) WHERE isactive = 1;
已应用到 eip4dev(含 COMMENT,幂等)。客户库排切流窗口执行(与现有 docs/sql/* 同放
同风格;P5 Flyway 待办同 SYS_PAGE_SCHEMA.sql)。
- 验证(eip4dev): EXPLAIN Seq Scan(cost 18572) → Index Scan using ix_sys_doc_biz
(cost 8.44, exec 0.038ms); 补白键 OA_NOTICEMANAGE + 横线键 OA_NEWSMANAGE 均命中。
8093 重启含新 jar 后 /api/file/list 两种键风格均正常返附件(含 13000 行补白键场景)。
补测试:
- FileControllerTest #5 注入安全(priority 契约): 恶意 tableName/businessKey 不抛、返空,
ArgumentCaptor 断言走 ? 绑定(SQL 文本为静态参数化语句不含用户串,用户原串作绑定值)。
- TemplateToAmisConverterTest 新增 skip-guard: 表名 ORPHAN_*(SYS_ENTITY 解析不到)→
enrichAttachmentFields 降级守卫生效,附件字段保留原 input-file 不包 service。
- 测试全绿: FileControllerTest 5/5, TemplateToAmisConverterTest 93/93(JDK21)。
M4: buildAttachmentField 加注释说明 service.name 与内层 input-file 同名(DOCUMENT)
仅作布局归位 key,表单值由内层 input-file 绑定,amis 容忍(已浏览器验证)。
I2(已知系统级后续项,本次不修): /api/file/list 及 download 无行级数据权限——任意已认证
用户可枚举任意业务记录附件,与现有 download/flow 同 posture(生产仅认证可访问)。
TODO 注释标于 FileController.list javadoc。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 18:20:38 +08:00
ad65c51ad1
feat(WS-D): 查看页附件只读下载列表 + 用户引用列(发布人)显示名
...
D.2 附件查看下载列表(对齐老系统):
- 附件按 sys_doc.tablename+businesskey 关联业务记录(非物理列),老
MultiFileUploadField→input-file 在只读查看态渲染空上传按钮、不显已有附件。
- FileController 新增 GET /api/file/list(按 tableName+businessKey 列 sys_doc),
返回 {status,data:{items:[{id,name,size,sizeKb,url}]}};空业务键不查库防全表扫。
- 转换器 enrichAttachmentFields:把附件字段(input-file)就地包成 service 容器——
api 按业务主键 ${<TABLE>_ID} 拉 /api/file/list,each 渲染已有附件下载链接
(文件名(大小KB)+/api/file/${id}),并保留上传控件(编辑态加附件)。
service 纳入 isWideField(独占整行)。convertViewPage/convertForm 均接入。
D.3 用户引用列(发布人)显示名:
- 根因:查看新闻列表走命名读流 OA_NEWSMANAGE_SEARCH_LOOK,FlowController
NAMED_READ 分支此前 table=null 跳过 UserColumnResolver→USERSEND_ID_DISPLAY__
不填→发布人显「-」。USERSEND_ID 本就是 SYS_USER 引用,解析器口径无误。
- FlowNameResolver 新增 entityTableForNamedFlow(经 sys_serviceflow.entityid→
sys_entity.tablename 解析命名读流数据源实体表,缓存+失败哨兵);FlowController
NAMED_READ 分支据此传 table 给 ok(...),解析器补出 _DISPLAY__ 显示名。
测试:
- TemplateToAmisConverterTest 92 绿(改 3 既有附件断言+新增查看态下载列表断言)。
- FlowControllerTest 29 绿(#16 改命名读流解析不到表跳过,#16b 新增命名读流
解析出表→发布人 id→姓名)。FileControllerTest 4 绿(list/空键/空集/小文件KB)。
实证(8093 live + 5173 playwright):查看新闻列表发布人显 顾竟蓝[000031]/
李文娟[000010]/沈波恩[000008](非「-」);查看含附件新闻→附件下载列表显
文件名+KB+下载链(3 项),真实文件下载 200+attachment;console 0 错。
全量重转(保 onEvent 501)+SchemaImportCli upsert 1163,JDK21。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 18:01:42 +08:00
1108fbd961
fix(converter): WS-B B4 两 Critical——删除恢复 fanout(ids-only)+无脚本页业务按钮 disabledOn 解除永久灰
...
修 B4(8df37e9 ) code-review 两个 Critical:
C1 多选删除只删第一行(dual-key 抑制 fanout):
B4 真删除按钮 data 同送 ids(逗号串)+PK(首行),但删除族流 <input> 声明
<PK> required → FlowInputCoercer.missingRequiredIdInput 因 map.containsKey(PK)
返 null → FlowController fanout 分支(291-318)被跳过 → 只对 selectedItems.0
执行一次(确认文案却说删全部)。改:按分支拆 data——
· 真删除按钮(ajaxPostDeleteApi):data 只送 {ids},恢复 fanout 批量删除;
· 业务动作按钮(ajaxPostBusinessApi):data 只送 {<PK>}(业务流读 map[PK])。
PK 表达式改 bracket 记法 ${selectedItems[0].<PK>}(与既有 ${selectedItems[0]}
一致,非 dot-zero);纠正 B4 javadoc(写 bracket 实际 emit dot)。
C2 无脚本页业务按钮永久置灰(55 模板,含「提交审批」):
buildToolbar 给业务按钮无条件 baseline disabled:true,靠 onselectedscript
脚本点亮;但 DB 实测 55 个 crud 模板有 disabled:true 业务按钮却无 onEvent
→ 永久灰、点不动。新增 demoteUnscriptedBusinessButtons:仅当页面无
onEvent.selectedChange(无脚本控启停)时,把带 /api/flow/ 的 baseline disabled
业务按钮降级为 disabledOn:"${!selectedItems...}"(选中即可用,贴老 bulkActions
选中态语义);有脚本控则 no-op(保持 disabled:true 由脚本点亮)。调用点:
attachScriptOnEvent 内(仅 onload 无 onselected 时)+ BatchConvertCli 对
bindings.isEmpty() 的无绑定页兜底(attachScriptOnEvent 不被调用)。
测试(TDD):
· TemplateToAmisConverterTest +5:删除 data 只含 ids、业务 data 只含 PK(bracket)、
有脚本页保持 disabled:true、仅 onload 降级 disabledOn、无脚本页 demote 降级、
有脚本控 demote no-op;改写 2 个 B4 既有用例至 C1 拆分契约。converter 107 绿。
· FlowControllerTest +1(17d):body 只送 ids="a,b,c"(不含 PK) → 删除族(PK required)
fanout 执行 3 次,锁住「ids-only→fanout」。metadata 60 绿(未改 metadata 生产代码)。
重转+入库(eip4dev):crud 956/956、[WS-B]对齐告警 0,SchemaImportCli upsert 782。
DB 复核:C2 victims 55→0。
浏览器端到端实证(8093 live + 5173,admin/111111):
· C1 fanout:POST /api/flow/OA_NEWSMANAGE_DELETE {ids:"3 主键"} → count:3、
3 行真删除(DB count 3→0),证明 fanout 恢复(API 实证,避免破坏真实数据)。
· C2:8093 实服 schema 中 PM_REWARDSANDPUNISHMENTS「提交审批」按钮已为
disabledOn(非 disabled:true)、data=PK-only;删除按钮 data=ids-only。
· 新闻不退化:ddb75614 选中可见行→隐藏/置顶/删除点亮、发布灰(B4 行为保持)。
· console 0 ajax 报错。
边角现状:少数「页面有 onselectedscript 但某业务按钮未被脚本 enableButton 引用」
仍可能永久灰——属脚本覆盖问题,本次未处理(demote 仅作用于 no-script 页,
有 selectedChange 页保守 no-op,避免覆盖脚本控语义)。
base=8df37e9
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 17:25:28 +08:00
47d03b714b
fix(converter): scriptKeyToSeq 复刻改写器枚举(C2)+缺脚本 fail-closed/no-op(C1)+去重(I2)
...
re-review 修 WS-B 两 Critical + 两 Important。
C2(最关键,静默挂错脚本):scriptKeyToSeq 旧实现按 <scripts> 直接子、无长度过滤
1-based 编号,与改写器盘上 seq 枚举不一致 → 多脚本模板挂错 seq。改写器真实枚举
(run_eval.py::load_corpus_db + run_rewrite.py 核实):xpath('//script/text()') 全局
范围(非仅 <scripts> 子)+ strip 后 length<5 跳过(continue 不占号)+ 对保留者
1-based 连续编号。新实现用 selectNodes("//script") 文档序 + getText() + SCRIPT_MIN_LEN=5
过滤 + 连续编号逐位对齐。新增 countKeptScripts 供对齐校验。
- 全库实证(psql eip4dev,721 个有盘模板):新规则 key→seq 总数 701/701 == 盘上文件数
(旧版 32 模板偏差/1 模板 key 错位 d1f64d77: K_FILTER 旧算 seq=3 盘上无→运行时「未找到」,
新算 seq=2 命中);999 事件绑定 997 命中盘上文件、2 为悬挂/被过滤 key(C1 fail-closed)。
C1-a(有绑定但文件不存在不挂):attachScriptOnEvent 增 Predicate<Integer> seqExists
重载(converter 不碰 FS,由 BatchConvertCli 注入盘上 existingSeqs);seq 无对应
rewritten/<id>/<seq>.*.groovy 则跳过该绑定(fail-closed)。BatchConvertCli 接线
existingSeqs(镜像 RewrittenScriptStore prefix+.groovy 匹配)+ 重转期对齐校验告警
(转换器算 keyed-script 数 ≠ 盘上文件数则 System.out 提示)。
C1-b(运行时兜底):ScriptExecuteController.executeTemplateRewritten 当 load 返 null/blank
改返 {passed:true, commands:[], commandCount:0}(no-op)而非 {passed:false,error},残余
缺脚本退化为「无联动」而非用户可见 ajax 报错;保留 blank templateId→{passed:false}。
I2(去重):extractEventBindings 按 (eventType,scriptKey) 去重,免同脚本多处绑定致 ajax 双发。
M3/M2:清理 BatchConvertCli javadoc 的 full_auto_index/<scripts> 文档序漂移;bulkActions
删除按钮无 id(enableButton 定位不到)记 note(删除极少被联动启停,不强制修)。
测试:platform-converter 92 绿(TemplateToAmisConverterTest 83 含新增 C2 短脚本跳过/外部
script 计入/keyless 占号、C1-a seqExists、I2 去重;BatchConvertCliTest 9 新建:parseKeyToSeq/
parseEventBindings/parseCountKeptScripts/existingSeqs/attached-seq 命中盘上文件契约)。
platform-metadata ScriptExecuteControllerTest 5 绿(缺 templateId→false / 脚本未找到→no-op 拆分)。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-14 15:21:04 +08:00