diff --git a/@rbv b/@rbv index 9a6c91abe..e118f286f 160000 --- a/@rbv +++ b/@rbv @@ -1 +1 @@ -Subproject commit 9a6c91abe293077d0ef39b7b22834ba9bd22add8 +Subproject commit e118f286f0688d3c83bfcd497ffcd1920d4b1f97 diff --git a/pom.xml b/pom.xml index 96b6c7550..7b5dd34c4 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.rebuild rebuild - 3.9.1 + 3.9.2 rebuild Building your business-systems freely! https://getrebuild.com/ diff --git a/src/main/java/com/rebuild/core/Application.java b/src/main/java/com/rebuild/core/Application.java index de6396687..3523df0be 100644 --- a/src/main/java/com/rebuild/core/Application.java +++ b/src/main/java/com/rebuild/core/Application.java @@ -74,11 +74,11 @@ public class Application implements ApplicationListener /** * Rebuild Version */ - public static final String VER = "3.9.1"; + public static final String VER = "3.9.2"; /** * Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2} */ - public static final int BUILD = 3090106; + public static final int BUILD = 3090207; static { // Driver for DB diff --git a/src/main/java/com/rebuild/core/metadata/MetadataHelper.java b/src/main/java/com/rebuild/core/metadata/MetadataHelper.java index 71243fd2e..83fc22823 100644 --- a/src/main/java/com/rebuild/core/metadata/MetadataHelper.java +++ b/src/main/java/com/rebuild/core/metadata/MetadataHelper.java @@ -17,7 +17,6 @@ import com.rebuild.core.Application; import com.rebuild.core.metadata.easymeta.EasyMetaFactory; import com.rebuild.core.metadata.impl.DynamicMetadataFactory; -import com.rebuild.core.metadata.impl.EasyEntityConfigProps; import com.rebuild.core.metadata.impl.GhostEntity; import com.rebuild.core.support.i18n.Language; import com.rebuild.utils.CommonsUtils; @@ -27,10 +26,7 @@ import org.springframework.util.Assert; import java.util.ArrayList; -import java.util.Collections; import java.util.List; -import java.util.Set; -import java.util.TreeSet; /** * 实体元数据 @@ -427,22 +423,6 @@ public static boolean checkAndWarnField(String entityName, String fieldName) { return checkAndWarnField(getEntity(entityName), fieldName); } - /** - * 实体分类标签 - * - * @return - */ - public static Set getEntityTags() { - Set set = new TreeSet<>(); - for (Entity entity : getEntities()) { - String tags = EasyMetaFactory.valueOf(entity).getExtraAttr(EasyEntityConfigProps.TAGS); - if (StringUtils.isNotBlank(tags)) { - Collections.addAll(set, tags.split(",")); - } - } - return set; - } - /** * @param idtext * @param entityCode diff --git a/src/main/java/com/rebuild/core/support/general/CalcFormulaSupport.java b/src/main/java/com/rebuild/core/support/general/CalcFormulaSupport.java index 1bb3787b0..1977dc605 100644 --- a/src/main/java/com/rebuild/core/support/general/CalcFormulaSupport.java +++ b/src/main/java/com/rebuild/core/support/general/CalcFormulaSupport.java @@ -107,7 +107,8 @@ public static int calcFormulaBackend(Record record) { public static Object evalCalcFormula(Field targetField, Map varsInFormula) { final Entity entity = targetField.getOwnEntity(); final EasyField easyField = EasyMetaFactory.valueOf(targetField); - final String formula = easyField.getExtraAttr(EasyFieldConfigProps.NUMBER_CALCFORMULA); + String formula = easyField.getExtraAttr(EasyFieldConfigProps.NUMBER_CALCFORMULA); + formula = formula.replace("{{NOW}}", EasyDateTime.VAR_NOW); boolean calcReady = true; Set fieldVars = ContentWithFieldVars.matchsVars(formula); diff --git a/src/main/java/com/rebuild/core/support/general/ContentWithFieldVars.java b/src/main/java/com/rebuild/core/support/general/ContentWithFieldVars.java index d26ebb499..5fbcec80e 100644 --- a/src/main/java/com/rebuild/core/support/general/ContentWithFieldVars.java +++ b/src/main/java/com/rebuild/core/support/general/ContentWithFieldVars.java @@ -41,7 +41,7 @@ public class ContentWithFieldVars { /** * 通过 `{}` 包裹的变量或字段 */ - public static final Pattern PATT_VAR = Pattern.compile("\\{([0-9a-zA-Z._$]{4,})}"); + public static final Pattern PATT_VAR = Pattern.compile("\\{([0-9a-zA-Z._$]{3,})}"); /** * 替换文本中的字段变量 diff --git a/src/main/java/com/rebuild/core/support/setup/DbInfo.java b/src/main/java/com/rebuild/core/support/setup/DbInfo.java index a877860ac..14942ed89 100644 --- a/src/main/java/com/rebuild/core/support/setup/DbInfo.java +++ b/src/main/java/com/rebuild/core/support/setup/DbInfo.java @@ -32,9 +32,18 @@ public boolean isMySQL56() { return desc.contains("5.6."); } - public boolean isMySQL80() { + public boolean isMySQL8x() { if (isOceanBase()) return false; - return desc.contains("8.0.") || desc.contains("8.1."); + return desc.startsWith("8."); + } + + public boolean isMySQL9x() { + if (isOceanBase()) return false; + return desc.startsWith("9."); + } + + public String getDesc() { + return desc; } /** diff --git a/src/main/java/com/rebuild/core/support/setup/Installer.java b/src/main/java/com/rebuild/core/support/setup/Installer.java index 8a2a6e3b2..89b457f71 100644 --- a/src/main/java/com/rebuild/core/support/setup/Installer.java +++ b/src/main/java/com/rebuild/core/support/setup/Installer.java @@ -114,7 +114,7 @@ public void install() throws Exception { if (dbInfo.isOceanBase()) { installProps.put("db.type", "OceanBase"); - } else if (dbInfo.isMySQL80()) { + } else if (dbInfo.isMySQL8x() || dbInfo.isMySQL9x()) { // https://www.cnblogs.com/lusaisai/p/13372763.html String dbUrl8 = installProps.getProperty("db.url"); if (!dbUrl8.contains("allowPublicKeyRetrieval")) dbUrl8 += "&allowPublicKeyRetrieval=true"; @@ -355,7 +355,7 @@ public DbInfo getDbInfo() { try (Connection conn = getConnection("mysql")) { try (Statement stmt = conn.createStatement()) { - try (ResultSet rs = stmt.executeQuery("select version()")) { + try (ResultSet rs = stmt.executeQuery("SELECT VERSION()")) { if (rs.next()) return new DbInfo(rs.getString(1)); } } diff --git a/src/main/java/com/rebuild/web/admin/metadata/MetaEntityController.java b/src/main/java/com/rebuild/web/admin/metadata/MetaEntityController.java index 7156382ea..a447ddff7 100644 --- a/src/main/java/com/rebuild/web/admin/metadata/MetaEntityController.java +++ b/src/main/java/com/rebuild/web/admin/metadata/MetaEntityController.java @@ -59,11 +59,13 @@ import java.io.File; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.TreeSet; /** * @author Zixin (RB) @@ -324,7 +326,14 @@ public RespBody entityCopy(HttpServletRequest request) { @GetMapping("entity/entity-tags") public RespBody entityTags() { - return RespBody.ok(MetadataHelper.getEntityTags()); + Set set = new TreeSet<>(); + for (Entity entity : MetadataHelper.getEntities()) { + String tags = EasyMetaFactory.valueOf(entity).getExtraAttr(EasyEntityConfigProps.TAGS); + if (StringUtils.isNotBlank(tags)) { + Collections.addAll(set, tags.split(",")); + } + } + return RespBody.ok(set); } @GetMapping("entities/sheet") diff --git a/src/main/resources/web/assets/js/general/rb-forms.js b/src/main/resources/web/assets/js/general/rb-forms.js index 830e6d783..2c47dc13b 100644 --- a/src/main/resources/web/assets/js/general/rb-forms.js +++ b/src/main/resources/web/assets/js/general/rb-forms.js @@ -3137,6 +3137,10 @@ class RbFormRefform extends React.Component { this.setState({ formComponent: VFORM }) }) } + + // for comp + getValue() {} + setValue() {} } // 确定元素类型 diff --git a/src/main/resources/web/assets/js/trigger/trigger.FIELDAGGREGATION.js b/src/main/resources/web/assets/js/trigger/trigger.FIELDAGGREGATION.js index c3962deb6..5a12e613b 100644 --- a/src/main/resources/web/assets/js/trigger/trigger.FIELDAGGREGATION.js +++ b/src/main/resources/web/assets/js/trigger/trigger.FIELDAGGREGATION.js @@ -360,7 +360,9 @@ class ContentFieldAggregation extends ActionContentSpec { if (content) { this.setState({ items: content.items || [] }) if (content.targetEntityMatchFields) { - this._MatchFields && this._MatchFields.setState({ groupFields: content.targetEntityMatchFields }) + setTimeout(() => { + this._MatchFields && this._MatchFields.setState({ groupFields: content.targetEntityMatchFields }) + }, 200) } $(this._$fillbackField) .val(content.fillbackField || null)