package com.ruoyi.chargingPile.export; import com.ruoyi.chargingPile.api.dto.PageChargingPileListDTO; import com.ruoyi.chargingPile.api.model.TChargingPile; import com.ruoyi.chargingPile.api.vo.TChargingGunVO; import com.ruoyi.common.core.annotation.Excel; import lombok.Data; import java.math.BigDecimal; @Data public class ChargingPileExport { @Excel(name = "*设备编码", width = 25) private String code; @Excel(name = "*设备名称", width = 25) private String name; @Excel(name = "*桩号", width = 10) private String number; @Excel(name = "设备类型", width = 20, readConverterExp = "0=其他,1=直流设备,2=交流设备,3=交直流一体设备,4=无线设备,5=有序,6=V2G") private Integer type; @Excel(name = "归属电站", width = 30) private String siteName; @Excel(name = "设备合作商", width = 30) private String partnerName; @Excel(name = "生产机构代码", width = 25) private String manufacturerCode; @Excel(name = "生产商名称", width = 30) private String manufacturer; @Excel(name = "设备型号", width = 25) private String equipmentType; @Excel(name = "设备生产日期", width = 15) private String productionDate; @Excel(name = "*额定功率", width = 15) private BigDecimal ratedPower; @Excel(name = "设备充电站编号", width = 25) private String chargingStationNumber; @Excel(name = "设备唯一编码", width = 25) private String equipmentUniqueNumber; @Excel(name = "*设备分类", width = 30, readConverterExp = "1=车辆充电设备,2=换电站内的电池箱充电设备") private Integer equipmentClassification; @Excel(name = "设备经度", width = 20) private String equipmentLng; @Excel(name = "设备纬度", width = 20) private String equipmentLat; @Excel(name = "*接口编码", width = 20) private String interfaceCode; @Excel(name = "*接口名称", width = 25) private String interfaceName; @Excel(name = "*设备接口分类", width = 30, readConverterExp = "1=车辆充电设备接口,2=换电站内的电池箱充电设备接口") private Integer interfaceEquipmentClassification; @Excel(name = "*接口类型", width = 35, readConverterExp = "0=其他,1=家用插座(模式2),2=交流接口插座(模式3,连接方式B),3=交流接口插头(带枪线,模式3,连接方式C),4=直流接口枪头(带枪线,模式4),5=无线充电座") private Integer interfaceType; @Excel(name = "*接口状态", width = 20, readConverterExp = "1=离线,2=空闲,3=占用(未充电),4=占用(充电中),5=占用(已充满),6=占用(预约锁定),7=故障") private Integer interfaceStatus; @Excel(name = "*充电方式", width = 15, readConverterExp = "1=超级快充,2=快充,3=慢充") private Integer chargeMode; @Excel(name = "计费策略", width = 30) private String strategyName; @Excel(name = "*额定电压上限", width = 18) private BigDecimal upperRatedVoltage; @Excel(name = "*额定电压下限", width = 18) private BigDecimal lowerLimitOfRatedVoltage; @Excel(name = "恒功率电压上限", width = 18) private BigDecimal constantVoltageUpperLimits; @Excel(name = "恒功率电压下限", width = 18) private BigDecimal constantVoltageLowerLimits; @Excel(name = "*额定电流", width = 15) private BigDecimal ratedCurrent; @Excel(name = "恒功率电流上限", width = 18) private BigDecimal constantCurrentUpperLimits; @Excel(name = "恒功率电流下限", width = 18) private BigDecimal constantCurrentLowerLimits; @Excel(name = "*额定功率", width = 15) private BigDecimal interfaceRatedPower; @Excel(name = "车位号", width = 15) private String parkingNumber; @Excel(name = "车位状态", width = 15, readConverterExp = "0=未知,1=空闲,2=占用") private Integer parkingStatus; @Excel(name = "地锁状态", width = 15, readConverterExp = "0=未知,1=已解锁,2=已上锁") private Integer parkingLockState; @Excel(name = "*国家标准", width = 20, readConverterExp = "1=2011,2=2015,3=兼容2011和2015") private String nationalStandard; @Excel(name = "接口说明", width = 30) private String remark; @Excel(name = "辅助电源", width = 20, readConverterExp = "1=12V,2=24V,3=兼容12V和24V") private Integer auxPower; @Excel(name = "*运营状态", width = 18, readConverterExp = "0=未知,1=建设中,5=关闭下线,6=维护中,50=正常使用") private Integer operateStatus; @Excel(name = "运营时间", width = 25) private String operateHours; public static ChargingPileExport from(PageChargingPileListDTO record, TChargingPile pile, TChargingGunVO gun) { ChargingPileExport export = new ChargingPileExport(); if (pile != null) { export.setCode(pile.getCode()); export.setName(pile.getName()); export.setNumber(pile.getNumber() == null ? null : String.valueOf(pile.getNumber())); export.setType(pile.getType()); export.setManufacturerCode(pile.getManufacturerCode()); export.setManufacturer(pile.getManufacturer()); export.setEquipmentType(pile.getEquipmentType()); export.setProductionDate(pile.getProductionDate() == null ? null : pile.getProductionDate().toString()); export.setRatedPower(pile.getRatedPower()); export.setChargingStationNumber(pile.getChargingStationNumber()); export.setEquipmentUniqueNumber(pile.getEquipmentUniqueNumber()); export.setEquipmentClassification(pile.getEquipmentClassification()); export.setEquipmentLng(pile.getEquipmentLng()); export.setEquipmentLat(pile.getEquipmentLat()); } else if (record != null) { export.setCode(record.getCode()); export.setName(record.getName()); export.setNumber(record.getNumber()); export.setType(record.getType()); export.setManufacturer(record.getManufacturer()); export.setEquipmentType(record.getEquipmentType()); export.setRatedPower(record.getRatedPower()); } if (record != null) { export.setSiteName(record.getSiteName()); export.setPartnerName(record.getPartnerName()); } if (gun != null) { export.setInterfaceCode(gun.getCode()); export.setInterfaceName(gun.getName()); export.setInterfaceEquipmentClassification(gun.getEquipmentClassification()); export.setInterfaceType(gun.getType()); export.setInterfaceStatus(gun.getStatus()); export.setChargeMode(gun.getChargeMode()); export.setStrategyName(gun.getStrategyName()); export.setUpperRatedVoltage(gun.getUpperRatedVoltage()); export.setLowerLimitOfRatedVoltage(gun.getLowerLimitOfRatedVoltage()); export.setConstantVoltageUpperLimits(gun.getConstantVoltageUpperLimits()); export.setConstantVoltageLowerLimits(gun.getConstantVoltageLowerLimits()); export.setRatedCurrent(gun.getRatedCurrent()); export.setConstantCurrentUpperLimits(gun.getConstantCurrentUpperLimits()); export.setConstantCurrentLowerLimits(gun.getConstantCurrentLowerLimits()); export.setInterfaceRatedPower(gun.getRatedPower()); export.setParkingNumber(gun.getParkingNumber()); export.setParkingStatus(gun.getParkingStatus()); export.setParkingLockState(gun.getParkingLockState()); export.setNationalStandard(gun.getNationalStandard()); export.setRemark(gun.getRemark()); export.setAuxPower(gun.getAuxPower()); export.setOperateStatus(gun.getOpreateStatus()); export.setOperateHours(gun.getOpreateHours()); } return export; } }