feat: 增加导出运维
parent
8b138eb74a
commit
101165c42d
@ -0,0 +1,143 @@
|
|||||||
|
package com.shxy.xymanager_common.excel;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelProperty;
|
||||||
|
import com.alibaba.excel.annotation.write.style.ColumnWidth;
|
||||||
|
import com.shxy.xymanager_common.entity.MntnStatus;
|
||||||
|
import com.shxy.xymanager_common.entity.View_Dy_Line_Tower_Terminals;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class TerminalExcel {
|
||||||
|
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "出厂ID")
|
||||||
|
private String oid;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "装置编号")
|
||||||
|
private String cmdid;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "状态")
|
||||||
|
private String onlinestatus;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "最后心跳时间")
|
||||||
|
private Date lastReportTime;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "传图")
|
||||||
|
private String pic;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "规约")
|
||||||
|
private String protocolName;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "电池状态")
|
||||||
|
private String battery;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "心跳次数")
|
||||||
|
private String numberOfHb;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "心跳周期")
|
||||||
|
private String heartbeatDuration;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "CMA消息")
|
||||||
|
private String recv;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "拍照计划/实际")
|
||||||
|
private String photoTimes;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "拍照成功")
|
||||||
|
private String success;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "拍照失败")
|
||||||
|
private String failure;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "卡1信号")
|
||||||
|
private String signature1;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "卡2信号")
|
||||||
|
private String signature2;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "网络错误")
|
||||||
|
private String networkError;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "系统重启")
|
||||||
|
private String rebootTimes;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "I1重启")
|
||||||
|
private String i1RebootTimes;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "SIM卡1")
|
||||||
|
private String simcard1;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "SIM卡2")
|
||||||
|
private String simcard2;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "CMA服务器")
|
||||||
|
private String cma;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "磁盘剩余空间")
|
||||||
|
private String freeROM;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "I1版本")
|
||||||
|
private String i1Version;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "运维版本")
|
||||||
|
private String maintainVersion;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "camera版本")
|
||||||
|
private String cameraService;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "AI版本")
|
||||||
|
private String aiVersion;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "MCU版本")
|
||||||
|
private String mcu;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "装置ip")
|
||||||
|
private String lastIP;
|
||||||
|
@ColumnWidth(16)
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String comment;
|
||||||
|
|
||||||
|
public static TerminalExcel from(View_Dy_Line_Tower_Terminals term) {
|
||||||
|
TerminalExcel item = new TerminalExcel();
|
||||||
|
item.setCmdid(term.getCmdid());
|
||||||
|
if (term.getOnlinestatus() != null && term.getOnlinestatus().intValue() == 1) {
|
||||||
|
item.setOnlinestatus("在线");
|
||||||
|
} else {
|
||||||
|
item.setOnlinestatus("离线");
|
||||||
|
}
|
||||||
|
item.setProtocolName(term.getProtocolName());
|
||||||
|
|
||||||
|
MntnStatus status = term.getMntnStatus();
|
||||||
|
item.setLastReportTime(new Date(status.getRawReportTime() * 1000));
|
||||||
|
item.setLastIP(status.getLastIp());
|
||||||
|
item.setComment(status.getComment());
|
||||||
|
|
||||||
|
HashMap<String, Object> map = status.getReportMap();
|
||||||
|
item.setPic((String) map.get("pic"));
|
||||||
|
item.setBattery((String) map.get("battery"));
|
||||||
|
item.setNumberOfHb((String) map.get("numberOfHb"));
|
||||||
|
item.setHeartbeatDuration((String) map.get("heartbeatDuration"));
|
||||||
|
item.setRecv((String) map.get("recv"));
|
||||||
|
item.setPhotoTimes((String) map.get("photoTimes"));
|
||||||
|
item.setSuccess((String) map.get("success"));
|
||||||
|
item.setFailure((String) map.get("failure"));
|
||||||
|
item.setSignature1((String) map.get("signature1"));
|
||||||
|
item.setSignature2((String) map.get("signature2"));
|
||||||
|
item.setNetworkError((String) map.get("networkError"));
|
||||||
|
item.setRebootTimes((String) map.get("rebootTimes"));
|
||||||
|
item.setI1RebootTimes((String) map.get("i1RebootTimes"));
|
||||||
|
item.setSimcard1((String) map.get("simcard1"));
|
||||||
|
item.setSimcard2((String) map.get("simcard2"));
|
||||||
|
item.setCma((String) map.get("cma"));
|
||||||
|
item.setFreeROM((String) map.get("freeROM"));
|
||||||
|
item.setI1Version((String) map.get("i1Version"));
|
||||||
|
item.setMaintainVersion((String) map.get("maintainVersion"));
|
||||||
|
item.setCameraService((String) map.get("cameraService"));
|
||||||
|
item.setAiVersion((String) map.get("aiVersion"));
|
||||||
|
item.setMcu((String) map.get("mcu"));
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue