hotfix: ALWAYS_PARSE_INTEGRAL_NUMBER_INTO_DECIMAL

This commit is contained in:
RB 2024-04-25 12:02:56 +08:00
parent d35dd2c7b8
commit 2ab6fd9b73

View file

@ -47,6 +47,7 @@ import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.BooleanUtils;
import org.apache.commons.lang.StringUtils;
import java.math.BigDecimal;
import java.text.MessageFormat;
import java.util.ArrayList;
import java.util.Collections;
@ -456,7 +457,7 @@ public class FieldWriteback extends FieldAggregation {
// 数字字段置 `0`
if (varField != null
&& (varField.getType() == FieldType.LONG || varField.getType() == FieldType.DECIMAL)) {
value = 0;
value = 0L;
} else if (fieldVarsN2NPath.contains(fieldName)
|| (isN2NField != null && isN2NField.getType() == FieldType.REFERENCE_LIST)) {
// Keep NULL
@ -477,6 +478,10 @@ public class FieldWriteback extends FieldAggregation {
value = value.toString();
}
// v3.6.3 强制使用 BigDecimal 高精度
if (value instanceof Long) value = BigDecimal.valueOf((Long) value);
else if (value instanceof Integer) value = BigDecimal.valueOf((Integer) value);
envMap.put(fieldName, value);
}