fix: Formual single-quote

This commit is contained in:
RB 2022-04-01 13:14:20 +08:00
parent 2079a425e4
commit b0329392f6
2 changed files with 12 additions and 1 deletions

View file

@ -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);
}

View file

@ -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);