forked from dyf/fys-Multi-tenant
导出电子围栏列表
This commit is contained in:
@ -59,9 +59,15 @@ public class DeviceGeoFenceController extends BaseController {
|
|||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(DeviceGeoFenceBo bo, HttpServletResponse response) {
|
public void export(DeviceGeoFenceBo bo, HttpServletResponse response) {
|
||||||
List<DeviceGeoFenceVo> list = deviceGeoFenceService.queryList(bo);
|
List<DeviceGeoFenceVo> list = deviceGeoFenceService.queryList(bo);
|
||||||
|
// 设置区域类型名称
|
||||||
|
list.forEach(item -> {
|
||||||
|
item.setAreaTypeNameByAreaType();
|
||||||
|
item.setIsActiveNameByIsActive(); // 添加这行来设置激活状态名称
|
||||||
|
});
|
||||||
ExcelUtil.exportExcel(list, "电子围栏", DeviceGeoFenceVo.class, response);
|
ExcelUtil.exportExcel(list, "电子围栏", DeviceGeoFenceVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取电子围栏详细信息
|
* 获取电子围栏详细信息
|
||||||
*
|
*
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.fuyuanshen.equipment.domain.vo;
|
package com.fuyuanshen.equipment.domain.vo;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
import cn.idev.excel.annotation.ExcelProperty;
|
import cn.idev.excel.annotation.ExcelProperty;
|
||||||
@ -15,7 +16,6 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 电子围栏视图对象 device_geo_fence
|
* 电子围栏视图对象 device_geo_fence
|
||||||
*
|
*
|
||||||
@ -33,7 +33,7 @@ public class DeviceGeoFenceVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 围栏唯一标识
|
* 围栏唯一标识
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "围栏唯一标识")
|
// @ExcelProperty(value = "围栏唯一标识")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -42,22 +42,22 @@ public class DeviceGeoFenceVo implements Serializable {
|
|||||||
@ExcelProperty(value = "围栏名称")
|
@ExcelProperty(value = "围栏名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/**
|
|
||||||
* 围栏描述
|
|
||||||
*/
|
|
||||||
@ExcelProperty(value = "围栏描述")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 围栏区域类型, 0 POLYGON, 1 CIRCLE
|
* 围栏区域类型, 0 POLYGON, 1 CIRCLE
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "围栏区域类型, 0 POLYGON, 1 CIRCLE")
|
// @ExcelProperty(value = "围栏区域类型")
|
||||||
private Integer areaType;
|
private Integer areaType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏区域类型, 0 POLYGON 多边形, 1 CIRCLE 圆形
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "围栏区域类型")
|
||||||
|
private String areaTypeName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 围栏坐标数据
|
* 围栏坐标数据
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "围栏坐标数据")
|
// @ExcelProperty(value = "围栏坐标数据")
|
||||||
private String coordinates;
|
private String coordinates;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -69,26 +69,78 @@ public class DeviceGeoFenceVo implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 是否激活
|
* 是否激活
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "是否激活")
|
// @ExcelProperty(value = "是否激活")
|
||||||
private Long isActive;
|
private Long isActive;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 激活状态名称
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "是否激活")
|
||||||
|
private String isActiveName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 围栏描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "围栏描述")
|
||||||
|
private String description;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建人
|
* 创建人
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "创建人")
|
// @ExcelProperty(value = "创建人")
|
||||||
private Long createBy;
|
private Long createBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建时间
|
* 创建时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "创建时间")
|
// @ExcelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新时间
|
* 更新时间
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "更新时间")
|
// @ExcelProperty(value = "更新时间")
|
||||||
private Date updateTime;
|
private Date updateTime;
|
||||||
|
|
||||||
|
|
||||||
|
public void setAreaTypeNameByAreaType() {
|
||||||
|
if (this.areaType != null) {
|
||||||
|
switch (this.areaType) {
|
||||||
|
case 0:
|
||||||
|
this.areaTypeName = "多边形";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.areaTypeName = "圆形";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.areaTypeName = "未知";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.areaTypeName = "未知";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public void setIsActiveNameByIsActive() {
|
||||||
|
if (this.isActive != null) {
|
||||||
|
switch (this.isActive.intValue()) {
|
||||||
|
case 0:
|
||||||
|
this.isActiveName = "未激活";
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
this.isActiveName = "已激活";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
this.isActiveName = "未知";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
this.isActiveName = "未知";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user