|
|
|
@ -30,6 +30,8 @@ import java.io.File;
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import java.util.function.Supplier;
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Slf4j
|
|
|
|
@ -194,11 +196,31 @@ public class QueryTemplateProcessorImpl implements QueryTemplateProcessor {
|
|
|
|
|
// 去除回响应字符串中的特殊字符
|
|
|
|
|
if (StrUtil.isNotEmpty(queryProcessDTO.getStringContent())){
|
|
|
|
|
// 移除所有空白字符(包括空格、换行符和制表符)
|
|
|
|
|
String cleanContent = queryProcessDTO.getStringContent().replaceAll("\\s+", " ");
|
|
|
|
|
queryProcessDTO.setStringContent(cleanContent);
|
|
|
|
|
queryProcessDTO.setStringContent(cleanContent(queryProcessDTO.getStringContent()));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 清洗字符串中的特殊字符 包括不可见字符。如果单独出现一个空格,则保留
|
|
|
|
|
* @param input
|
|
|
|
|
* @return
|
|
|
|
|
*/
|
|
|
|
|
private String cleanContent(String input){
|
|
|
|
|
if (StrUtil.isEmpty(input)){
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
String regex = "\\s+";
|
|
|
|
|
Pattern pattern = Pattern.compile(regex);
|
|
|
|
|
Matcher matcher = pattern.matcher(input);
|
|
|
|
|
while (matcher.find()) {
|
|
|
|
|
String group = matcher.group();
|
|
|
|
|
if (StrUtil.isNotEmpty(group) && !group.equals(" ")){
|
|
|
|
|
input = input.replace(group, "");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private Map<String, Object> getParams(List<IrSqlParam> paramsList, List<IrSessionParam> sessionParams) {
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
|
|