Skip to content

Commit

Permalink
Fix 3.9.2 (#859)
Browse files Browse the repository at this point in the history
* fix: 字段聚合分组匹配回显问题

* fix: 明细导入无效

* fix: 表单公式:当前日期无效

* 3.9.2

* be: DbInfo
  • Loading branch information
getrebuild authored Jan 16, 2025
1 parent b08ba22 commit b2b55a4
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 32 deletions.
2 changes: 1 addition & 1 deletion @rbv
Submodule @rbv updated from 9a6c91 to e118f2
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>3.9.1</version>
<version>3.9.2</version>
<name>rebuild</name>
<description>Building your business-systems freely!</description>
<url>https://getrebuild.com/</url>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rebuild/core/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
/**
* 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
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/com/rebuild/core/metadata/MetadataHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

/**
* 实体元数据
Expand Down Expand Up @@ -427,22 +423,6 @@ public static boolean checkAndWarnField(String entityName, String fieldName) {
return checkAndWarnField(getEntity(entityName), fieldName);
}

/**
* 实体分类标签
*
* @return
*/
public static Set<String> getEntityTags() {
Set<String> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ public static int calcFormulaBackend(Record record) {
public static Object evalCalcFormula(Field targetField, Map<String, Object> 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<String> fieldVars = ContentWithFieldVars.matchsVars(formula);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,})}");

/**
* 替换文本中的字段变量
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/com/rebuild/core/support/setup/DbInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/rebuild/core/support/setup/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -324,7 +326,14 @@ public RespBody entityCopy(HttpServletRequest request) {

@GetMapping("entity/entity-tags")
public RespBody entityTags() {
return RespBody.ok(MetadataHelper.getEntityTags());
Set<String> 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")
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/web/assets/js/general/rb-forms.js
Original file line number Diff line number Diff line change
Expand Up @@ -3137,6 +3137,10 @@ class RbFormRefform extends React.Component {
this.setState({ formComponent: VFORM })
})
}

// for comp
getValue() {}
setValue() {}
}

// 确定元素类型
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b2b55a4

Please sign in to comment.