生成文件自定义文件名称
This commit is contained in:
@@ -32,5 +32,5 @@ public interface CommMonitorEventReportService {
|
||||
* @param index
|
||||
* @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
|
||||
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();
|
||||
for (String index : eventIndex) {
|
||||
RmpEventDetailPO detail = rmpEventDetailMapper.selectById(index);
|
||||
@@ -709,7 +709,12 @@ public class CommMonitorEventReportServiceImpl implements CommMonitorEventReport
|
||||
}
|
||||
try {
|
||||
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;
|
||||
} catch (IOException | InvalidFormatException e) {
|
||||
throw new RuntimeException(e);
|
||||
|
||||
Reference in New Issue
Block a user