|
@@ -20,6 +20,7 @@ import com.bizmatics.model.system.SysUser;
|
|
import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
import com.bizmatics.model.vo.DeviceOneVo;
|
|
import com.bizmatics.model.vo.DeviceOneVo;
|
|
|
|
+import com.bizmatics.model.vo.ProcessingTimeVo;
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
import com.bizmatics.persistence.mapper.DeviceMapper;
|
|
import com.bizmatics.service.DeviceAnalogVariableListService;
|
|
import com.bizmatics.service.DeviceAnalogVariableListService;
|
|
import com.bizmatics.service.DeviceAttributeService;
|
|
import com.bizmatics.service.DeviceAttributeService;
|
|
@@ -40,6 +41,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
import java.io.File;
|
|
import java.io.File;
|
|
import java.io.FileOutputStream;
|
|
import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -354,12 +356,14 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public String deviceExport(String deviceName, Integer deviceType, Integer siteId) {
|
|
public String deviceExport(String deviceName, Integer deviceType, Integer siteId) {
|
|
|
|
+ SimpleDateFormat longSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
Workbook workbook = null;
|
|
Workbook workbook = null;
|
|
File file = null;
|
|
File file = null;
|
|
try {
|
|
try {
|
|
ExportParams params = new ExportParams(null, "通信设备列表");
|
|
ExportParams params = new ExportParams(null, "通信设备列表");
|
|
workbook = ExcelExportUtil.exportBigExcel(params, DeviceExportVO.class,
|
|
workbook = ExcelExportUtil.exportBigExcel(params, DeviceExportVO.class,
|
|
(o, i) -> {
|
|
(o, i) -> {
|
|
|
|
+ List<DeviceOne> Active = new ArrayList<DeviceOne>();
|
|
Page<Device> page = new Page<>(i, 30);
|
|
Page<Device> page = new Page<>(i, 30);
|
|
LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<Device> queryWrapper = Wrappers.lambdaQuery();
|
|
queryWrapper.eq(Device::getEnable, 1);
|
|
queryWrapper.eq(Device::getEnable, 1);
|
|
@@ -375,8 +379,26 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
}
|
|
}
|
|
|
|
|
|
page = this.page(page, queryWrapper);
|
|
page = this.page(page, queryWrapper);
|
|
|
|
+
|
|
|
|
+ for (int j = 0; j < page.getRecords().size(); j++){
|
|
|
|
+ DeviceOne deviceOne = new DeviceOne();
|
|
|
|
+ deviceOne.setDeviceCode(page.getRecords().get(j).getDeviceCode());
|
|
|
|
+ deviceOne.setDeviceName(page.getRecords().get(j).getDeviceName());
|
|
|
|
+ deviceOne.setFloor(page.getRecords().get(j).getFloor());
|
|
|
|
+ deviceOne.setSiteId(page.getRecords().get(j).getSiteId());
|
|
|
|
+ deviceOne.setDeviceAddress(page.getRecords().get(j).getDeviceAddress());
|
|
|
|
+ deviceOne.setDeviceType(page.getRecords().get(j).getDeviceType());
|
|
|
|
+ deviceOne.setInstallTime(longSdf.format(page.getRecords().get(j).getInstallTime()));
|
|
|
|
+ deviceOne.setCreator(page.getRecords().get(j).getCreator());
|
|
|
|
+ deviceOne.setEnable(page.getRecords().get(j).getEnable());
|
|
|
|
+ deviceOne.setSim(page.getRecords().get(j).getSim());
|
|
|
|
+ deviceOne.setDeviceStatus(page.getRecords().get(j).getDeviceStatus());
|
|
|
|
+ deviceOne.setInstalledCapacity(page.getRecords().get(j).getInstalledCapacity());
|
|
|
|
+ Active.add(deviceOne);
|
|
|
|
+ }
|
|
|
|
+
|
|
// this.ToCommonPage(page);
|
|
// this.ToCommonPage(page);
|
|
- return new ArrayList<>(BeanMapperUtils.mapList(page.getRecords(), Device.class, DeviceExportVO.class));
|
|
|
|
|
|
+ return new ArrayList<>(BeanMapperUtils.mapList(Active, DeviceOne.class, DeviceExportVO.class));
|
|
}, null);
|
|
}, null);
|
|
if (null != workbook) {
|
|
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", "通信设备列表", System.currentTimeMillis() + ""));
|