Browse Source

refactor(online): 优化子表列字段类型映射逻辑

- 将子表列字段类型从硬编码改为按 comType 从映射表获取
- 添加映射失败时回退到 varchar(750) 的机制
- 保持现有 variableName 标签的驼峰转换逻辑不变
feature/2026-07-ccc-dev
chenchuchuan 2 weeks ago
parent
commit
bc89e5091b
  1. 5
      common/common-online/src/main/java/apelet/common/online/controller/OnlineFormController.java

5
common/common-online/src/main/java/apelet/common/online/controller/OnlineFormController.java

@ -674,8 +674,9 @@ public class OnlineFormController {
Integer widgetType = widget.getInteger("widgetType"); Integer widgetType = widget.getInteger("widgetType");
if (!isTableColumn && (widgetType == null || !WidgetFieldTypeMapping.isDataWidget(widgetType))) continue; if (!isTableColumn && (widgetType == null || !WidgetFieldTypeMapping.isDataWidget(widgetType))) continue;
if (isTableColumn) { if (isTableColumn) {
// 子表列:字段类型沿用现状,硬编码 750 // 子表列:按 comType 从映射表取字段类型,未映射则回退 varchar(750)
this.saveField(750, widget.getString("showName"), null, head, columnName, extractSlaveTableId(widget)); Integer comType = widget.getInteger("comType");
this.saveField(WidgetFieldTypeMapping.isDataWidget(comType) ? comType : 750, widget.getString("showName"), null, head, columnName, extractSlaveTableId(widget));
// 子表列:已有 variableName 标签才转驼峰反写字段名,没有则不动 // 子表列:已有 variableName 标签才转驼峰反写字段名,没有则不动
if (widget.containsKey("variableName")) { if (widget.containsKey("variableName")) {
widget.put("variableName", StrUtil.toCamelCase(columnName)); widget.put("variableName", StrUtil.toCamelCase(columnName));

Loading…
Cancel
Save