生成文件自定义文件名称
This commit is contained in:
@@ -32,5 +32,5 @@ public interface CommMonitorEventReportService {
|
|||||||
* @param index
|
* @param index
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
String saveStableEventReport(List<String> index, Map<String, AreaLineInfoVO> map);
|
String saveStableEventReport(List<String> index, Map<String, AreaLineInfoVO> map, String fileName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String saveStableEventReport(List<String> eventIndex, Map<String, AreaLineInfoVO> map) {
|
public String saveStableEventReport(List<String> eventIndex, Map<String, AreaLineInfoVO> map, String fileName) {
|
||||||
WordUtil wordUtil = new WordUtil();
|
WordUtil wordUtil = new WordUtil();
|
||||||
for (String index : eventIndex) {
|
for (String index : eventIndex) {
|
||||||
RmpEventDetailPO detail = rmpEventDetailMapper.selectById(index);
|
RmpEventDetailPO detail = rmpEventDetailMapper.selectById(index);
|
||||||
@@ -709,7 +709,12 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
InputStream inputStream = wordUtil.createReport2(eventIndex);
|
InputStream inputStream = wordUtil.createReport2(eventIndex);
|
||||||
String filePath = fileStorageUtil.uploadStream(inputStream, OssPath.APP_EVENT_REPORT, "暂降事件报告.docx");
|
String filePath;
|
||||||
|
if (Objects.isNull(fileName)) {
|
||||||
|
filePath = fileStorageUtil.uploadStream(inputStream, OssPath.APP_EVENT_REPORT, null);
|
||||||
|
} else {
|
||||||
|
filePath = fileStorageUtil.uploadStreamSpecifyName(inputStream, OssPath.APP_EVENT_REPORT, fileName);
|
||||||
|
}
|
||||||
return filePath;
|
return filePath;
|
||||||
} catch (IOException | InvalidFormatException e) {
|
} catch (IOException | InvalidFormatException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|||||||
Reference in New Issue
Block a user