支付title 字符串过滤
This commit is contained in:
@@ -12,6 +12,8 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 字串工具类
|
||||
@@ -250,6 +252,18 @@ public class StringUtils extends StrUtil {
|
||||
}
|
||||
return str.concat(appendStr);
|
||||
}
|
||||
|
||||
/**
|
||||
* 过滤特殊字符串
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static String filterSpecialChart(String str){
|
||||
String regEx="[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~!@#¥%……&*()——+|{}【】‘;:”“’。,、?]";
|
||||
Pattern p = Pattern.compile(regEx);
|
||||
Matcher m = p.matcher(str);
|
||||
return m.replaceAll("").trim();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package cn.lili.modules.payment.kit.params.dto;
|
||||
|
||||
import cn.lili.common.utils.StringUtils;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
@@ -41,4 +42,11 @@ public class CashierParam {
|
||||
|
||||
@ApiModelProperty(value = "剩余余额")
|
||||
private Double walletValue;
|
||||
|
||||
public String getDetail() {
|
||||
if (StringUtils.isEmpty(detail)) {
|
||||
return "清单详细";
|
||||
}
|
||||
return StringUtils.filterSpecialChart(detail);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user