mirror of
https://github.com/getrebuild/rebuild.git
synced 2025-09-08 07:36:52 +08:00
Fix 3.9.4 (#865)
* 小数精度问题 * fix: 记录转换时的明细导入 * 3.9.4 * fix: Gitee#IBLGYQ * be:默认排序优化 * fixed #866 * be * fix:__isSameValue38 --------- Co-authored-by: devezhao <zhaofang123@gmail.com>
This commit is contained in:
parent
f0af100849
commit
4cf710039e
10 changed files with 42 additions and 24 deletions
2
pom.xml
2
pom.xml
|
@ -10,7 +10,7 @@
|
|||
</parent>
|
||||
<groupId>com.rebuild</groupId>
|
||||
<artifactId>rebuild</artifactId>
|
||||
<version>3.9.3</version>
|
||||
<version>3.9.4</version>
|
||||
<name>rebuild</name>
|
||||
<description>Building your business-systems freely!</description>
|
||||
<url>https://getrebuild.com/</url>
|
||||
|
|
|
@ -74,11 +74,11 @@ public class Application implements ApplicationListener<ApplicationStartedEvent>
|
|||
/**
|
||||
* Rebuild Version
|
||||
*/
|
||||
public static final String VER = "3.9.3";
|
||||
public static final String VER = "3.9.4";
|
||||
/**
|
||||
* Rebuild Build [MAJOR]{1}[MINOR]{2}[PATCH]{2}[BUILD]{2}
|
||||
*/
|
||||
public static final int BUILD = 3090308;
|
||||
public static final int BUILD = 3090409;
|
||||
|
||||
static {
|
||||
// Driver for DB
|
||||
|
|
|
@ -61,6 +61,8 @@ public class EasyDecimal extends EasyField {
|
|||
public Object wrapValue(Object value) {
|
||||
String format = StringUtils.defaultIfBlank(
|
||||
getExtraAttr(EasyFieldConfigProps.DECIMAL_FORMAT), getDisplayType().getDefaultFormat());
|
||||
// fix:3.9.4 进位模式
|
||||
value = fixedDecimalScale(value, this);
|
||||
String n = new DecimalFormat(format).format(value);
|
||||
|
||||
// 0, %, etc.
|
||||
|
|
|
@ -47,7 +47,7 @@ public class EasyFieldConfigProps {
|
|||
*/
|
||||
public static final String NUMBER_CALCFORMULA = "calcFormula";
|
||||
/**
|
||||
* 表单公式
|
||||
* 表单公式后端计算
|
||||
*/
|
||||
public static final String NUMBER_CALCFORMULABACKEND = "calcFormulaBackend";
|
||||
/**
|
||||
|
|
|
@ -7,6 +7,7 @@ See LICENSE and COMMERCIAL in the project root for license information.
|
|||
|
||||
package com.rebuild.core.service.dashboard.charts;
|
||||
|
||||
import cn.devezhao.commons.ReflectUtils;
|
||||
import cn.devezhao.persist4j.Entity;
|
||||
import cn.devezhao.persist4j.engine.ID;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
@ -93,7 +94,8 @@ public class ChartsFactory {
|
|||
} else {
|
||||
for (BuiltinChart ch : getBuiltinCharts()) {
|
||||
if (ch.getChartType().equalsIgnoreCase(type)) {
|
||||
return (ChartData) ((ChartData) ch).setUser(user);
|
||||
ChartData c = (ChartData) ReflectUtils.newObject(ch.getClass().getName());
|
||||
return (ChartData) c.setUser(user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,6 +133,11 @@ public class RecordTransfomer39 extends RecordTransfomer37 {
|
|||
TransformerPreview37.fillLabelOfReference(tansTargetRecord);
|
||||
|
||||
JSON formModel = UseFormsBuilder.buildFormWithRecord(targetEntity, tansTargetRecord, specMainId, getUser(), false);
|
||||
// fix:3.9.4 明细导入
|
||||
if (targetEntity.getDetailEntity() != null) {
|
||||
((JSONObject) formModel).put("detailImports", buildDetailImports39(targetEntity));
|
||||
}
|
||||
|
||||
if (fieldsMappingDetails == null || fieldsMappingDetails.isEmpty()) return formModel;
|
||||
|
||||
// 有明细
|
||||
|
@ -180,11 +185,6 @@ public class RecordTransfomer39 extends RecordTransfomer37 {
|
|||
|
||||
((JSONObject) formModel).put(GeneralEntityService.HAS_DETAILS, formModelDetailsMap);
|
||||
|
||||
// 明细导入
|
||||
if (targetEntity.getDetailEntity() != null) {
|
||||
((JSONObject) formModel).put("detailImports", buildDetailImports39(targetEntity));
|
||||
}
|
||||
|
||||
return formModel;
|
||||
}
|
||||
|
||||
|
|
|
@ -224,12 +224,14 @@ public class QueryParser {
|
|||
|
||||
String sortNode = queryExpr.getString("sort");
|
||||
String sortSql = null;
|
||||
if (StringUtils.isNotBlank(sortNode)) {
|
||||
sortSql = parseSort(sortNode);
|
||||
} else if (entity.containsField(EntityHelper.ModifiedOn)) {
|
||||
sortSql = EntityHelper.ModifiedOn + " desc";
|
||||
} else if (entity.containsField(EntityHelper.CreatedOn)) {
|
||||
sortSql = EntityHelper.CreatedOn + " desc";
|
||||
if (StringUtils.isNotBlank(sortNode)) sortSql = parseSort(sortNode);
|
||||
// 默认排序
|
||||
if (sortSql == null) {
|
||||
if (entity.containsField(EntityHelper.ModifiedOn)) {
|
||||
sortSql = EntityHelper.ModifiedOn + (":asc".equals(sortNode) ? " asc" : " desc");
|
||||
} else if (entity.containsField(EntityHelper.CreatedOn)) {
|
||||
sortSql = EntityHelper.CreatedOn + (":asc".equals(sortNode) ? " asc" : " desc");
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(sortSql)) fullSql.append(" order by ").append(sortSql);
|
||||
|
||||
|
@ -256,7 +258,7 @@ public class QueryParser {
|
|||
if (sort.length() < 5) return null;
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
String[] sorts = sort.split("[,;]");
|
||||
String[] sorts = sort.split("[,;]"); // 支持多个: xx:asc;xxx:desc
|
||||
for (String s : sorts) {
|
||||
String[] split = s.split(":");
|
||||
if (StringUtils.isBlank(split[0])) return null;
|
||||
|
|
|
@ -21,6 +21,7 @@ import com.rebuild.core.support.setup.Installer;
|
|||
import com.rebuild.core.support.task.TaskExecutors;
|
||||
import com.rebuild.utils.AES;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringEscapeUtils;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
import java.io.File;
|
||||
|
@ -188,7 +189,8 @@ public class AdminCli3 {
|
|||
else {
|
||||
String value = commands[2];
|
||||
if (item == ConfigurationItem.SN) {
|
||||
String usql = String.format("update system_config set `VALUE` = '%s' where `ITEM` = 'SN'", value);
|
||||
String usql = String.format("update system_config set `VALUE` = '%s' where `ITEM` = 'SN'",
|
||||
StringEscapeUtils.escapeSql(value));
|
||||
Application.getSqlExecutor().execute(usql);
|
||||
// reset: RB NEED RESTART
|
||||
Application.getCommonsCache().evict(ConfigurationItem.SN.name());
|
||||
|
|
|
@ -83,6 +83,12 @@ class RbFormModal extends React.Component {
|
|||
_handleMaximize() {
|
||||
this.setState({ _maximize: !this.state._maximize }, () => {
|
||||
$storage.set(this.__maximizeKey, this.state._maximize)
|
||||
|
||||
// be:3.9.4
|
||||
setTimeout(() => {
|
||||
const $form = this.getFormComp()._$form
|
||||
$form && $($form).parent().find('.protable').perfectScrollbar('update')
|
||||
}, 200)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -3331,10 +3337,14 @@ const __calcFormula = function (fieldComp) {
|
|||
}
|
||||
function __isSameValue38(a, b) {
|
||||
if ($same(a, b)) return true
|
||||
try {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
return parseFloat(a) == parseFloat(b)
|
||||
} catch (err) {
|
||||
// ignored
|
||||
// fix: 3.9.4
|
||||
if ($regex.isDecimal(a) && $regex.isDecimal(b)) {
|
||||
try {
|
||||
// eslint-disable-next-line eqeqeq
|
||||
return parseFloat(a) == parseFloat(b)
|
||||
} catch (err) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -193,7 +193,7 @@
|
|||
<div class="splash-footer">
|
||||
<div class="copyright link">
|
||||
©
|
||||
<th:block th:utext="${commercial < 20 ? bundle.L('[REBUILD](https://getrebuild.com/) 技术支持') : appName}" />
|
||||
<th:block th:utext="${commercial > 10 ? appName : bundle.L('[REBUILD](https://getrebuild.com/) 技术支持')}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue