Commit 1464adcd by 春觉晓

权益合同打印文件名特殊字符替换

1 parent ef29a9b0
...@@ -2266,19 +2266,23 @@ public class ServicePackageService { ...@@ -2266,19 +2266,23 @@ public class ServicePackageService {
.concat(fileName); .concat(fileName);
} }
private String getPdfFileName(String customerName,String packageName) { private String getPdfFileName(String customerName, String packageName) {
String fileName;
if (StringUtils.isNotBlank(packageName)) { if (StringUtils.isNotBlank(packageName)) {
return customerName fileName = customerName
.concat(packageName) .concat(packageName)
.concat(UUID.randomUUID().toString().replace("-", "").substring(16)) .concat(UUID.randomUUID().toString().replace("-", "").substring(16))
.concat(".") .concat(".")
.concat("pdf"); .concat("pdf");
} else { } else {
return customerName fileName = customerName
.concat(UUID.randomUUID().toString().replace("-", "").substring(16)) .concat(UUID.randomUUID().toString().replace("-", "").substring(16))
.concat(".") .concat(".")
.concat("pdf"); .concat("pdf");
} }
//将文件命中,包含 / 的特殊字符串转为 %
fileName = fileName.replace("/","%");
return fileName;
} }
private String cutSpecialContent(String specialContent1, int spebrLen) { private String cutSpecialContent(String specialContent1, int spebrLen) {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!