|
@@ -17,10 +17,7 @@ import com.bizmatics.common.mvc.base.AbstractCrudService;
|
|
import com.bizmatics.common.spring.util.GlobalUtils;
|
|
import com.bizmatics.common.spring.util.GlobalUtils;
|
|
import com.bizmatics.model.*;
|
|
import com.bizmatics.model.*;
|
|
import com.bizmatics.model.system.SysUser;
|
|
import com.bizmatics.model.system.SysUser;
|
|
-import com.bizmatics.model.vo.CorrespondDeviceListVO;
|
|
|
|
-import com.bizmatics.model.vo.CorrespondDeviceVO;
|
|
|
|
-import com.bizmatics.model.vo.DeviceOneVo;
|
|
|
|
-import com.bizmatics.model.vo.ProcessingTimeVo;
|
|
|
|
|
|
+import com.bizmatics.model.vo.*;
|
|
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;
|
|
@@ -425,15 +422,35 @@ public class DeviceServiceImpl extends AbstractCrudService<DeviceMapper, Device>
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public String correspondDeviceExport(String deviceName) {
|
|
public String correspondDeviceExport(String deviceName) {
|
|
|
|
+ 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, CorrespondDeviceExportVO.class,
|
|
workbook = ExcelExportUtil.exportBigExcel(params, CorrespondDeviceExportVO.class,
|
|
(o, i) -> {
|
|
(o, i) -> {
|
|
|
|
+ List<CorrespondDeviceTwoVO> Active = new ArrayList<CorrespondDeviceTwoVO>();
|
|
int startCurrent = (i - 1) * 30;
|
|
int startCurrent = (i - 1) * 30;
|
|
List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, 30);
|
|
List<CorrespondDeviceVO> correspondDeviceList = baseMapper.CorrespondDeviceList(deviceName, startCurrent, 30);
|
|
- return new ArrayList<>(BeanMapperUtils.mapList(correspondDeviceList, CorrespondDeviceVO.class, CorrespondDeviceExportVO.class));
|
|
|
|
|
|
+ for (int j = 0; j <correspondDeviceList.size(); j++){
|
|
|
|
+ CorrespondDeviceTwoVO correspondDeviceTwoVO = new CorrespondDeviceTwoVO();
|
|
|
|
+ correspondDeviceTwoVO.setDeviceCode(correspondDeviceList.get(j).getDeviceCode());
|
|
|
|
+ correspondDeviceTwoVO.setDeviceName(correspondDeviceList.get(j).getDeviceName());
|
|
|
|
+ correspondDeviceTwoVO.setDeviceAddress(correspondDeviceList.get(j).getDeviceAddress());
|
|
|
|
+ correspondDeviceTwoVO.setInstallTime(longSdf.format(correspondDeviceList.get(j).getInstallTime()));
|
|
|
|
+ correspondDeviceTwoVO.setDeviceStatus(correspondDeviceList.get(j).getDeviceStatus());
|
|
|
|
+ correspondDeviceTwoVO.setStatusTime(longSdf.format(correspondDeviceList.get(j).getStatusTime()));
|
|
|
|
+ correspondDeviceTwoVO.setSiteId(correspondDeviceList.get(j).getSiteId());
|
|
|
|
+ correspondDeviceTwoVO.setSiteName(correspondDeviceList.get(j).getSiteName());
|
|
|
|
+ correspondDeviceTwoVO.setOfflineDuration(correspondDeviceList.get(j).getOfflineDuration());
|
|
|
|
+ correspondDeviceTwoVO.setOnlineDuration(correspondDeviceList.get(j).getOnlineDuration());
|
|
|
|
+ correspondDeviceTwoVO.setSim(correspondDeviceList.get(j).getSim());
|
|
|
|
+ correspondDeviceTwoVO.setFloor(correspondDeviceList.get(j).getFloor());
|
|
|
|
+ correspondDeviceTwoVO.setDeviceType(correspondDeviceList.get(j).getDeviceType());
|
|
|
|
+ Active.add(correspondDeviceTwoVO);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return new ArrayList<>(BeanMapperUtils.mapList(Active, CorrespondDeviceTwoVO.class, CorrespondDeviceExportVO.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() + ""));
|