|
@@ -377,15 +377,35 @@ public class RateService {
|
|
|
urls.forEach(privacy -> {
|
|
urls.forEach(privacy -> {
|
|
|
num.getAndIncrement();
|
|
num.getAndIncrement();
|
|
|
if ("doc".equals(getSuffix(privacy)) || "docx".equals(getSuffix(privacy))) {
|
|
if ("doc".equals(getSuffix(privacy)) || "docx".equals(getSuffix(privacy))) {
|
|
|
- InputStream is1 = HttpRequest.get(privacy)
|
|
|
|
|
- .stream();
|
|
|
|
|
|
|
+ InputStream is1;
|
|
|
|
|
+ if (privacy.contains("http")) {
|
|
|
|
|
+ is1 = HttpRequest.get(privacy)
|
|
|
|
|
+ .stream();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ try {
|
|
|
|
|
+ is1 = new FileInputStream(privacy);
|
|
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
|
|
+ throw new BusinessException("找不到文件");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
InputStream stream = HttpRequest.post("http://convert.izouma.com/word2pdf")
|
|
InputStream stream = HttpRequest.post("http://convert.izouma.com/word2pdf")
|
|
|
.accept("*/*")
|
|
.accept("*/*")
|
|
|
.part("file", "审核材料.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", is1)
|
|
.part("file", "审核材料.docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", is1)
|
|
|
.stream();
|
|
.stream();
|
|
|
files.add(stream);
|
|
files.add(stream);
|
|
|
} else if ("pdf".equals(getSuffix(privacy))) {
|
|
} else if ("pdf".equals(getSuffix(privacy))) {
|
|
|
- InputStream stream = HttpRequest.get(privacy).stream();
|
|
|
|
|
|
|
+ InputStream stream;
|
|
|
|
|
+ if (privacy.contains("http")) {
|
|
|
|
|
+ stream = HttpRequest.get(privacy)
|
|
|
|
|
+ .stream();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ try {
|
|
|
|
|
+ stream = new FileInputStream(privacy);
|
|
|
|
|
+ } catch (FileNotFoundException e) {
|
|
|
|
|
+ throw new BusinessException("找不到文件");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+// InputStream stream = HttpRequest.get(privacy).stream();
|
|
|
files.add(stream);
|
|
files.add(stream);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|