Compare commits
2 Commits
a461733216
...
85c08ee18a
Author | SHA1 | Date |
---|---|---|
youhong.ai | 85c08ee18a | |
youhong.ai | 2450a8348e |
|
@ -200,6 +200,7 @@ public abstract class SafeCusBaseAction implements Action {
|
||||||
String billTable = requestManager.getBillTableName();
|
String billTable = requestManager.getBillTableName();
|
||||||
String id = mapper.selectIdByRequest(billTable, requestInfo.getRequestid());
|
String id = mapper.selectIdByRequest(billTable, requestInfo.getRequestid());
|
||||||
result.put("id", id);
|
result.put("id", id);
|
||||||
|
result.put("requestid", requestInfo.getRequestid());
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <h1></h1>
|
* <h1></h1>
|
||||||
|
@ -57,6 +59,11 @@ public class DownloadFileService {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
String imageFileName = docImageInfo.getImageFileName();
|
String imageFileName = docImageInfo.getImageFileName();
|
||||||
|
try {
|
||||||
|
imageFileName = URLEncoder.encode(imageFileName, "UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException ignore) {
|
||||||
|
}
|
||||||
|
|
||||||
return Response
|
return Response
|
||||||
.ok(stream)
|
.ok(stream)
|
||||||
.header("Content-Disposition", "attachment; filename=\"" + imageFileName + "\"")
|
.header("Content-Disposition", "attachment; filename=\"" + imageFileName + "\"")
|
||||||
|
|
|
@ -172,7 +172,7 @@ public class VoucherPayableNewAction extends SafeCusBaseAction {
|
||||||
}
|
}
|
||||||
headKeys = sortKey(headKeys);
|
headKeys = sortKey(headKeys);
|
||||||
for (String headKey : headKeys) {
|
for (String headKey : headKeys) {
|
||||||
sb.append(Util.null2String(heads.get(headKey)).replace(" ", " ")).append("\t");
|
sb.append(Util.null2String(heads.get(headKey)).replace("<br>", " ").replace(" ", " ")).append("\t");
|
||||||
}
|
}
|
||||||
sb.deleteCharAt(sb.lastIndexOf("\t"));
|
sb.deleteCharAt(sb.lastIndexOf("\t"));
|
||||||
sb.append("\r\n");
|
sb.append("\r\n");
|
||||||
|
@ -184,7 +184,7 @@ public class VoucherPayableNewAction extends SafeCusBaseAction {
|
||||||
try {
|
try {
|
||||||
OutputStreamWriter out = new OutputStreamWriter(
|
OutputStreamWriter out = new OutputStreamWriter(
|
||||||
Files.newOutputStream(Paths.get(filePath)), StandardCharsets.UTF_8);
|
Files.newOutputStream(Paths.get(filePath)), StandardCharsets.UTF_8);
|
||||||
out.write(sb.toString().replace(" ", " "));
|
out.write(sb.toString().replace("<br>", " ").replace(" ", " "));
|
||||||
out.close();
|
out.close();
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
Loading…
Reference in New Issue