|
@@ -40,6 +40,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.io.File;
|
|
|
import java.io.FileOutputStream;
|
|
|
import java.io.IOException;
|
|
|
+import java.text.DateFormat;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
@@ -355,6 +356,7 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
|
|
|
@Override
|
|
|
public String deviceExport(String deviceName, Integer deviceType, Integer siteId) {
|
|
|
+ DateFormat dFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
|
|
|
SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Workbook workbook = null;
|
|
|
File file = null;
|
|
@@ -400,7 +402,7 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
return new ArrayList<>(BeanMapperUtils.mapList(Active, DeviceOne.class, DeviceExportVO.class));
|
|
|
}, null);
|
|
|
if (null != workbook) {
|
|
|
- file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "通信设备列表", longSdf.format(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);
|
|
@@ -424,6 +426,7 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
|
|
|
@Override
|
|
|
public String correspondDeviceExport(String deviceName) {
|
|
|
+ DateFormat dFormat = new SimpleDateFormat("yyyy年MM月dd日 HH时mm分ss秒");
|
|
|
SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
Workbook workbook = null;
|
|
|
File file = null;
|
|
@@ -454,7 +457,7 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
return new ArrayList<>(BeanMapperUtils.mapList(Active, CorrespondDeviceTwoVO.class, CorrespondDeviceExportVO.class));
|
|
|
}, null);
|
|
|
if (null != workbook) {
|
|
|
- file = FileUtils.getFile(GlobalUtils.getTempBaseDir(), String.format("%s-%s.xlsx", "通信设备列表", longSdf.format(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);
|