|
@@ -26,6 +26,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
+import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
@@ -209,6 +210,7 @@ public class AlarmPowerServiceImpl extends AbstractCrudService<AlarmPowerMapper,
|
|
|
|
|
|
@Override
|
|
|
public String export(Date startTime, Date endTime, Integer status, Integer siteId) {
|
|
|
+ DateFormat dFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Integer userId = SecurityUtils.getLoginUser().getUser().getUserId().intValue();
|
|
|
Workbook workbook = null;
|
|
|
File file = null;
|
|
@@ -221,7 +223,7 @@ public class AlarmPowerServiceImpl extends AbstractCrudService<AlarmPowerMapper,
|
|
|
return new ArrayList<>(BeanMapperUtils.mapList(page.getRecords(), AlarmPower.class, AlarmPowerExportVO.class));
|
|
|
}, null);
|
|
|
if (null != workbook) {
|
|
|
- file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "电力告警", System.currentTimeMillis() + ""));
|
|
|
+ file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "电力告警", dFormat.format(System.currentTimeMillis()) + ""));
|
|
|
FileUtils.createFile(file.getAbsolutePath());
|
|
|
FileOutputStream allListingFileOutputStream = new FileOutputStream(file);
|
|
|
workbook.write(allListingFileOutputStream);
|