|
@@ -9,7 +9,6 @@ import com.diagbot.enums.RedisEnum;
|
|
|
import com.diagbot.enums.TypeEnum;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
-
|
|
|
import java.util.Map;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
|
|
@@ -70,9 +69,9 @@ public class MsgNewUtil {
|
|
|
|
|
|
// 放到最后统一替换【多处匹配】
|
|
|
msg = msg.replace("[匹配内容]", content);
|
|
|
- String orderNameNew = orderName.replace("\\", "\\"); // 防止开单名称中有\\
|
|
|
- msg = msg.replace("[开单名称]", orderNameNew);
|
|
|
+ msg = msg.replace("[开单名称]", orderName);
|
|
|
msg = msg.replace("[项目名称]", structName);
|
|
|
+
|
|
|
billMsg.setMsg(msg);
|
|
|
billMsg.setOrderName(orderName);
|
|
|
billMsg.setOrderStandName(orderStandName);
|
|
@@ -203,11 +202,11 @@ public class MsgNewUtil {
|
|
|
return msg;
|
|
|
}
|
|
|
if (msg.contains(placeholder)) {
|
|
|
- String s = placeholderMap.get(placeholder);
|
|
|
+ String prefixAndSuffix = placeholderMap.get(placeholder); // 前后缀,中间用#分隔
|
|
|
String prefix = ""; // 前缀
|
|
|
String suffix = ""; // 后缀
|
|
|
- if (StringUtil.isNotBlank(s)) {
|
|
|
- String[] split = s.split(CommonEnum.splitSymbol.getName());
|
|
|
+ if (StringUtil.isNotBlank(prefixAndSuffix)) {
|
|
|
+ String[] split = prefixAndSuffix.split(CommonEnum.splitSymbol.getName());
|
|
|
prefix = split[0];
|
|
|
if (split.length == 2) {
|
|
|
suffix = split[1];
|
|
@@ -215,13 +214,18 @@ public class MsgNewUtil {
|
|
|
suffix = "";
|
|
|
}
|
|
|
}
|
|
|
+ // 拼接前缀
|
|
|
if (StringUtil.isNotBlank(prefix)) {
|
|
|
replaceStr = prefix + replaceStr;
|
|
|
}
|
|
|
+ // 拼接后缀
|
|
|
if (StringUtil.isNotBlank(suffix)) {
|
|
|
replaceStr = replaceStr + suffix;
|
|
|
}
|
|
|
+ // 后缀后面默认添加标点符号
|
|
|
+ replaceStr = replaceStr + ",";
|
|
|
msg = msg.replace(placeholder, replaceStr);
|
|
|
+ // 提示语如果以,结尾,去掉
|
|
|
if (msg.matches(".*[,|,]$")) {
|
|
|
msg = msg.substring(0, msg.length() - 1);
|
|
|
}
|