mirror of
https://github.com/getrebuild/rebuild.git
synced 2024-09-20 07:25:54 +08:00
fix: Formual single-quote
This commit is contained in:
parent
2079a425e4
commit
b0329392f6
|
@ -123,15 +123,18 @@ public class AggregationEvaluator {
|
|||
|
||||
String replace = "{" + StringUtils.join(field, MetadataHelper.SPLITER) + "}";
|
||||
String replaceWhitQuote = "\"" + replace + "\"";
|
||||
String replaceWhitQuoteSingle = "'" + replace + "'";
|
||||
|
||||
if (clearFormual.contains(replaceWhitQuote)) {
|
||||
clearFormual = clearFormual.replace(replaceWhitQuote, fieldKey);
|
||||
} else if (clearFormual.contains(replaceWhitQuoteSingle)) {
|
||||
clearFormual = clearFormual.replace(replaceWhitQuoteSingle, fieldKey);
|
||||
} else if (clearFormual.contains(replace)) {
|
||||
clearFormual = clearFormual.replace(replace, fieldKey);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Object value = useSourceData[i] == null ? 0 : useSourceData[i];
|
||||
envMap.put(fieldKey, value);
|
||||
}
|
||||
|
|
|
@ -291,9 +291,15 @@ public class FieldWriteback extends FieldAggregation {
|
|||
for (String fieldName : fieldVars) {
|
||||
String replace = "{" + fieldName + "}";
|
||||
String replaceWhitQuote = "\"" + replace + "\"";
|
||||
String replaceWhitQuoteSingle = "'" + replace + "'";
|
||||
boolean forceUseQuote = false;
|
||||
|
||||
if (clearFormual.contains(replaceWhitQuote)) {
|
||||
clearFormual = clearFormual.replace(replaceWhitQuote, fieldName);
|
||||
forceUseQuote = true;
|
||||
} else if (clearFormual.contains(replaceWhitQuoteSingle)) {
|
||||
clearFormual = clearFormual.replace(replaceWhitQuoteSingle, fieldName);
|
||||
forceUseQuote = true;
|
||||
} else if (clearFormual.contains(replace)) {
|
||||
clearFormual = clearFormual.replace(replace, fieldName);
|
||||
} else {
|
||||
|
@ -313,6 +319,8 @@ public class FieldWriteback extends FieldAggregation {
|
|||
} else {
|
||||
value = StringUtils.EMPTY;
|
||||
}
|
||||
} else if (forceUseQuote) {
|
||||
value = value.toString();
|
||||
}
|
||||
|
||||
envMap.put(fieldName, value);
|
||||
|
|
Loading…
Reference in a new issue