0
0

导入导出设备数据

This commit is contained in:
2025-09-23 13:56:34 +08:00
parent e2821566c8
commit 89f08c2d91
11 changed files with 168 additions and 68 deletions

View File

@ -19,24 +19,28 @@ import java.net.URL;
@ContentRowHeight(100) // 内容行高
public class DeviceExcelExportDTO {
@ExcelProperty("ID")
private Long id;
// @ExcelProperty("ID")
// private Long id;
@ExcelProperty("设备类型")
private Long deviceType;
@ColumnWidth(20)
private String typeName;
// @ExcelProperty("设备类型")
// private Long deviceType;
// @ExcelProperty("客户号")
// private Long customerId;
@ExcelProperty("所属客户")
private String customerName;
// @ExcelProperty("所属客户")
// private String customerName;
@ExcelProperty("设备名称")
@ColumnWidth(20)
private String deviceName;
@ExcelProperty(value = "设备图片", converter = IgnoreFailedImageConverter.class)
@ColumnWidth(15) // 设置图片列宽度
@ColumnWidth(30) // 设置图片列宽度
private URL devicePic; // 使用URL类型
@ExcelProperty("设备MAC")
@ -51,28 +55,24 @@ public class DeviceExcelExportDTO {
@ColumnWidth(20)
private String deviceImei;
@ExcelProperty("经度")
private String longitude;
// @ExcelProperty("经度")
// private String longitude;
@ExcelProperty("纬度")
private String latitude;
// @ExcelProperty("纬度")
// private String latitude;
@ExcelProperty("备注")
@ColumnWidth(30)
private String remark;
@ExcelProperty("设备类型名称")
@ColumnWidth(20)
private String typeName;
/**
* 设备状态
* 0 失效
* 1 正常
*/
@ExcelProperty("设备状态")
@ColumnWidth(20)
private String deviceStatus;
// @ExcelProperty("设备状态")
// @ColumnWidth(20)
// private String deviceStatus;
@ExcelProperty("创建时间")
@ColumnWidth(20)

View File

@ -16,24 +16,24 @@ import lombok.Data;
@ContentRowHeight(100) // 内容行高
public class DeviceExcelImportDTO {
@ExcelProperty("设备类型")
private Long deviceType;
@ExcelProperty("客户号")
private Long customerId;
// @ExcelProperty("设备类型")
// private Long deviceType;
@ExcelProperty("设备名称")
@ColumnWidth(20)
private String deviceName;
@ExcelProperty(value = "设备图片", converter = ByteArrayImageConverter.class)
@ColumnWidth(15)
private byte[] devicePic;
@ExcelProperty("设备类型名称")
private String typeName;
// 添加图片写入方法
public void setDevicePicFromBytes(byte[] bytes) {
this.devicePic = bytes;
}
// @ExcelProperty(value = "设备图片", converter = ByteArrayImageConverter.class)
// @ColumnWidth(15)
// private byte[] devicePic;
//
// // 添加图片写入方法
// public void setDevicePicFromBytes(byte[] bytes) {
// this.devicePic = bytes;
// }
@ExcelProperty("设备MAC")
@ColumnWidth(20)
@ -43,24 +43,21 @@ public class DeviceExcelImportDTO {
@ColumnWidth(20)
private String deviceImei;
@ExcelProperty("设备SN")
@ColumnWidth(20)
private String deviceSn;
@ExcelProperty("蓝牙名称")
private String bluetoothName;
@ExcelProperty("经度")
private String longitude;
@ExcelProperty("纬度")
private String latitude;
// @ExcelProperty("设备SN")
// @ColumnWidth(20)
// private String deviceSn;
//
// @ExcelProperty("经度")
// private String longitude;
//
// @ExcelProperty("纬度")
// private String latitude;
@ExcelProperty("备注")
@ColumnWidth(30)
private String remark;
@ExcelProperty("设备类型名称")
private String typeName;
@ExcelProperty("蓝牙名称")
private String bluetoothName;
}

View File

@ -43,7 +43,6 @@ public class DeviceForm {
@Schema(title = "蓝牙名称")
private String bluetoothName;
@Schema(title = "设备IMEI")
private String deviceImei;

View File

@ -90,13 +90,13 @@ public class DeviceAlarmVo implements Serializable {
* 经度
*/
@ExcelProperty(value = "经度")
private Long longitude;
private Double longitude;
/**
* 纬度
*/
@ExcelProperty(value = "纬度")
private Long latitude;
private Double latitude;
/**
* 报警位置

View File

@ -77,13 +77,13 @@ public class DeviceFenceAccessRecordVo implements Serializable {
* 纬度
*/
@ExcelProperty(value = "纬度")
private Long latitude;
private Double latitude;
/**
* 经度
*/
@ExcelProperty(value = "经度")
private Long longitude;
private Double longitude;
/**
* 定位精度