1;店铺数据-复制模版 replaceAll特殊字符报错 Matcher.quoteReplacement处理

This commit is contained in:
wangshuai 2024-08-20 11:52:07 +08:00
parent dda73772cb
commit 49396391c6
1 changed files with 2 additions and 1 deletions

View File

@ -31,6 +31,7 @@ import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.regex.Matcher;
import java.util.stream.Collectors;
/**
@ -204,7 +205,7 @@ public class BusStoreInfoController extends BaseController {
String content = busTemplateInfo.getTemplateContent();
// for(BusTemplateAttrInfo busTemplateAttrInfo:busTemplateInfo.getAttrInfoList()){
// if(content.contains(busTemplateAttrInfo.getAttrValue())){
content = content.replaceAll("#name",busStoreInfo.getStoreName());
content = content.replaceAll("#name", Matcher.quoteReplacement(busStoreInfo.getStoreName()));
content = content.replaceAll("#from", "1".equals(busStoreInfo.getPlatformType())?"美团":"饿了么");
content = content.replaceAll("#date", LocalDate.now().minusDays(1).toString());
content = content.replaceAll("#count",busStoreDayInfo1.getLastOrderNum()+"");