Commit 4097773a by 叶立庆

【+】枚举完善

1 parent 2e73bcf5
...@@ -3,6 +3,11 @@ package cn.com.glsx.evbusiness.modules.enums; ...@@ -3,6 +3,11 @@ package cn.com.glsx.evbusiness.modules.enums;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Getter; import lombok.Getter;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/** /**
* @Description 硬件故障 * @Description 硬件故障
* @Author yelq * @Author yelq
...@@ -13,20 +18,31 @@ import lombok.Getter; ...@@ -13,20 +18,31 @@ import lombok.Getter;
@Getter @Getter
public enum HardwareFaultEnums { public enum HardwareFaultEnums {
BIT1(1, "急停按钮动作故障"), BIT1(1, "急停按钮动作故障"),
BIT2(3, "无可用整流模块"), BIT2(2, "无可用整流模块"),
BIT3(7, "出风口温度过高"), BIT3(4, "出风口温度过高"),
BIT4(15, "交流防雷故障"), BIT4(8, "交流防雷故障"),
BIT5(31, "交直流模块DC20通信中断"), BIT5(16, "交直流模块DC20通信中断"),
BIT6(63, "绝缘检测模块FC08通信中断"), BIT6(32, "绝缘检测模块FC08通信中断"),
BIT7(127, "电度表通信中断"), BIT7(64, "电度表通信中断"),
BIT8(255, "读卡器通信中断"), BIT8(128, "读卡器通信中断"),
BIT9(511, "RC10通信中断"), BIT9(256, "RC10通信中断"),
BIT10(1023, "风扇调速板故障"), BIT10(512, "风扇调速板故障"),
BIT11(2047, "直流熔断器故障"), BIT11(1024, "直流熔断器故障"),
BIT12(4095, "高压接触器故障"), BIT12(2048, "高压接触器故障"),
BIT13(8191, "门打开"); BIT13(4096, "门打开");
private Integer code;
private String msg;
public static String getMsgByCode(Integer code) {
List<HardwareFaultEnums> collect = Arrays.stream(HardwareFaultEnums.values()).collect(Collectors.toList());
for (HardwareFaultEnums hardwareFaultEnums : collect) {
if (Objects.equals(code, hardwareFaultEnums.getCode())) {
return hardwareFaultEnums.getMsg();
}
private Integer code; }
private String msg; return null;
}
} }
package cn.com.glsx.evbusiness.modules.model.ocpp16;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import java.io.Serializable;
/**
* 充电桩登录上报数据
*
* @author kome
* @date 2023年11月1日 下午6:00:39
*/
@Getter
@Setter
@ToString
public class LoginUploadData implements Serializable {
/**
* 充电桩id: BCD 码 ,不足 7 位补 0
*/
private String pileId;
/**
* 0 表示直流桩,1 表示交流桩
*/
private byte pointType;
/**
* 充电枪数量
*/
private byte gunCount;
/**
* 通信协议版本 BIN 码 1 版本号乘 10,v1.0 表示 0x0A
*/
private byte protocolVersion;
/**
* 程序版本 ASCII 码 8 不足 8 位补零
*/
private String softVersion;
/**
* 网络链接类型
* 0x00 SIM 卡
* 0x01 LAN
* 0x02 WAN
* 0x03 其他
*/
private byte network;
/**
* Sim 卡 BCD 码 10 不足 10 位补零,取不到置零
*/
private String sim;
/**
* 运营商 BIN 码
* 0x00 移动
* 0x02 电信
* 0x03 联通
* 0x04 其他
*/
private byte operator;
}
...@@ -2,6 +2,7 @@ package cn.com.glsx.evbusiness.modules.model.ocpp16; ...@@ -2,6 +2,7 @@ package cn.com.glsx.evbusiness.modules.model.ocpp16;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import lombok.ToString;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal; import java.math.BigDecimal;
...@@ -31,6 +32,7 @@ import java.util.Date; ...@@ -31,6 +32,7 @@ import java.util.Date;
*/ */
@Getter @Getter
@Setter @Setter
@ToString
public class TransactionRecordsData implements Serializable { public class TransactionRecordsData implements Serializable {
/** /**
* 参数名称:交易流水号 * 参数名称:交易流水号
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!