Compare commits

...

2 Commits

Author SHA1 Message Date
youhong.ai 85c08ee18a Merge branch 'dev' of https://gitea.yeyaguitu.cn/ecology/ebu_ecology_dev1 into dev
hebin 保时捷文件名下载乱码,mapper更新null会变为空字符串处理
2023-06-30 15:17:52 +08:00
youhong.ai 2450a8348e 保时捷文件下载文件名乱码处理 2023-06-30 15:17:44 +08:00
3 changed files with 10 additions and 2 deletions

View File

@ -200,6 +200,7 @@ public abstract class SafeCusBaseAction implements Action {
String billTable = requestManager.getBillTableName();
String id = mapper.selectIdByRequest(billTable, requestInfo.getRequestid());
result.put("id", id);
result.put("requestid", requestInfo.getRequestid());
return result;
}

View File

@ -11,7 +11,9 @@ import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.StreamingOutput;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;
/**
* <h1></h1>
@ -57,6 +59,11 @@ public class DownloadFileService {
}
};
String imageFileName = docImageInfo.getImageFileName();
try {
imageFileName = URLEncoder.encode(imageFileName, "UTF-8");
} catch (UnsupportedEncodingException ignore) {
}
return Response
.ok(stream)
.header("Content-Disposition", "attachment; filename=\"" + imageFileName + "\"")

View File

@ -172,7 +172,7 @@ public class VoucherPayableNewAction extends SafeCusBaseAction {
}
headKeys = sortKey(headKeys);
for (String headKey : headKeys) {
sb.append(Util.null2String(heads.get(headKey)).replace("&nbsp;", " ")).append("\t");
sb.append(Util.null2String(heads.get(headKey)).replace("<br>", " ").replace("&nbsp;", " ")).append("\t");
}
sb.deleteCharAt(sb.lastIndexOf("\t"));
sb.append("\r\n");
@ -184,7 +184,7 @@ public class VoucherPayableNewAction extends SafeCusBaseAction {
try {
OutputStreamWriter out = new OutputStreamWriter(
Files.newOutputStream(Paths.get(filePath)), StandardCharsets.UTF_8);
out.write(sb.toString().replace("&nbsp;", " "));
out.write(sb.toString().replace("<br>", " ").replace("&nbsp;", " "));
out.close();
} catch (IOException e) {